From: Quentin Smith Date: Fri, 25 Nov 2011 01:42:19 +0000 (-0500) Subject: Handle domains spinning in pygrub X-Git-Tag: 0.1.22^0 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web.git/commitdiff_plain/cae84bf926ab97cc5e57aeac6b13b9087653117e Handle domains spinning in pygrub --- diff --git a/code/main.py b/code/main.py index 0edcb65..38b677c 100755 --- a/code/main.py +++ b/code/main.py @@ -605,8 +605,12 @@ def infoDict(username, state, machine): else: main_status = dict(status[1:]) main_status['host'] = controls.listHost(machine) - start_time = float(main_status.get('start_time', 0)) - uptime = datetime.timedelta(seconds=int(time.time()-start_time)) + start_time = main_status.get('start_time') + if start_time is None: + uptime = "Still booting?" + else: + start_time = float(start_time) + uptime = datetime.timedelta(seconds=int(time.time()-start_time)) cpu_time_float = float(main_status.get('cpu_time', 0)) cputime = datetime.timedelta(seconds=int(cpu_time_float)) display_fields = [('name', 'Name'), diff --git a/code/templates/list.mako b/code/templates/list.mako index 3d0c50c..e6ed39f 100644 --- a/code/templates/list.mako +++ b/code/templates/list.mako @@ -96,21 +96,24 @@ ${self.fn.cdromList(defaults.cdrom, "$('cd_or_auto_cd').checked = true;$('autoin <%def name="machineRow(machine, dark)"> +<% + on = (machine.uptime is not None) +%> - % if machine.uptime and installing[machine]: + % if on and installing[machine]: Installing... % else: -
+ - @@ -127,7 +130,7 @@ ${self.fn.cdromList(defaults.cdrom, "$('cd_or_auto_cd').checked = true;$('autoin % endif \ -% if machine.uptime: +% if on: ${datetime.timedelta(seconds=int(machine.uptime))}\ % endif diff --git a/debian/changelog b/debian/changelog index fbcd172..863f1c2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +invirt-web (0.1.22) unstable; urgency=low + + * Handle domains spinning in pygrub + + -- Quentin Smith Thu, 24 Nov 2011 20:42:09 -0500 + invirt-web (0.1.21) unstable; urgency=low * Fix strict validation of description field