Commit f458ce1a authored by Radomir Klacza's avatar Radomir Klacza
Browse files

Speeding up myslicelib

parent d419cfb5
......@@ -4,6 +4,7 @@ import os.path
import sys, tempfile, time
from urllib.parse import urlparse
from myslicelib.util.sfa import hrn_to_urn
# from myslicelib.util.decorators import timeit
from pprint import pprint
......@@ -80,11 +81,19 @@ class Api(object):
self._proxy = xmlrpcclient.ServerProxy(self.endpoint.url, allow_none=True, verbose=False, use_datetime=True, context=context)
# version call
self._version = self.version(raw=True)
# logs
self.logs = []
def __str__(self):
return "SfaAm endpoint = ".join(self.endpoint.name)
def __repr__(self):
return "SfaAm endpoint = " + str(self.endpoint.name) + str(self.endpoint.version)
def version(self, raw=False):
message = None
version = None
......@@ -94,7 +103,10 @@ class Api(object):
status = "offline"
try:
ret = self._proxy.GetVersion()
if self.endpoint.version:
ret = self.endpoint.version
else:
ret = self._proxy.GetVersion()
if 'value' in ret:
# AM
version = ret['value']['geni_api']
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment