Я пытаюсь выполнить python suite Я столкнулся со следующей ошибкой.
File "botclient.py", line 59, in <module>
botcode.utils.addUser(loginUri, logoutUri1, logoutUri2, addUserUri, dbUri, dataMap)
File "/root/botclient/clcode/utils.py", line 877, in addUser
logout(logoutUri1, sessionid, dataMap)
UnboundLocalError: local variable 'sessionid' referenced before assignment
Я не вижу этой ошибки, когда выполняю функцию отдельно. Вот функция addUser, которую я использую
def addUser(loginUri, logoutUri1, logoutUri2, addUserUri, dbUri, dataMap):
try:
response = login(loginUri, dataMap)
sessionid = response.split("var jsessionid = '")[1].split("'")[0]
csrftoken = response.split("wap.csrf_token=\"")[1].split("\"")[0]
configManager = getDBData("select+instanceid+from+XGS_GROUP+where+instancename%3D%27Config+Managers%27", sessionid, csrftoken, dbUri, dataMap)
nbiWrite = getDBData("select+instanceid+from+XGS_GROUP+where+instancename%3D%27NBI+Write%27", sessionid, csrftoken, dbUri, dataMap)
rootDomain = getDBData("select+instanceid+from+XGS_GROUP+where+instancename%3D%27ROOT-DOMAIN%27", sessionid, csrftoken, dbUri, dataMap)
addUserData = '''------WebKitFormBoundarySkroBjW9bHRdh2YW\r\nContent-Disposition'''
addUserPost(addUserUri, addUserData, sessionid, csrftoken, dataMap)
except Exception as err:
log(str(traceback.format_exc()))
dataMap["failureReason"] = "Issue in user addition"
finally:
logout(logoutUri1, sessionid, dataMap)
Что мне не хватает в sessionid
?