X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=monitor%2Fwrapper%2Fplc.py;h=5e6fb7fcd4c34bc3836da14e0a7bc629cd1100b5;hb=db84a19276e861081756a7daec54aba8a1507abe;hp=b7b55d982123fcd15f89ed7de40dee46ff02a436;hpb=4a073a361fbf578a505a4439b33685cfab7ca37f;p=monitor.git diff --git a/monitor/wrapper/plc.py b/monitor/wrapper/plc.py index b7b55d9..5e6fb7f 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] @@ -336,7 +340,7 @@ def isPendingSite(loginbase): try: site = api.GetSites(auth.auth, loginbase)[0] except Exception, exc: - login.info("ERROR: No site %s" % loginbase) + logger.info("ERROR: No site %s" % loginbase) return False if not site['enabled'] and site['ext_consortium_id'] == PENDING_CONSORTIUM_ID: