X-Git-Url: http://git.onelab.eu/?p=mom.git;a=blobdiff_plain;f=pl_mom.py;h=0c05740a03054332f6e36053277d637e7c4011c5;hp=51cb34e28fbd8b416c5269c1fc7d70c75de07af7;hb=7f4bbf5280c7f1dfdce489599f450c65c213ff5c;hpb=15714637b8ddca17507725083c5a923b9f87ee06 diff --git a/pl_mom.py b/pl_mom.py index 51cb34e..0c05740 100644 --- a/pl_mom.py +++ b/pl_mom.py @@ -5,7 +5,7 @@ # Mark Huang # Copyright (C) 2006 The Trustees of Princeton University # -# $Id: pl_mom.py,v 1.3 2006/05/09 03:22:25 mlhuang Exp $ +# $Id: pl_mom.py,v 1.4 2006/06/02 04:00:00 mlhuang Exp $ # import os @@ -167,11 +167,10 @@ class NM: Simple interface to local Node Manager API """ - def __init__(self, url = "http://localhost:812/", timeout = 10): + def __init__(self, url = "http://localhost:812/", timeout = 30): """ Open a new connection to the local Node Manager """ - socket.setdefaulttimeout(timeout) try: self.nm = xmlrpclib.ServerProxy(url) @@ -190,8 +189,7 @@ class NM: values = [attribute[1] for attribute in attributes] if self.nm is not None: - try: - # Read rspec (the NM hash code for the slice) + # Read rspec (the NM hash code for the slice) rcap = open("/var/run/pl_nm/%s.vm_rcap" % slice, "r") rspec = rcap.readline().strip() rcap.close() @@ -199,7 +197,4 @@ class NM: (rc, result) = self.nm.nm_inspect(rspec, attributes) if rc == 0 and type(result) == list and len(result) == len(values): values = result - except Exception, err: - print "Warning: Exception received while querying Node Manager:", err - return values