~ubuntu-branches/ubuntu/quantal/nova/quantal-proposed

« back to all changes in this revision

Viewing changes to plugins/xenserver/xenapi/etc/xapi.d/plugins/xenhost

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-08-16 14:04:11 UTC
  • mto: This revision was merged to the branch mainline in revision 84.
  • Revision ID: package-import@ubuntu.com-20120816140411-0mr4n241wmk30t9l
Tags: upstream-2012.2~f3
ImportĀ upstreamĀ versionĀ 2012.2~f3

Show diffs side-by-side

added added

removed removed

Lines of Context:
227
227
    # either execute iptable-save or iptables-restore
228
228
    # command must be only one of these two
229
229
    # process_input must be used only with iptables-restore
230
 
    if len(cmd) > 0 and cmd[0] in ('iptables-save', 'iptables-restore'):
 
230
    if len(cmd) > 0 and cmd[0] in ('iptables-save',
 
231
                                   'iptables-restore',
 
232
                                   'ip6tables-save',
 
233
                                   'ip6tables-restore'):
231
234
        result = _run_command_with_input(cmd, process_input)
232
235
        ret_str = json.dumps(dict(out=result,
233
236
                                  err=''))
339
342
    return data
340
343
 
341
344
 
 
345
@jsonify
 
346
def host_uptime(self, arg_dict):
 
347
    """Returns the result of the uptime command on the xenhost."""
 
348
    return {"uptime": _run_command('uptime')}
 
349
 
 
350
 
342
351
def cleanup(dct):
343
352
    """Take the raw KV pairs returned and translate them into the
344
353
    appropriate types, discarding any we don't need.
432
441
            "host_join": host_join,
433
442
            "get_config": get_config,
434
443
            "set_config": set_config,
435
 
            "iptables_config": iptables_config})
 
444
            "iptables_config": iptables_config,
 
445
            "host_uptime": host_uptime})