Skip to content

Commit

Permalink
It seems that 'ID_MODEL_FROM_DATABASE' is not available everywhere, s…
Browse files Browse the repository at this point in the history
…o try other identifiers.
  • Loading branch information
votdev committed Oct 13, 2016
1 parent 0c1483c commit 7e82b31
Showing 1 changed file with 6 additions and 2 deletions.
Expand Up @@ -62,8 +62,12 @@ def execute(self):
choices = []
for idx, sys_name in enumerate(devices):
device = pyudev.Device.from_name(context, "net", sys_name)
choices.append([ sys_name, omv.string.truncate(
device["ID_MODEL_FROM_DATABASE"], 50) ])
for id in [ "ID_MODEL_FROM_DATABASE", "ID_VENDOR_FROM_DATABASE" ]:
if not id in device:
continue
choices.append([ sys_name, omv.string.truncate(
device[id], 50) ])
break
d = dialog.Dialog(dialog="dialog")
(code, tag) = d.menu("Please select a network interface. Note, the " \
"existing network interface configuration will be deleted.",
Expand Down

0 comments on commit 7e82b31

Please sign in to comment.