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);
|
s_logger.warn(msg);
|
||||||
return new Answer(cmd, false, msg);
|
return new Answer(cmd, false, msg);
|
||||||
}
|
}
|
||||||
sr.setNameLabel(conn, pool.getUuid());
|
|
||||||
sr.setNameDescription(conn, pool.getName());
|
|
||||||
long capacity = sr.getPhysicalSize(conn);
|
long capacity = sr.getPhysicalSize(conn);
|
||||||
long available = capacity - sr.getPhysicalUtilisation(conn);
|
long available = capacity - sr.getPhysicalUtilisation(conn);
|
||||||
if (capacity == -1) {
|
if (capacity == -1) {
|
||||||
|
|||||||
@ -12,14 +12,14 @@ def get_stats(session, collect_host_stats, consolidation_function, interval, sta
|
|||||||
|
|
||||||
if collect_host_stats == "true" :
|
if collect_host_stats == "true" :
|
||||||
url = "http://localhost/rrd_updates?"
|
url = "http://localhost/rrd_updates?"
|
||||||
url += "session_id=" + session
|
url += "session_id=" + session._session
|
||||||
url += "&host=" + collect_host_stats
|
url += "&host=" + collect_host_stats
|
||||||
url += "&cf=" + consolidation_function
|
url += "&cf=" + consolidation_function
|
||||||
url += "&interval=" + str(interval)
|
url += "&interval=" + str(interval)
|
||||||
url += "&start=" + str(int(time.time())-100)
|
url += "&start=" + str(int(time.time())-100)
|
||||||
else :
|
else :
|
||||||
url = "http://localhost/rrd_updates?"
|
url = "http://localhost/rrd_updates?"
|
||||||
url += "session_id=" + session
|
url += "session_id=" + session._session
|
||||||
url += "&host=" + collect_host_stats
|
url += "&host=" + collect_host_stats
|
||||||
url += "&cf=" + consolidation_function
|
url += "&cf=" + consolidation_function
|
||||||
url += "&interval=" + str(interval)
|
url += "&interval=" + str(interval)
|
||||||
|
|||||||
@ -38,9 +38,9 @@ def echo(fn):
|
|||||||
|
|
||||||
|
|
||||||
def get_xapi_session():
|
def get_xapi_session():
|
||||||
xapi = XenAPI.xapi_local();
|
session = XenAPI.xapi_local();
|
||||||
xapi.login_with_password("","")
|
session.login_with_password("","")
|
||||||
return xapi._session
|
return session
|
||||||
|
|
||||||
@echo
|
@echo
|
||||||
def gethostvmstats(session, args):
|
def gethostvmstats(session, args):
|
||||||
|
|||||||
@ -19,7 +19,6 @@ patch.tgz=..,0775,/opt/xensource/bin
|
|||||||
vmops=..,0755,/etc/xapi.d/plugins
|
vmops=..,0755,/etc/xapi.d/plugins
|
||||||
vmopsSnapshot=..,0755,/etc/xapi.d/plugins
|
vmopsSnapshot=..,0755,/etc/xapi.d/plugins
|
||||||
xs_cleanup.sh=..,0755,/opt/xensource/bin
|
xs_cleanup.sh=..,0755,/opt/xensource/bin
|
||||||
systemvm-premium.iso=../../../../../vms,0644,/opt/xensource/packages/iso
|
|
||||||
systemvm.iso=../../../../../vms,0644,/opt/xensource/packages/iso
|
systemvm.iso=../../../../../vms,0644,/opt/xensource/packages/iso
|
||||||
hostvmstats.py=..,0755,/opt/xensource/sm
|
hostvmstats.py=..,0755,/opt/xensource/sm
|
||||||
id_rsa.cloud=..,0600,/opt/xensource/bin
|
id_rsa.cloud=..,0600,/opt/xensource/bin
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user