Commit 6dfad215 authored by Iustin Pop's avatar Iustin Pop
Browse files

Fix checking for valid OS in instance create



The current check in LUCreateInstance.CheckPrereq() is wrong - it only checks
if we got an OS, but not if we got a valid OS. This patch fixes it.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent c98162a7
...@@ -4730,7 +4730,7 @@ class LUCreateInstance(LogicalUnit): ...@@ -4730,7 +4730,7 @@ class LUCreateInstance(LogicalUnit):
# os verification # os verification
result = self.rpc.call_os_get(pnode.name, self.op.os_type) result = self.rpc.call_os_get(pnode.name, self.op.os_type)
result.Raise() result.Raise()
if not isinstance(result.data, objects.OS): if not isinstance(result.data, objects.OS) or not result.data:
raise errors.OpPrereqError("OS '%s' not in supported os list for" raise errors.OpPrereqError("OS '%s' not in supported os list for"
" primary node" % self.op.os_type) " primary node" % self.op.os_type)
......
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