This removes superfluous warning about storage types that are not enabled during cluster initialization.
Signed-off-by: Viktor Bachraty <[email protected]> --- lib/bootstrap.py | 9 +++++++-- lib/cli_opts.py | 3 +-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/bootstrap.py b/lib/bootstrap.py index 80f0da7..eaad4ec 100644 --- a/lib/bootstrap.py +++ b/lib/bootstrap.py @@ -354,8 +354,14 @@ def _PrepareFileBasedStorage( constants.ST_FILE, constants.ST_SHARED_FILE, constants.ST_GLUSTER )) + file_storage_enabled = file_disk_template in enabled_disk_templates + if file_storage_dir is None: - file_storage_dir = default_dir + if file_storage_enabled: + file_storage_dir = default_dir + else: + file_storage_dir = "" + if not acceptance_fn: acceptance_fn = \ lambda path: filestorage.CheckFileStoragePathAcceptance( @@ -364,7 +370,6 @@ def _PrepareFileBasedStorage( _storage_path_acceptance_fn(logging.warning, file_storage_dir, enabled_disk_templates) - file_storage_enabled = file_disk_template in enabled_disk_templates if file_storage_enabled: try: acceptance_fn(file_storage_dir) diff --git a/lib/cli_opts.py b/lib/cli_opts.py index 73a2ca9..1728684 100644 --- a/lib/cli_opts.py +++ b/lib/cli_opts.py @@ -1188,8 +1188,7 @@ GLOBAL_GLUSTER_FILEDIR_OPT = cli_option( help="Specify the default directory (cluster-wide) for mounting Gluster" " file systems [%s]" % pathutils.DEFAULT_GLUSTER_STORAGE_DIR, - metavar="GLUSTERDIR", - default=pathutils.DEFAULT_GLUSTER_STORAGE_DIR) + metavar="GLUSTERDIR", default=None) NOMODIFY_ETCHOSTS_OPT = cli_option("--no-etc-hosts", dest="modify_etc_hosts", help="Don't modify %s" % pathutils.ETC_HOSTS, -- 2.6.0.rc2.230.g3dd15c0
