From 5d8cadb7b08b83e19c8782a0372d2692c99a34c1 Mon Sep 17 00:00:00 2001 From: anthony Date: Sun, 29 Aug 2010 23:59:33 -0700 Subject: [PATCH] correctly use session in plugin --- .../cloud/hypervisor/xen/resource/CitrixResourceBase.java | 2 -- scripts/vm/hypervisor/xenserver/hostvmstats.py | 4 ++-- scripts/vm/hypervisor/xenserver/vmops | 6 +++--- scripts/vm/hypervisor/xenserver/xenserver56/patch | 1 - 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java b/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java index bba83a16c8a..069e31b26c9 100644 --- a/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java +++ b/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java @@ -4516,8 +4516,6 @@ public abstract class CitrixResourceBase implements StoragePoolResource, ServerR s_logger.warn(msg); return new Answer(cmd, false, msg); } - sr.setNameLabel(conn, pool.getUuid()); - sr.setNameDescription(conn, pool.getName()); long capacity = sr.getPhysicalSize(conn); long available = capacity - sr.getPhysicalUtilisation(conn); if (capacity == -1) { diff --git a/scripts/vm/hypervisor/xenserver/hostvmstats.py b/scripts/vm/hypervisor/xenserver/hostvmstats.py index 8aa3eede4f9..a5047697c9f 100644 --- a/scripts/vm/hypervisor/xenserver/hostvmstats.py +++ b/scripts/vm/hypervisor/xenserver/hostvmstats.py @@ -12,14 +12,14 @@ def get_stats(session, collect_host_stats, consolidation_function, interval, sta if collect_host_stats == "true" : url = "http://localhost/rrd_updates?" - url += "session_id=" + session + url += "session_id=" + session._session url += "&host=" + collect_host_stats url += "&cf=" + consolidation_function url += "&interval=" + str(interval) url += "&start=" + str(int(time.time())-100) else : url = "http://localhost/rrd_updates?" - url += "session_id=" + session + url += "session_id=" + session._session url += "&host=" + collect_host_stats url += "&cf=" + consolidation_function url += "&interval=" + str(interval) diff --git a/scripts/vm/hypervisor/xenserver/vmops b/scripts/vm/hypervisor/xenserver/vmops index af7faeca3b1..4bffbef164f 100755 --- a/scripts/vm/hypervisor/xenserver/vmops +++ b/scripts/vm/hypervisor/xenserver/vmops @@ -38,9 +38,9 @@ def echo(fn): def get_xapi_session(): - xapi = XenAPI.xapi_local(); - xapi.login_with_password("","") - return xapi._session + session = XenAPI.xapi_local(); + session.login_with_password("","") + return session @echo def gethostvmstats(session, args): diff --git a/scripts/vm/hypervisor/xenserver/xenserver56/patch b/scripts/vm/hypervisor/xenserver/xenserver56/patch index 29dd2c7a08c..c7b20d84600 100644 --- a/scripts/vm/hypervisor/xenserver/xenserver56/patch +++ b/scripts/vm/hypervisor/xenserver/xenserver56/patch @@ -19,7 +19,6 @@ patch.tgz=..,0775,/opt/xensource/bin vmops=..,0755,/etc/xapi.d/plugins vmopsSnapshot=..,0755,/etc/xapi.d/plugins xs_cleanup.sh=..,0755,/opt/xensource/bin -systemvm-premium.iso=../../../../../vms,0644,/opt/xensource/packages/iso systemvm.iso=../../../../../vms,0644,/opt/xensource/packages/iso hostvmstats.py=..,0755,/opt/xensource/sm id_rsa.cloud=..,0600,/opt/xensource/bin