Commit 66fa5890 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Catch case when there are no nodes in the testbed, as when setting up

a new testbed.
parent c5aec020
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2006 University of Utah and the Flux Group.
# Copyright (c) 2000-2007 University of Utah and the Flux Group.
# All rights reserved.
#
require("defs.php3");
......@@ -88,6 +88,8 @@ function SHOWSTATS()
#
function SHOWFREENODES()
{
$freecounts = array();
# Get typelist and set freecounts to zero.
$query_result =
DBQueryFatal("select n.type from nodes as n ".
......@@ -98,6 +100,10 @@ function SHOWFREENODES()
$freecounts[$type] = 0;
}
if (!count($freecounts)) {
return "";
}
# Get free totals by type.
$query_result =
DBQueryFatal("select n.eventstate,n.type,count(*) from nodes as n ".
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment