From: Tim Abbott Date: Tue, 16 Oct 2007 05:07:04 +0000 (-0400) Subject: use the new remctl interface X-Git-Tag: sipb-xen-www/1~52 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web.git/commitdiff_plain/3704d7a2e7097d429ac8b77cfcca9ce160ed363b?ds=sidebyside use the new remctl interface svn path=/trunk/web/; revision=197 --- diff --git a/templates/main.py b/templates/main.py index ed5f09c..a25257f 100755 --- a/templates/main.py +++ b/templates/main.py @@ -217,10 +217,10 @@ def bootMachine(machine, cdtype): id of the CD (e.g. 'gutsy_i386') """ if cdtype is not None: - remctl('web', 'vmboot', machine.name, + remctl('control', machine.name, 'create', cdtype) else: - remctl('web', 'vmboot', machine.name) + remctl('control', machine.name, 'create') def registerMachine(machine): """Register a machine to be controlled by the web interface""" @@ -274,7 +274,7 @@ def statusInfo(machine): Gets and parses xm list --long """ - value_string, err_string = remctl('list-long', machine.name, err=True) + value_string, err_string = remctl('control', machine.name, 'list-long', err=True) if 'Unknown command' in err_string: raise CodeError("ERROR in remctl list-long %s is not registered" % (machine.name,)) elif 'does not exist' in err_string: @@ -538,7 +538,7 @@ def getDiskInfo(data_dict, machine): def deleteVM(machine): """Delete a VM.""" - remctl('destroy', machine.name, err=True) + remctl('control', machine.name, 'destroy', err=True) transaction = ctx.current.create_transaction() delete_disk_pairs = [(machine.name, d.guest_device_name) for d in machine.disks] try: @@ -570,18 +570,18 @@ def command(user, fields): raise CodeError("Invalid action '%s'" % action) if action == 'Reboot': if cdrom is not None: - remctl('reboot', machine.name, cdrom) + remctl('control', machine.name, 'reboot', cdrom) else: - remctl('reboot', machine.name) + remctl('control', machine.name, 'reboot') elif action == 'Power on': if maxMemory(user) < machine.memory: raise InvalidInput('action', 'Power on', "You don't have enough free RAM quota to turn on this machine") bootMachine(machine, cdrom) elif action == 'Power off': - remctl('destroy', machine.name) + remctl('control', machine.name, 'destroy') elif action == 'Shutdown': - remctl('shutdown', machine.name) + remctl('control', machine.name, 'shutdown') elif action == 'Delete VM': deleteVM(machine) print >> sys.stderr, time.time()-start_time