IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 24, 2010, 3:56:40 PM (16 years ago)
Author:
watersc1
Message:

Add note to nebulous volume and mountedvol tables

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous-Server/bin/neb-host

    r27114 r28492  
    1616use Pod::Usage qw( pod2usage );
    1717
    18 my ($host, $state,
     18my ($host, $state, $note,
    1919    $db, $dbhost, $dbpass, $dbuser,
    2020    $allocate, $available, $debug);
     
    5151    'host=s'         => \$host,
    5252    'state=s'        => \$state,
    53    
     53    'note=s'         => \$note,
    5454    'db=s'           => \$db,
    5555    'dbhost=s'       => \$dbhost,
    5656    'dbuser=s'       => \$dbuser,
    5757    'dbpass=s'       => \$dbpass,
     58
    5859   
    5960    ) || pod2usage( 2 );
     
    101102    $set{'v.allocate'} = $allocate if defined $allocate;
    102103    $set{'v.available'} = $available if defined $available;
    103    
     104    $set{'v.note'} = $note if defined $note;
     105
    104106    eval {
    105107        my ($q, @bind) = sql_interp("UPDATE volume AS v SET", \%set, "WHERE", \%constraint);
     
    134136$dbh->commit;
    135137
    136 my $format  = "%-15s %-15s %-10s %-10s %-10s %-10s\n";
    137 my @columns = qw(host name mounted allocate available xattr);
     138my $format  = "%-15s %-15s %-7s %-8s %-9s %-5s %s\n";
     139my @columns = qw(host name mounted allocate available xattr note);
    138140printf($format, @columns);
    139141
    140142while (my $row = $query->fetchrow_hashref) {
     143    unless ((exists($$row{ 'note' })) && (defined($$row{ 'note' }))) {
     144        $$row{ 'note' } = '-';
     145    }
     146
    141147    printf($format, @$row{@columns});
    142148}
Note: See TracChangeset for help on using the changeset viewer.