mirror of
https://github.com/eLvErDe/hwraid.git
synced 2025-07-16 18:34:22 +02:00
do the same for unconfigured disk info block
This commit is contained in:
parent
3963401717
commit
c9fd701e89
@ -577,6 +577,21 @@ def returnUnconfDiskInfo(output,controllerid):
|
|||||||
elif re.match(r'Inquiry Data: .*$',line.strip()):
|
elif re.match(r'Inquiry Data: .*$',line.strip()):
|
||||||
model = line.split(':')[1].strip()
|
model = line.split(':')[1].strip()
|
||||||
model = re.sub(' +', ' ', model)
|
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)
|
manuf = re.sub(' .*', '', model)
|
||||||
dtype = re.sub(manuf+' ', '', model)
|
dtype = re.sub(manuf+' ', '', model)
|
||||||
dtype = re.sub(' .*', '', dtype)
|
dtype = re.sub(' .*', '', dtype)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user