Added the fix for UnboundLocalError: local variable 'data' referenced before assignment

Signed-off-by: shivam <shivam.thakur@candelatech.com>
This commit is contained in:
shivam
2022-09-02 11:40:43 +05:30
parent 10cec64bff
commit 852cb3829d

View File

@@ -324,7 +324,6 @@ class APLIBS:
expected_attachment_type=allure.attachment_type.JSON)
try_again = False
try:
data = dict(json.loads(output.replace("\n\t", "").replace("\n", "")))
except Exception as e:
@@ -339,7 +338,7 @@ class APLIBS:
try:
data = dict(json.loads(output.replace("\n\t", "").replace("\n", "")))
except Exception as e:
output
data = output
logging.error("error in converting the ubus call ucentral status output to json" + output)
ret_val = data
return ret_val