diff options
Diffstat (limited to 'catalog-be/src/main/resources/scripts/sdcBePy/common')
-rwxr-xr-x | catalog-be/src/main/resources/scripts/sdcBePy/common/sdcBeProxy.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/catalog-be/src/main/resources/scripts/sdcBePy/common/sdcBeProxy.py b/catalog-be/src/main/resources/scripts/sdcBePy/common/sdcBeProxy.py index 0c71a382d1..ecd07264b4 100755 --- a/catalog-be/src/main/resources/scripts/sdcBePy/common/sdcBeProxy.py +++ b/catalog-be/src/main/resources/scripts/sdcBePy/common/sdcBeProxy.py @@ -5,7 +5,6 @@ import pycurl from sdcBePy.common.helpers import check_arguments_not_none - def get_url(ip, port, protocol): return "%s://%s:%s" % (protocol, ip, port) @@ -55,6 +54,9 @@ class SdcBeProxy: def get_normatives(self): return self.con.get("/sdc2/rest/v1/screen", with_buffer=True) + def get_model_list(self): + return self.con.get("/sdc2/rest/v1/catalog/model", with_buffer=True) + def post_file(self, path, multi_part_form_data, buffer=None): return self.con.post_file(path, multi_part_form_data, buffer) @@ -67,8 +69,7 @@ class SdcBeProxy: self.con.buffer.seek(0) response = value.decode(self.CHARTSET).split(self.BODY_SEPARATOR) - return response[1] if len(response) == 2 else response[0] - + return response[len(response) - 1] if len(response) > 1 else response[0] class CurlConnector: CONTENT_TYPE_HEADER = "Content-Type: application/json" |