Fix: Make sure in simulation or non-olt case, device id get doesn't break
Change-Id: I2d6aa027cc5818165f4964bb9c1e5e9f9c093c8a
diff --git a/src/test/utils/OnosCtrl.py b/src/test/utils/OnosCtrl.py
index 9c73b4a..09cbeee 100644
--- a/src/test/utils/OnosCtrl.py
+++ b/src/test/utils/OnosCtrl.py
@@ -78,6 +78,7 @@
def get_device_id(cls):
'''If running under olt, we get the first switch connected to onos'''
olt = OltConfig()
+ did = 'of:' + get_mac('ovsbr0')
if olt.on_olt():
devices = cls.get_devices()
if devices:
@@ -87,8 +88,6 @@
else:
###If we have more than 1, then check for env before using first one
did = os.getenv('OLT_DEVICE_ID', dids[0])
- else:
- did = 'of:' + get_mac('ovsbr0')
return did