Commit dc3dcdaf authored by Jose A. Lopes's avatar Jose A. Lopes
Browse files

Add 'SF_NODE' to 'VALID_STORAGE_FIELDS'



Constant 'SF_NODE' is a storage field and, therefore, should be in
'VALID_STORAGE_FIELDS'.  This patch fixes this and also reference to
these constants, namely, in 'cmdlib' and 'qa'.
Signed-off-by: default avatarJose A. Lopes <jabolopes@google.com>
Reviewed-by: default avatarThomas Thrainer <thomasth@google.com>
parent c2266ec8
......@@ -1392,11 +1392,10 @@ class LUNodeQueryStorage(NoHooksLU):
"""Logical unit for getting information on storage units on node(s).
"""
_FIELDS_STATIC = utils.FieldSet(constants.SF_NODE)
REQ_BGL = False
def CheckArguments(self):
_CheckOutputFields(static=self._FIELDS_STATIC,
_CheckOutputFields(static=utils.FieldSet(),
dynamic=utils.FieldSet(*constants.VALID_STORAGE_FIELDS),
selected=self.op.output_fields)
......
......@@ -415,6 +415,7 @@ SO_FIX_CONSISTENCY = "fix-consistency"
# Available fields per storage type
VALID_STORAGE_FIELDS = compat.UniqueFrozenset([
SF_NODE,
SF_NAME,
SF_TYPE,
SF_SIZE,
......
......@@ -129,8 +129,7 @@ def TestNodeStorage():
# Test all storage fields
cmd = ["gnt-node", "list-storage", "--storage-type", storage_type,
"--output=%s" % ",".join(list(constants.VALID_STORAGE_FIELDS) +
[constants.SF_NODE])]
"--output=%s" % ",".join(list(constants.VALID_STORAGE_FIELDS))]
AssertCommand(cmd)
# Get list of valid storage devices
......
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