tools/nextid: pad 0 in next test id seq number
authorEryu Guan <eguan@redhat.com>
Tue, 24 Jan 2017 10:30:04 +0000 (18:30 +0800)
committerEryu Guan <eguan@redhat.com>
Fri, 27 Jan 2017 08:06:12 +0000 (16:06 +0800)
nextid returns the next available seq number, but it doesn't pad id
number with 0, e.g.

./tools/nextid ext4
23

After the fix it returns:

./tools/nextid ext4
023

This eases the process of moving tests around in a script.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
tools/sort-group

index 84944ed606fa1bfa6f4236003e7b6889a8f75d77..6fcaad7706990b578e0ae83df9d0027bd3899c52 100755 (executable)
@@ -103,7 +103,7 @@ def nextid_main():
                xid = startid
                while xid in xkeys:
                        xid += 1
-               print('%s/%d' % (group, xid))
+               print('%s/%03d' % (group, xid))
 
 if __name__ == '__main__':
        if 'nextid' in sys.argv[0]: