Commit f2165b8a authored by Iustin Pop's avatar Iustin Pop
Browse files

Simplify and extend the instance OS env

Some parameters were missing (uuid, c/mtime). We simplify the export
method; unfortunately we cannot simply iterate over __slots__ since the
mapping is not 1:1.
Signed-off-by: default avatarIustin Pop <>
Reviewed-by: default avatarMichael Hanselmann <>
parent 729c4377
......@@ -1995,8 +1995,9 @@ def OSEnvironment(instance, inst_os, debug=0):
result = OSCoreEnv(instance.os, inst_os, instance.osparams, debug=debug)
result['INSTANCE_NAME'] =
result['INSTANCE_OS'] = instance.os
for attr in ["name", "os", "uuid", "ctime", "mtime"]:
result["INSTANCE_%s" % attr.upper()] = str(getattr(instance, attr))
result['HYPERVISOR'] = instance.hypervisor
result['DISK_COUNT'] = '%d' % len(instance.disks)
result['NIC_COUNT'] = '%d' % len(instance.nics)
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