summaryrefslogtreecommitdiffstats
path: root/plugins/xenserver
diff options
context:
space:
mode:
authorCerberus <matt.dietz@rackspace.com>2011-02-17 14:23:28 -0600
committerCerberus <matt.dietz@rackspace.com>2011-02-17 14:23:28 -0600
commit0c002f443de98b8d0164f7ad801f9ff5ef901101 (patch)
tree5d7cef28e337912c1145a9097ca75e38a03d3e30 /plugins/xenserver
parent3dd6e369c0aa2e3092eaa32a6b04cbba712ba5ad (diff)
parent2f48d2ab1cccfc68516e89f58cf5033032da70f5 (diff)
Merge from trunk
Diffstat (limited to 'plugins/xenserver')
-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})