From f2165b8aff2d8331625b9930af591383d8db3d05 Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Mon, 25 Oct 2010 12:06:20 +0200 Subject: [PATCH] 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: Iustin Pop Reviewed-by: Michael Hanselmann --- lib/backend.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/backend.py b/lib/backend.py index 1d0d15f..8abe5a6 100644 --- a/lib/backend.py +++ b/lib/backend.py @@ -1995,8 +1995,9 @@ def OSEnvironment(instance, inst_os, debug=0): """ result = OSCoreEnv(instance.os, inst_os, instance.osparams, debug=debug) - result['INSTANCE_NAME'] = 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) -- 1.7.10.4