From: David Howells Date: Fri, 11 Apr 2014 12:32:54 +0000 (+0100) Subject: vos listpart and vos partinfo should use common partition name generation X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=b85c9e8c874f83b573f73cebd8beeb9b70577ae7;p=users%2Fdhowells%2Fkafs-utils.git vos listpart and vos partinfo should use common partition name generation Signed-off-by: David Howells --- diff --git a/suite/commands/vos/listpart.py b/suite/commands/vos/listpart.py index 3c320f8..44c9ebf 100644 --- a/suite/commands/vos/listpart.py +++ b/suite/commands/vos/listpart.py @@ -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) diff --git a/suite/commands/vos/partinfo.py b/suite/commands/vos/partinfo.py index 281b95b..0bad9fa 100644 --- a/suite/commands/vos/partinfo.py +++ b/suite/commands/vos/partinfo.py @@ -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