Commit c02767f0 authored by Helga Velroyen's avatar Helga Velroyen
Browse files

Fix --shared-file-storage-dir option of gnt-cluster modify



While all infrastructure to make shared-file storage
runtime-configurable was already submitted, the actual
setting of the path was forgotten. This patch fixes it.
Signed-off-by: default avatarHelga Velroyen <helgav@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent 90240591
...@@ -1102,7 +1102,8 @@ def SetClusterParams(opts, args): ...@@ -1102,7 +1102,8 @@ def SetClusterParams(opts, args):
opts.ipolicy_vcpu_ratio is not None or opts.ipolicy_vcpu_ratio is not None or
opts.ipolicy_spindle_ratio is not None or opts.ipolicy_spindle_ratio is not None or
opts.modify_etc_hosts is not None or opts.modify_etc_hosts is not None or
opts.file_storage_dir is not None): opts.file_storage_dir is not None or
opts.shared_file_storage_dir is not None):
ToStderr("Please give at least one of the parameters.") ToStderr("Please give at least one of the parameters.")
return 1 return 1
...@@ -1214,6 +1215,7 @@ def SetClusterParams(opts, args): ...@@ -1214,6 +1215,7 @@ def SetClusterParams(opts, args):
enabled_disk_templates=enabled_disk_templates, enabled_disk_templates=enabled_disk_templates,
force=opts.force, force=opts.force,
file_storage_dir=opts.file_storage_dir, file_storage_dir=opts.file_storage_dir,
shared_file_storage_dir=opts.shared_file_storage_dir,
) )
SubmitOrSend(op, opts) SubmitOrSend(op, opts)
return 0 return 0
...@@ -2139,7 +2141,7 @@ commands = { ...@@ -2139,7 +2141,7 @@ commands = {
NODE_PARAMS_OPT, USE_EXTERNAL_MIP_SCRIPT, DISK_PARAMS_OPT, HV_STATE_OPT, NODE_PARAMS_OPT, USE_EXTERNAL_MIP_SCRIPT, DISK_PARAMS_OPT, HV_STATE_OPT,
DISK_STATE_OPT] + SUBMIT_OPTS + DISK_STATE_OPT] + SUBMIT_OPTS +
[ENABLED_DISK_TEMPLATES_OPT, IPOLICY_STD_SPECS_OPT, MODIFY_ETCHOSTS_OPT] + [ENABLED_DISK_TEMPLATES_OPT, IPOLICY_STD_SPECS_OPT, MODIFY_ETCHOSTS_OPT] +
INSTANCE_POLICY_OPTS + [GLOBAL_FILEDIR_OPT], INSTANCE_POLICY_OPTS + [GLOBAL_FILEDIR_OPT, GLOBAL_SHARED_FILEDIR_OPT],
"[opts...]", "[opts...]",
"Alters the parameters of the cluster"), "Alters the parameters of the cluster"),
"renew-crypto": ( "renew-crypto": (
......
...@@ -1205,6 +1205,18 @@ class LUClusterSetParams(LogicalUnit): ...@@ -1205,6 +1205,18 @@ class LUClusterSetParams(LogicalUnit):
else: else:
self.cluster.file_storage_dir = self.op.file_storage_dir self.cluster.file_storage_dir = self.op.file_storage_dir
def _SetSharedFileStorageDir(self, feedback_fn):
"""Set the shared file storage directory.
"""
if self.op.shared_file_storage_dir is not None:
if self.cluster.shared_file_storage_dir == \
self.op.shared_file_storage_dir:
feedback_fn("Global shared file storage dir already set to value '%s'"
% self.cluster.shared_file_storage_dir)
else:
self.cluster.shared_file_storage_dir = self.op.shared_file_storage_dir
def _SetDrbdHelper(self, feedback_fn): def _SetDrbdHelper(self, feedback_fn):
"""Set the DRBD usermode helper. """Set the DRBD usermode helper.
...@@ -1232,6 +1244,7 @@ class LUClusterSetParams(LogicalUnit): ...@@ -1232,6 +1244,7 @@ class LUClusterSetParams(LogicalUnit):
self._SetVgName(feedback_fn) self._SetVgName(feedback_fn)
self._SetFileStorageDir(feedback_fn) self._SetFileStorageDir(feedback_fn)
self._SetSharedFileStorageDir(feedback_fn)
self._SetDrbdHelper(feedback_fn) self._SetDrbdHelper(feedback_fn)
if self.op.hvparams: if self.op.hvparams:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment