mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
correctly use session in plugin
This commit is contained in:
parent
93b56fec8c
commit
5d8cadb7b0
@ -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) {
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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):
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user