From 3704d7a2e7097d429ac8b77cfcca9ce160ed363b Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Tue, 16 Oct 2007 01:07:04 -0400 Subject: [PATCH] use the new remctl interface svn path=/trunk/web/; revision=197 --- templates/main.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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 -- 1.7.9.5