]> andersk Git - moira.git/blobdiff - incremental/afs_create.pl
Abstracted the canonicalization of volume names (afs_vname)
[moira.git] / incremental / afs_create.pl
index 7144fcb109a65cb393c68a37f10f97a1720861b6..0330d2182099f7bb13c033f7a8b3de7dbb32f7fc 100644 (file)
@@ -6,20 +6,6 @@ require "/moira/bin/afs_utils.pl";
 $protodir="/moira/dotfiles";
 $quota=1;
 
-%vtypes_ATHENA_MIT_EDU =
-    ("ACTIVITY", "activity",
-     "APROJ", "aproj",
-     "AREF", "aref",
-     "CONTRIB", "contrib",
-     "COURSE", "course",
-     "HOMEDIR", "user",
-     "PROJECT", "project",
-     "REF", "ref",
-     "SW", "sw",
-     "SYSTEM", "system",
-     "UROP", "urop",
-     );
-
 %proc =
     ("ATHENA.MIT.EDU", 'athena_proc' );
 
@@ -30,9 +16,8 @@ die "Usage: $0 locker type cell path user group\n" if (@ARGV != 6);
 
 # Lookup volume type
 ($c = $cell) =~ s/\./_/g;
-$vtype = eval "\$vtypes_$c{$type}";
-die "Cannot create $type volumes in $cell\n" unless $vtype;
-$vname = $vtype . "." . $locker;
+$vname = &afs_vname($locker, $type, $cell);
+die "Cannot create $type volumes in $cell\n" unless $vname;
 
 # Find free space
 ($asrv,$apart) = &afs_find($cell,$type,$quota);
@@ -45,7 +30,7 @@ push(@clean, "$vos remove $asrv $apart $vname -cell $cell >/dev/null");
 
 # Create mountpoint and set quota
 $path =~ s:^/afs/([^.]):/afs/.\1:;
-system("$fs checkb >/dev/null; $fs mkm $path $vname");
+system("$fs checkv >/dev/null; $fs mkm $path $vname");
 &fatal("Unable to create $path") if ($?);
 push(@clean, "$fs rmm $path");
 
This page took 0.354414 seconds and 4 git commands to generate.