Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes BZ#1563923: Add variable to avoid ignoring ganesha errors #501

Merged
merged 1 commit into from Apr 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Fixes BZ#1563923: Add variable to avoid ignoring ganesha errors
Currently, the implementation of nfs-ganesha with gdeploy takes
place where irrespective of whether pcs auth command fails or
not, gdeploy proceeds and executes creation of ganesha cluster.
This is not expected, and should avoid creation of ganesha cluster
incase pcs auth fails.

Signed-off-by: Devyani Kota <devyanikota@gmail.com>
  • Loading branch information
devyanikota committed Apr 18, 2018
commit 8556d566574bc676b2a6faffd067f7dc48d88145
35 changes: 35 additions & 0 deletions gdeployfeatures/nfs_ganesha/nfs_ganesha.json
Expand Up @@ -19,6 +19,11 @@
{
"name": "volname",
"required": "false"
},
{
"required": "false",
"name": "ignore_ganesha_errors",
"default": "yes"
}
]
},
Expand All @@ -27,6 +32,11 @@
{
"name": "cluster-nodes",
"required": "true"
},
{
"required": "false",
"name": "ignore_ganesha_errors",
"default": "yes"
}
]
},
Expand All @@ -43,13 +53,23 @@
{
"name": "vip",
"required": "true"
},
{
"required": "false",
"name": "ignore_ganesha_errors",
"default": "yes"
}
]
},
"delete-node": {
"options": [
{ "name": "nodes",
"required": "true"
},
{
"required": "false",
"name": "ignore_ganesha_errors",
"default": "yes"
}
]
},
Expand All @@ -58,6 +78,11 @@
{
"name": "volname",
"required": "true"
},
{
"required": "false",
"name": "ignore_ganesha_errors",
"default": "yes"
}
]
},
Expand All @@ -66,6 +91,11 @@
{
"name": "volname",
"required": "true"
},
{
"required": "false",
"name": "ignore_ganesha_errors",
"default": "yes"
}
]
},
Expand Down Expand Up @@ -96,6 +126,11 @@
"name": "ha-conf-dir",
"required": "false",
"default": "/etc/ganesha"
},
{
"required": "false",
"name": "ignore_ganesha_errors",
"default": "yes"
}
]
}
Expand Down
7 changes: 7 additions & 0 deletions gdeployfeatures/nfs_ganesha/nfs_ganesha.py
Expand Up @@ -9,6 +9,7 @@

def nfs_ganesha_create_cluster(section_dict):
global helpers
Global.ignore_errors = section_dict.get('ignore_ganesha_errors')
Global.logger.info("Creating NFS Ganesha cluster")
cluster_nodes = get_cluster_nodes(section_dict)
section_dict['ha_name'] = section_dict.pop('ha-name')
Expand Down Expand Up @@ -37,6 +38,7 @@ def nfs_ganesha_create_cluster(section_dict):

def nfs_ganesha_destroy_cluster(section_dict):
global helpers
Global.ignore_errors = section_dict.get('ignore_ganesha_errors')
Global.logger.info("Destroying NFS Ganesha cluster")
section_dict = get_base_dir(section_dict)
helpers.write_to_inventory('cluster_nodes',
Expand All @@ -45,6 +47,7 @@ def nfs_ganesha_destroy_cluster(section_dict):


def nfs_ganesha_add_node(section_dict):
Global.ignore_errors = section_dict.get('ignore_ganesha_errors')
Global.logger.info("Adding nodes to NFS Ganesha cluster")
new_nodes = helpers.listify(section_dict.get('nodes'))
cluster_nodes = section_dict.get('cluster_nodes')
Expand All @@ -69,12 +72,14 @@ def nfs_ganesha_add_node(section_dict):


def nfs_ganesha_delete_node(section_dict):
Global.ignore_errors = section_dict.get('ignore_ganesha_errors')
section_dict = get_base_dir(section_dict)
Global.logger.info("Deleting nodes from NFS Ganesha cluster")
return section_dict, defaults.GANESHA_DELETE_NODE


def nfs_ganesha_export_volume(section_dict):
Global.ignore_errors = section_dict.get('ignore_ganesha_errors')
section_dict['value'] = "on"
section_dict = get_base_dir(section_dict)
Global.logger.info("Exporting NFS Ganesha cluster volume")
Expand All @@ -83,13 +88,15 @@ def nfs_ganesha_export_volume(section_dict):


def nfs_ganesha_unexport_volume(section_dict):
Global.ignore_errors = section_dict.get('ignore_ganesha_errors')
section_dict['value'] = "off"
section_dict = get_base_dir(section_dict)
Global.logger.info("Unexporting NFS Ganesha cluster volume")
return section_dict, defaults.GANESHA_VOL_EXPORT


def nfs_ganesha_refresh_config(section_dict):
Global.ignore_errors = section_dict.get('ignore_ganesha_errors')
del_lines = list_to_string(section_dict.get('del-config-lines'))
Global.logger.info("Running refresh config on NFS Ganesha volume")
# Split the string which is `|' delimited. Escaped `|' is handled gracefully
Expand Down