Removes test on device_platform
This commit is contained in:
parent
93b540f643
commit
984c4c2e23
1 changed files with 11 additions and 14 deletions
|
|
@ -29,7 +29,6 @@ def get_device_type(type):
|
||||||
|
|
||||||
|
|
||||||
def get_device_platform(device_platform):
|
def get_device_platform(device_platform):
|
||||||
if device_platform is None:
|
|
||||||
try:
|
try:
|
||||||
# Python 3.8+ moved linux_distribution() to distro
|
# Python 3.8+ moved linux_distribution() to distro
|
||||||
try:
|
try:
|
||||||
|
|
@ -43,8 +42,6 @@ def get_device_platform(device_platform):
|
||||||
return None
|
return None
|
||||||
except (ModuleNotFoundError, NameError, AttributeError):
|
except (ModuleNotFoundError, NameError, AttributeError):
|
||||||
return None
|
return None
|
||||||
else:
|
|
||||||
linux_distribution = device_platform
|
|
||||||
|
|
||||||
device_platform = nb.dcim.platforms.get(name=linux_distribution)
|
device_platform = nb.dcim.platforms.get(name=linux_distribution)
|
||||||
if device_platform is None:
|
if device_platform is None:
|
||||||
|
|
|
||||||
Loading…
Add table
editor.link_modal.header
Reference in a new issue