From: Dimitris Bliablias <[email protected]> This patch, adds the 'gluster' storage type to the set of storage types for which full node storage reporting is available. This set is used by the 'LUNodeQueryStorage' logical unit for getting information on storage units on node(s).
Signed-off-by: Dimitris Bliablias <[email protected]> Signed-off-by: Petr Pudlak <[email protected]> Reviewed-by: Petr Pudlak <[email protected]> Signed-off-by: Lisa Velden <[email protected]> --- lib/client/gnt_node.py | 1 + lib/cmdlib/node.py | 10 +++------- lib/storage/container.py | 1 + man/gnt-node.rst | 2 +- src/Ganeti/Constants.hs | 4 +++- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/client/gnt_node.py b/lib/client/gnt_node.py index 676f54a..4f89da0 100644 --- a/lib/client/gnt_node.py +++ b/lib/client/gnt_node.py @@ -99,6 +99,7 @@ _USER_STORAGE_TYPE = { constants.ST_LVM_PV: "lvm-pv", constants.ST_LVM_VG: "lvm-vg", constants.ST_SHARED_FILE: "sharedfile", + constants.ST_GLUSTER: "gluster", } _STORAGE_TYPE_OPT = \ diff --git a/lib/cmdlib/node.py b/lib/cmdlib/node.py index 5b90ad3..1b13aa9 100644 --- a/lib/cmdlib/node.py +++ b/lib/cmdlib/node.py @@ -1159,13 +1159,9 @@ def _GetStorageTypeArgs(cfg, storage_type): if storage_type == constants.ST_FILE: return [[cfg.GetFileStorageDir()]] elif storage_type == constants.ST_SHARED_FILE: - dts = cfg.GetClusterInfo().enabled_disk_templates - paths = [] - if constants.DT_SHARED_FILE in dts: - paths.append(cfg.GetSharedFileStorageDir()) - if constants.DT_GLUSTER in dts: - paths.append(cfg.GetGlusterStorageDir()) - return [paths] + return [[cfg.GetSharedFileStorageDir()]] + elif storage_type == constants.ST_GLUSTER: + return [[cfg.GetGlusterStorageDir()]] else: return [] diff --git a/lib/storage/container.py b/lib/storage/container.py index 5d1afb4..ef825da 100644 --- a/lib/storage/container.py +++ b/lib/storage/container.py @@ -480,6 +480,7 @@ _STORAGE_TYPES = { constants.ST_LVM_PV: LvmPvStorage, constants.ST_LVM_VG: LvmVgStorage, constants.ST_SHARED_FILE: FileStorage, + constants.ST_GLUSTER: FileStorage, } diff --git a/man/gnt-node.rst b/man/gnt-node.rst index 21dade0..8b755e3 100644 --- a/man/gnt-node.rst +++ b/man/gnt-node.rst @@ -451,7 +451,7 @@ parsing by scripts. In both cases, the ``--units`` option can be used to enforce a given output unit. The ``--storage-type`` option can be used to choose a storage unit -type. Possible choices are lvm-pv, lvm-vg or file. +type. Possible choices are lvm-pv, lvm-vg, file, sharedfile and gluster. The ``-o (--output)`` option takes a comma-separated list of output fields. The available fields and their meaning are: diff --git a/src/Ganeti/Constants.hs b/src/Ganeti/Constants.hs index d0ae44b..7fd11c3 100644 --- a/src/Ganeti/Constants.hs +++ b/src/Ganeti/Constants.hs @@ -744,7 +744,9 @@ stsReport = ConstantUtils.mkSet [stFile, stLvmPv, stLvmVg] -- | (as used by LUQueryNodeStorage) stsReportNodeStorage :: FrozenSet String stsReportNodeStorage = ConstantUtils.union stsReport $ - ConstantUtils.mkSet [stSharedFile] + ConstantUtils.mkSet [ stSharedFile + , stGluster + ] -- * Storage fields -- ** First two are valid in LU context only, not passed to backend -- 2.2.0.rc0.207.ga3a616c
