Commit 9397fc9e by Solo Group

-vsi pln post

1 parent ceaf8afd
......@@ -84,16 +84,6 @@ class Vendor(VendorClass):
elif "status" in data and data["status"] and data["status"] == "ERROR":
self.status = -1
code = "rc" in data and int(data["rc"]) or 500
if code == 0:
self.status = 1
message="SUCCESS"
else:
self.status = vsi_status[str(code)]["status"]
if self.status == -3:
message = "GAGAL"
else:
message = "PENDING"
meter = "startend" in data and data["startend"] or ""
"""
{
......@@ -118,6 +108,19 @@ class Vendor(VendorClass):
"""
bulan = "bulan" in data and data["bulan"].split(" ")
bulan = bulan and bulan[0] or 0
code = "rc" in data and int(data["rc"]) or 500
if code == 0:
self.status = 1
message = "SUCCESS"
else:
self.status = vsi_status[str(code)]["status"]
if self.status == -3:
message = "GAGAL"
else:
message = "PENDING"
if code==14:
code = 54
message = "GAGAL"
return {
"code": code,
......@@ -166,6 +169,9 @@ class Vendor(VendorClass):
data = dict(xmltodict.parse(resp.text)["root"])
self.response = data
data = self.pars_data(data)
if data["code"]!=0:
return self.set_failed()
self.result = data
return self.set_success(data)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!