summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorSandy Walsh <sandy.walsh@rackspace.com>2011-02-17 17:40:57 -0400
committerSandy Walsh <sandy.walsh@rackspace.com>2011-02-17 17:40:57 -0400
commit432763e319cd2378a30ad103ad0fc3343ef7ff21 (patch)
tree9d929edee20fbba5852602064b45a049e28cc210 /plugins
parent46269872192b843c80d72206a05c8b759c9f66a8 (diff)
parent782a5736b01f44af43f742de537bdbe4bbda6d88 (diff)
merge with zone phase 1
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/xenserver/xenapi/etc/xapi.d/plugins/agent15
1 files changed, 14 insertions, 1 deletions
diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/agent b/plugins/xenserver/xenapi/etc/xapi.d/plugins/agent
index 031a49708..f99ea4082 100755
--- a/plugins/xenserver/xenapi/etc/xapi.d/plugins/agent
+++ b/plugins/xenserver/xenapi/etc/xapi.d/plugins/agent
@@ -91,6 +91,18 @@ 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.
+
+ """
+ arg_dict['value'] = json.dumps({'name': 'resetnetwork', 'value': ''})
+ request_id = arg_dict['id']
+ arg_dict['path'] = "data/host/%s" % request_id
+ xenstore.write_record(self, arg_dict)
+
+
def _wait_for_agent(self, request_id, arg_dict):
"""Periodically checks xenstore for a response from the agent.
The request is always written to 'data/host/{id}', and
@@ -124,4 +136,5 @@ def _wait_for_agent(self, request_id, arg_dict):
if __name__ == "__main__":
XenAPIPlugin.dispatch(
{"key_init": key_init,
- "password": password})
+ "password": password,
+ "resetnetwork": resetnetwork})