X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=monitor%2Fwrapper%2Fplc.py;h=87355faf9c3a37422f9b83fe9b99f66076f34c36;hb=8868d29303a545901cce2edfa9d69b586421c61f;hp=b7b55d982123fcd15f89ed7de40dee46ff02a436;hpb=ed847186424d004c51e8b3159d38117197100422;p=monitor.git diff --git a/monitor/wrapper/plc.py b/monitor/wrapper/plc.py index b7b55d9..87355fa 100644 --- a/monitor/wrapper/plc.py +++ b/monitor/wrapper/plc.py @@ -248,7 +248,11 @@ Returns dict of PCU info of a given node. def getpcu(nodename): api = xmlrpclib.Server(auth.server, verbose=False, allow_none=True) anon = {'AuthMethod': "anonymous"} - nodeinfo = api.GetNodes(auth.auth, {"hostname": nodename}, ["pcu_ids", "ports"])[0] + try: + nodeinfo = api.GetNodes(auth.auth, {"hostname": nodename}, ["pcu_ids", "ports"])[0] + except IndexError: + logger.info("Can not find node: %s" % nodename) + return False if nodeinfo['pcu_ids']: print nodeinfo sitepcu = api.GetPCUs(auth.auth, nodeinfo['pcu_ids'])[0]