Merge pull request #123 from ch3sh1r/patch-1

Numeration in format string and spaces to tab (to support Python 2.6)
This commit is contained in:
Adam Cécile 2021-08-17 09:18:40 +02:00 committed by GitHub
commit bbbd2f6424
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -486,9 +486,9 @@ def returnDiskInfo(output,controllerid):
m = re.match(r'(\w{8})(ST\w+)(?:-(\w{6}))?(?:\s+(\w+))', model) m = re.match(r'(\w{8})(ST\w+)(?:-(\w{6}))?(?:\s+(\w+))', model)
if m: if m:
if m.group(3): if m.group(3):
model = '{}-{} {} {}'.format(m.group(2), m.group(3), m.group(4), m.group(1)) model = '{0}-{1} {2} {3}'.format(m.group(2), m.group(3), m.group(4), m.group(1))
else: else:
model = '{} {:>10} {}'.format(m.group(2), m.group(4), m.group(1)) model = '{0} {1:>10} {2}'.format(m.group(2), m.group(4), m.group(1))
continue continue
# Sub code # Sub code
@ -587,9 +587,9 @@ def returnUnconfDiskInfo(output,controllerid):
m = re.match(r'(\w{8})(ST\w+)(?:-(\w{6}))?(?:\s+(\w+))', model) m = re.match(r'(\w{8})(ST\w+)(?:-(\w{6}))?(?:\s+(\w+))', model)
if m: if m:
if m.group(3): if m.group(3):
model = '{}-{} {} {}'.format(m.group(2), m.group(3), m.group(4), m.group(1)) model = '{0}-{1} {2} {3}'.format(m.group(2), m.group(3), m.group(4), m.group(1))
else: else:
model = '{} {:>10} {}'.format(m.group(2), m.group(4), m.group(1)) model = '{0} {1:>10} {2}'.format(m.group(2), m.group(4), m.group(1))
continue continue
manuf = re.sub(' .*', '', model) manuf = re.sub(' .*', '', model)