Commit c043368a authored by Mac Newbold's avatar Mac Newbold

Latest fixes for db changes

parent bd7ead09
......@@ -5,11 +5,11 @@ my $d = 0; #debug mode
if ($#ARGV >= 0 && $ARGV[0] =~ /^-?h/i ) {
die("Usage:\navail [help] [type[=<type>]] [OS[=<OS>]] [ver[=<OS_ver>]]\n".
"\t[extras=<extra[,extra,...]>]".
" [deltas=<delta[,delta,...]>]".
# " [fixes=<fix_name[,fix_name,...]>]".
"\n".
"Type \t\t= pc | shark\n"."OS \t\t= Linux | FreeBSD | NetBSD | ...\n".
"ver \t\t= 6.2 | 3.4 | 4.0 | 5.2 | ...\n"."extras \t\t= anetd | ...\n".
"type \t= pc | shark\n"."OS \t= Linux | FreeBSD | NetBSD | ...\n".
"ver \t= 6.2 | 3.4 | 4.0 | 5.2 | ...\n"."deltas \t= anetd | ...\n".
# "fixes \t\t= cron_off | sendmail_off | ...\n"
"A field name alone will show that field in the display of available\n".
"nodes. A field name with '=' will match nodes that have that field\n".
......@@ -25,7 +25,7 @@ print "Got ARGS = ",join(" ",@ARGV),"\n" if $d;
my %args = ();
while ($#ARGV >= 0) {
$_ = shift;
if ( ! /=/ ) { $args{$_}='='; } else {
if ( ! /=/ ) { $args{"\L$_"}='='; } else {
@_ = split('=',$_);
my ($opt,$val) = @_ if ($#_ >= 0);
if (!defined($val)) { $val=""; }
......@@ -41,39 +41,42 @@ if ( $d ) {
my $join= "nodes as a left join reserved as b on a.node_id=b.node_id";
my $cols= "a.node_id,a.type";
my $cond= "b.node_id is null and a.type!='switch'";
my $img = 0;
my $cond= "b.node_id is null and a.type!='cisco' and a.type!='APC'";
my $os = 0;
my $delta = 0;
if (defined($args{"type"})) {
$cond .= " and a.type='".$args{"type"}."'" if $args{"type"} ne '=';
}
if (defined($args{"OS"})) {
$img = 1;
if (defined($args{"os"})) {
$os = 1;
$cols .= ",d.OS";
$cond .= " and d.OS='".$args{"OS"}."'" if $args{"OS"} ne '=';
$cond .= " and d.OS='".$args{"os"}."'" if $args{"os"} ne '=';
}
if (defined($args{"ver"})) {
$img = 1;
$os = 1;
$cols .= ",d.ver";
$cond .= " and d.ver='".$args{"ver"}."'" if $args{"ver"} ne '=';
}
if (defined($args{"extras"})) {
$img = 1;
$cols .= ",d.extras";
$cond .= " and d.extras='".$args{"extras"}."'" if $args{"extras"} ne '=';
if (defined($args{"deltas"})) {
$os = 1;
$delta=1;
$cols .= ",e.delta_id";
$cond .= " and e.delta_id='".$args{"deltas"}."'" if $args{"deltas"} ne '=';
}
#if (defined($args{"fixes"})) {
# $join .= "";
# $cols .= ",d.fix_name";
# $cond .= " and fix_name=";
#}
if ($img) {
$join .= " left join SW_table as c on a.node_id=c.node_id";
if ($os) {
$join .= " left join partitions as c on a.node_id=c.node_id";
$join .= " left join disk_images as d on c.image_id=d.image_id";
}
my $cmd = "select $cols from $join where $cond";
if ($delta) {
$join .= " left join delta_inst as e on c.node_id=e.node_id ".
"and c.partition=e.partition";
}
my $cmd = "select $cols from $join where $cond order by node_id,type";
print "Sending cmd:\n$cmd\n" if $d;
......
......@@ -41,10 +41,10 @@ open(TMP,">$filename");
print TMP "graph: {\n orientation: left_to_right\n".
" title: \"Testbed Database Relational Graph - ".$date."\"\n";
print TMP " display_edge_labels: yes\n scaling: 0.45\n";
print TMP " display_edge_labels: yes\n scaling: 0.40\n";
print TMP " height: 1000\n width: 500\n";
print TMP " priority_phase: yes\n straight_phase: yes\n";
print TMP " crossingweight: barymedian\n splines: yes\n";
print TMP " crossingweight: medianbary\n splines: yes\n";
print TMP " layoutalgorithm: minbackward\n arrowmode: fixed\n";
my $sth ="";
......@@ -111,7 +111,7 @@ foreach $col ( sort keys %tablecols) {
@tables= sort mysort split('\.',$tablecols{$col});
foreach $tbl (sort mysort @tables) {
if (@tables < 2 ||
$tbl=~/^grp|delta_|nodes|log|exper|proj_|res|out|part/i ) {
$tbl=~/^delta_|nodes|log|exper|res|out|part|int/i ) {
print TMP " edge: { sourcename: \"$col\" ".
"targetname: \"$tbl\" }\n";
} else {
......
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