Commit 51e9eef6 authored by Helga Velroyen's avatar Helga Velroyen
Browse files

Improve error handling when looking up instances

When looking up configuration data of instances which don't
exist, the code so far fails with a cryptic error messages
about NoneType not having an attribute. Although actually
this situation should not happen, let's at least throw an
exception with a proper description.
Signed-off-by: default avatarHelga Velroyen <>
Reviewed-by: default avatarPetr Pudlak <>
parent c1ff2832
......@@ -2892,7 +2892,7 @@ class LUClusterVerifyGroup(LogicalUnit, _VerifyErrors):
if test:
nimg.hyp_fail = True
nimg.instances = [inst.uuid for (_, inst) in
nimg.instances = [uuid for (uuid, _) in
def _UpdateNodeInfo(self, ninfo, nresult, nimg, vg_name):
......@@ -1782,7 +1782,11 @@ class ConfigWriter(object):
result = []
for name in inst_names:
instance = self._UnlockedGetInstanceInfoByName(name)
result.append((instance.uuid, instance))
if instance:
result.append((instance.uuid, instance))
raise errors.ConfigurationError("Instance data of instance '%s'"
" not found." % name)
return result
@locking.ssynchronized(_config_lock, shared=1)
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