summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorJohannes Erdfelt <johannes.erdfelt@rackspace.com>2012-08-07 23:19:04 +0000
committerJohannes Erdfelt <johannes.erdfelt@rackspace.com>2012-08-07 23:19:04 +0000
commit31f3383ae4953019267c67e4fbd2214b03bc8da8 (patch)
tree5db16e26440ef8566954c6da6faf01c2d89af5a3 /plugins
parenta418654b070c63c4bed5e3e5523fb947934626f9 (diff)
downloadnova-31f3383ae4953019267c67e4fbd2214b03bc8da8.tar.gz
nova-31f3383ae4953019267c67e4fbd2214b03bc8da8.tar.xz
nova-31f3383ae4953019267c67e4fbd2214b03bc8da8.zip
xenapi: wait for agent resetnetwork response
Unlike every other agent command, the resetnetwork command would not wait for a response. All failures were silently ignored. Change this to at least log a message if an error occurs. Change-Id: I40e323607b2ce50869f3bf11e4582ff83cbed1c0
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/xenserver/xenapi/etc/xapi.d/plugins/agent12
1 files changed, 5 insertions, 7 deletions
diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/agent b/plugins/xenserver/xenapi/etc/xapi.d/plugins/agent
index fa1558bd7..07122ba88 100755
--- a/plugins/xenserver/xenapi/etc/xapi.d/plugins/agent
+++ b/plugins/xenserver/xenapi/etc/xapi.d/plugins/agent
@@ -43,12 +43,6 @@ import xenstore
AGENT_TIMEOUT = 30
-def jsonify(fnc):
- def wrapper(*args, **kwargs):
- return json.dumps(fnc(*args, **kwargs))
- return wrapper
-
-
class TimeoutError(StandardError):
pass
@@ -105,7 +99,6 @@ def password(self, arg_dict):
return resp
-@jsonify
def resetnetwork(self, arg_dict):
"""Writes a resquest to xenstore that tells the agent
to reset networking.
@@ -114,6 +107,11 @@ def resetnetwork(self, arg_dict):
request_id = arg_dict['id']
arg_dict['path'] = "data/host/%s" % request_id
xenstore.write_record(self, arg_dict)
+ try:
+ resp = _wait_for_agent(self, request_id, arg_dict)
+ except TimeoutError, e:
+ raise PluginError(e)
+ return resp
def inject_file(self, arg_dict):