]> www.infradead.org Git - users/dhowells/kafs-utils.git/commitdiff
vos listpart and vos partinfo should use common partition name generation
authorDavid Howells <dhowells@redhat.com>
Fri, 11 Apr 2014 12:32:54 +0000 (13:32 +0100)
committerDavid Howells <dhowells@redhat.com>
Fri, 11 Apr 2014 13:47:14 +0000 (14:47 +0100)
Signed-off-by: David Howells <dhowells@redhat.com>
suite/commands/vos/listpart.py
suite/commands/vos/partinfo.py

index 3c320f82b402be6199a308584f92e23277db1de5..44c9ebf20725f18e0475875ed4a0b4d2733576c6 100644 (file)
@@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 """
 
 from afs.argparse import *
+import afs.lib.partition as partition
 import kafs
 
 help = "Display all AFS partitions on a file server machine"
@@ -60,12 +61,8 @@ def main(params):
     for i in partitions:
         if i != 0xffffffff:
             n += 1
-            parts += "    /vicep"
-            if i < 26:
-                parts += "{:c}".format(i + 97)
-            else:
-                i -= 26
-                parts += "{:c}{:c}".format(i / 26 + 97, i % 26 + 97)
+            partname = partition.id2part(i)
+            parts += "    " + partname
 
     print(parts)
     print("Total:", n)
index 281b95b30654e8d7c36506cfa41feeb9caafdfaf..0bad9fafa89172a97bbc2de4d842e0979d85366b 100644 (file)
@@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 """
 
 from afs.argparse import *
+import afs.lib.partition as partition
 import kafs
 
 help = "Report the available and total space on a partition"
@@ -56,10 +57,7 @@ def main(params):
 
     for i in partitions:
         if i != 0xffffffff:
-            if i < 26:
-                partname = "/vicep{:c}".format(i + 97)
-            else:
-                partname = "/vicep{:c}{:c}".format(i / 26 + 97, i % 26 + 97)
+            partname = partition.id2part(i)
 
             ret = kafs.VOLSER_AFSVolPartitionInfo(vol_conn, partname)
             part = ret.partition