diff --git a/lib/cmdlib.py b/lib/cmdlib.py index eefb44f59fad2fa5217313086f07463c96a123bc..c7370c7608be7fa090668b747d2189835df009e0 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -3334,7 +3334,7 @@ class LUCreateInstance(LogicalUnit): self.check_ip = hostname1.ip # MAC address verification - if self.op.mac != "auto": + if self.op.mac not in (constants.VALUE_AUTO, constants.VALUE_GENERATE): if not utils.IsValidMac(self.op.mac.lower()): raise errors.OpPrereqError("invalid MAC address specified: %s" % self.op.mac) @@ -3588,7 +3588,7 @@ class LUCreateInstance(LogicalUnit): instance = self.op.instance_name pnode_name = self.pnode.name - if self.op.mac == "auto": + if self.op.mac in (constants.VALUE_AUTO, constants.VALUE_GENERATE): mac_address = self.cfg.GenerateMAC() else: mac_address = self.op.mac