Changeset 24545
- Timestamp:
- Jun 24, 2009, 3:35:31 PM (17 years ago)
- Location:
- trunk/Nebulous-Server
- Files:
-
- 4 edited
-
Changes (modified) (1 diff)
-
bin/neb-voladd (modified) (5 diffs)
-
lib/Nebulous/Server/SQL.pm (modified) (1 diff)
-
t/03_server_setup.t (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous-Server/Changes
r24541 r24545 28 28 - completely rework how mountedvol is populated, drop mount table 29 29 - infinitely try to get a db handle if the connection fails 30 - add --mountpoint param to neb-voladd 30 31 31 32 0.16 -
trunk/Nebulous-Server/bin/neb-voladd
r23348 r24545 19 19 use Pod::Usage qw( pod2usage ); 20 20 21 my ($db, $dbhost, $dbuser, $dbpass, $ vname, $vhost, $uri);21 my ($db, $dbhost, $dbuser, $dbpass, $mountpoint, $vname, $vhost, $uri); 22 22 23 23 $db = $ENV{'NEB_DB'} unless $db; … … 29 29 'db|d=s' => \$db, 30 30 'host=s' => \$dbhost, 31 'mountpoint|m=s' => \$mountpoint, 32 'pass|p=s' => \$dbpass, 33 'uri|u=s' => \$uri, 31 34 'user|u=s' => \$dbuser, 32 ' pass|p=s' => \$dbpass,35 'vhost=s' => \$vhost, 33 36 'vname|n=s' => \$vname, 34 'vhost=s' => \$vhost,35 'uri|u=s' => \$uri,36 37 ) || pod2usage( 2 ); 37 38 38 39 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 39 pod2usage( -msg => "Required options: --db --user --pass -- vname --vhost --uri", -exitval => 2 )40 unless $db && $dbuser && $dbpass && $ vname && $vhost && $uri;40 pod2usage( -msg => "Required options: --db --user --pass --mountpoint --vname --vhost --uri", -exitval => 2 ) 41 unless $db && $dbuser && $dbpass && $mountpoint && $vname && $vhost && $uri; 41 42 42 43 my $dbh = DBI->connect( … … 59 60 die "path: $path dirived from URI: $uri does not exist"; 60 61 } 62 unless (-d $mountpoint) { 63 die "path: $mountpoint does not exist"; 64 } 61 65 62 66 print " OK\n"; … … 65 69 66 70 my $query = $dbh->prepare( $sql->new_volume ); 67 $query->execute( $vname, $vhost, $path );71 $query->execute( $vname, $vhost, $path, $mountpoint); 68 72 69 73 print " OK\n"; … … 128 132 Optional. Defaults to C<localhost>. 129 133 134 =item * --mountpoint <path> 135 136 Path to the mountpoint of the filesystem on which C<--uri> resides. 130 137 131 138 =back -
trunk/Nebulous-Server/lib/Nebulous/Server/SQL.pm
r24544 r24545 286 286 }, 287 287 new_volume => qq{ 288 INSERT INTO volume (name, host, path, allocate, available, xattr )289 VALUES (?, ?, ?, TRUE, TRUE, FALSE )288 INSERT INTO volume (name, host, path, allocate, available, xattr, mountpoint) 289 VALUES (?, ?, ?, TRUE, TRUE, FALSE, ?) 290 290 }, 291 291 get_volume_by_name => qq{ -
trunk/Nebulous-Server/t/03_server_setup.t
r24356 r24545 30 30 31 31 Test::Nebulous->setup; 32 die; 32 33 33 34 {
Note:
See TracChangeset
for help on using the changeset viewer.
