diff options
| author | Sandy Walsh <sandy.walsh@rackspace.com> | 2011-02-17 17:39:03 -0400 |
|---|---|---|
| committer | Sandy Walsh <sandy.walsh@rackspace.com> | 2011-02-17 17:39:03 -0400 |
| commit | 782a5736b01f44af43f742de537bdbe4bbda6d88 (patch) | |
| tree | bdd2fbb08a98b66d9140a9be71f3a8b23778345b /plugins | |
| parent | 5a988eb393c306097250a7f17ea65f0919fd9219 (diff) | |
| parent | 52753aae3486f654b9fb19d6423fc26dc180644d (diff) | |
| download | nova-782a5736b01f44af43f742de537bdbe4bbda6d88.tar.gz nova-782a5736b01f44af43f742de537bdbe4bbda6d88.tar.xz nova-782a5736b01f44af43f742de537bdbe4bbda6d88.zip | |
changed from 003-004 migration
Diffstat (limited to 'plugins')
| -rwxr-xr-x | plugins/xenserver/xenapi/etc/xapi.d/plugins/agent | 15 |
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}) |
