Skip to content

Commit d64e14c

Browse files
noonedeadpunkm4ce
authored andcommitted
Update __init__.py (#14)
workaround, when enclosure device id in N/A
1 parent 8dbc408 commit d64e14c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

megacli/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,13 +279,13 @@ def physicaldrives(self):
279279
continue
280280

281281
if adapter_id is not None:
282-
m = re.match('^enclosure device id:(\d+)', line)
282+
m = re.match('^enclosure device id:(\d+|n\/a)', line)
283283
if m:
284284
if 'enclosure_id' in pd:
285285
ret.append(pd)
286286
pd = {'adapter_id': adapter_id}
287287

288-
pd['enclosure_id'] = int(m.group(1))
288+
pd['enclosure_id'] = int(m.group(1)) if m.group(1) != "n/a" else 0
289289
continue
290290

291291
if 'enclosure_id' in pd:

0 commit comments

Comments
 (0)