def execute(self, proxy):
if self._plugin:
raise NotImplementedError()
else:
response = proxy.start(self)
#print('the data execute is :',response)
value = self.getValue(proxy.getMacAddress())
mac = proxy.getMacAddress()
#print("the macaddr is :",proxy.getMacAddress())
print('the data excute value is :',value)
url = MgrUtils.getParameter(UtilsConfig.S_MES, UtilsConfig.K_URL, "")
print("the url url is :",url)
if value=="bosa_sn":
num = 0
num1 = 0
num2 = 0
son = {}
bosa_config = {}
list2 = response.replace('=', '\n')
#print(list2)
list2 = list2.split()
len1 = len(list2)
print("the len1 is :",len1)
print(list2[num])
for i in range(0,len1):
#print(i)
if "bosa_sn"==list2[i]:
num1 = i
print(list2[i])
if "target_er_set"==list2[i]:
num2 = i
print(list2[i])
break
list2=list2[num1:num2+2]
while num < len(list2):
if list2[num]:
son[list2[num]] = list2[num + 1]
num = num + 2;
#print(son)
#print(son.get("bosa_sn"))
bosa_config["bosa_sn"]=son.get("bosa_sn")
bosa_config["bosa_type"] = son.get("bosa_type")
bosa_config["bosa_pn"] = son.get("bosa_pn")
bosa_config["bosa_vapd"] = son.get("bosa_vapd")
bosa_config["bosa_ith"] = son.get("bosa_ith")
bosa_config["bosa_imod"] = son.get("bosa_imod")
bosa_config["bosa_impd"] = son.get("bosa_impd")
bosa_config["bosa_refpwr"] = son.get("bosa_refpwr")
bosa_config["bosa_tiavcc"] = son.get("bosa_tiavcc")
bosa_config["bosa_apd_resp"] = son.get("bosa_apd_resp")
bosa_config["bosa_apd_comp"] = son.get("bosa_apd_comp")
bosa_config["bosa_apd_max_i"] = son.get("bosa_apd_max_i")
bosa_config["darkcurrent_vapd10"] = son.get("darkcurrent_vapd10")
bosa_config["darkcurrent_vop"] = son.get("darkcurrent_vop")
bosa_config["target_er_set"] = son.get("target_er_set")
print(bosa_config)
client = Client("{}?WSDL".format(url))
sponse = client.service.GetBOSAImportData_Ex('GPONStation-SZ', 'NP1257G-test', mac)
#print(sponse)
ls = json.loads(sponse)
ls = ls['BosaData'][0]
print(ls)
#return print(ls == bosa_config)
if response.find(value) >= 0:
return True
return False