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

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