do the same for unconfigured disk info block

This commit is contained in:
nega 2019-07-10 13:11:32 -04:00
parent 3963401717
commit c9fd701e89
1 changed files with 15 additions and 0 deletions

View File

@ -577,6 +577,21 @@ def returnUnconfDiskInfo(output,controllerid):
elif re.match(r'Inquiry Data: .*$',line.strip()):
model = line.split(':')[1].strip()
model = re.sub(' +', ' ', model)
# re-define our "sub-code"
# our seagate drives have an ID string of
# 'Z1E19S2QST2000DM001-1CH164 CC43'
# or
# '6XW02738ST32000542AS CC32'
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
manuf = re.sub(' .*', '', model)
dtype = re.sub(manuf+' ', '', model)
dtype = re.sub(' .*', '', dtype)