All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Commit de3525be authored by Kirk Webb's avatar Kirk Webb

Change version check code to throw exception if it can't contact the
remote pl_conf.
parent d6ec70e2
......@@ -70,6 +70,7 @@ class __PLCagent:
def __init__(self, funcname, obj):
self.__lockfile = open(PLC_LOCKFILE, "w")
self.__meth = eval("obj.%s" % funcname)
self.__vers = [0,0,0]
self.func_name = funcname
return
......@@ -112,22 +113,15 @@ class NMagent:
return self.__server.delete_sliver(rcap)
def version(self):
if not self.__vers:
try:
res = self.__server.version()
if type(res) == list and len(res) == 2 and res[0] == 0:
verslist = res[1].split(".")
major = verslist[0]
minor, revision = verslist[1].split("-")
self.__vers = [int(major), int(minor), int(revision)]
pass
else:
self.__vers = [0,0,0]
pass
pass
except:
self.__vers = [0,0,0]
if self.__vers == [0,0,0]:
res = self.__server.version()
if type(res) == list and len(res) == 2 and res[0] == 0:
verslist = res[1].split(".")
major = verslist[0]
minor, revision = verslist[1].split("-")
self.__vers = [int(major), int(minor), int(revision)]
pass
pass
return self.__vers
pass
......
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