fix another generate_test_data bug
This commit is contained in:
parent
265c03a5da
commit
9b40301a23
1 changed files with 6 additions and 3 deletions
|
@ -199,9 +199,12 @@ class UPnP:
|
||||||
except (UPnPError, NotImplementedError):
|
except (UPnPError, NotImplementedError):
|
||||||
print("failed to add and remove a mapping")
|
print("failed to add and remove a mapping")
|
||||||
|
|
||||||
device = list(self.gateway.devices.values())[0]
|
if self.gateway._device:
|
||||||
assert device.manufacturer and device.modelName
|
device = list(self.gateway.devices.values())[0]
|
||||||
device_path = os.path.join(os.getcwd(), self.gateway.manufacturer_string)
|
assert device.manufacturer and device.modelName
|
||||||
|
device_path = os.path.join(os.getcwd(), self.gateway.manufacturer_string)
|
||||||
|
else:
|
||||||
|
device_path = os.path.join(os.getcwd(), "UNKNOWN GATEWAY")
|
||||||
with open(device_path, "w") as f:
|
with open(device_path, "w") as f:
|
||||||
f.write(json.dumps({
|
f.write(json.dumps({
|
||||||
"gateway": self.gateway.debug_gateway(),
|
"gateway": self.gateway.debug_gateway(),
|
||||||
|
|
Loading…
Reference in a new issue