Commit 87b2cd45 authored by Iustin Pop's avatar Iustin Pop
Browse files

Rename the _oss cluster vars to _os

Per the mailing list discussion, rename _oss to _os, both in cluster parameters
and in the rest of the code.

This is just an s/_oss/_os, with the exception of a small bit of cleanup
around the helper_os function in
Signed-off-by: default avatarIustin Pop <>
Reviewed-by: default avatarMichael Hanselmann <>
parent 052ee117
......@@ -2625,12 +2625,12 @@ class LUSetClusterParams(LogicalUnit):
("drbd_helper", None, _TOr(_TString, _TNone)),
("default_iallocator", None, _TMaybeString),
("reserved_lvs", None, _TOr(_TListOf(_TNonEmptyString), _TNone)),
("hidden_oss", None, _TOr(_TListOf(\
("hidden_os", None, _TOr(_TListOf(\
_TMap(lambda v: v[0], _TElemOf(constants.DDMS_VALUES)))),
("blacklisted_oss", None, _TOr(_TListOf(\
("blacklisted_os", None, _TOr(_TListOf(\
_TMap(lambda v: v[0], _TElemOf(constants.DDMS_VALUES)))),
......@@ -2908,7 +2908,8 @@ class LUSetClusterParams(LogicalUnit):
if self.op.reserved_lvs is not None:
self.cluster.reserved_lvs = self.op.reserved_lvs
def helper_oss(aname, mods, desc):
def helper_os(aname, mods, desc):
desc += " OS list"
lst = getattr(self.cluster, aname)
for key, val in mods:
if key == constants.DDM_ADD:
......@@ -2924,13 +2925,11 @@ class LUSetClusterParams(LogicalUnit):
raise errors.ProgrammerError("Invalid modification '%s'" % key)
if self.op.hidden_oss:
helper_oss("hidden_oss", self.op.hidden_oss,
"hidden OS list")
if self.op.hidden_os:
helper_os("hidden_os", self.op.hidden_os, "hidden")
if self.op.blacklisted_oss:
helper_oss("blacklisted_oss", self.op.blacklisted_oss,
"blacklisted OS list")
if self.op.blacklisted_os:
helper_os("blacklisted_os", self.op.blacklisted_os, "blacklisted")
self.cfg.Update(self.cluster, feedback_fn)
......@@ -3214,8 +3213,8 @@ class LUDiagnoseOS(NoHooksLU):
is_hid = os_name in cluster.hidden_oss
is_blk = os_name in cluster.blacklisted_oss
is_hid = os_name in cluster.hidden_os
is_blk = os_name in cluster.blacklisted_os
if ((self._HID not in self.op.output_fields and is_hid) or
(self._BLK not in self.op.output_fields and is_blk) or
(self._VLD not in self.op.output_fields and not valid)):
......@@ -6700,7 +6699,7 @@ class LUCreateInstance(LogicalUnit):
if self.op.os_type is None:
raise errors.OpPrereqError("No guest OS specified",
if self.op.os_type in self.cfg.GetClusterInfo().blacklisted_oss:
if self.op.os_type in self.cfg.GetClusterInfo().blacklisted_os:
raise errors.OpPrereqError("Guest OS '%s' is not allowed for"
" installation" % self.op.os_type,
......@@ -957,8 +957,8 @@ class Cluster(TaggableObject):
def UpgradeConfig(self):
......@@ -1025,11 +1025,11 @@ class Cluster(TaggableObject):
self.reserved_lvs = []
# hidden and blacklisted operating systems added before 2.2.1
if self.hidden_oss is None:
self.hidden_oss = []
if self.hidden_os is None:
self.hidden_os = []
if self.blacklisted_oss is None:
self.blacklisted_oss = []
if self.blacklisted_os is None:
self.blacklisted_os = []
def ToDict(self):
"""Custom function for cluster.
......@@ -315,8 +315,8 @@ class OpSetClusterParams(OpCode):
......@@ -273,8 +273,8 @@ def ModifyOS(opts, args):
op = opcodes.OpSetClusterParams(os_hvp=os_hvp,
SubmitOpCode(op, opts=opts)
return 0
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