try: turn_off_server_verify = { 'context' : ssl._create_unverified_context() }
except: turn_off_server_verify = {}
-import xmlrpclib
import getpass
+from sfa.util.py23 import xmlrpc_client
+
class ManifoldUploader:
"""A utility class for uploading delegated credentials to a manifold/MySlice infrastructure"""
# if not self._proxy:
# url=self.url()
# self.logger.info("Connecting manifold url %s"%url)
-# self._proxy = xmlrpclib.ServerProxy(url, allow_none = True)
+# self._proxy = xmlrpc_client.ServerProxy(url, allow_none = True)
# return self._proxy
url=self.url()
self.logger.debug("Connecting manifold url %s"%url)
- proxy = xmlrpclib.ServerProxy(url, allow_none = True,
- **turn_off_server_verify)
+ proxy = xmlrpc_client.ServerProxy(url, allow_none = True,
+ **turn_off_server_verify)
return proxy
try:
self.logger.debug("Using new v2 method forward+annotation@%s %s"%(platform,message))
retcod2=manifold.forward (query, annotation)
- except Exception,e:
+ except Exception as e:
# xxx we need a constant constant for UNKNOWN, how about using 1
MANIFOLD_UNKNOWN=1
retcod2={'code':MANIFOLD_UNKNOWN,'description':"%s"%e}
self.logger.debug("****** full retcod2")
for (k,v) in retcod2.items(): self.logger.debug("**** %s: %s"%(k,v))
return False
- except Exception, e:
+ except Exception as e:
if message: self.logger.error("Could not upload %s %s"%(message,e))
else: self.logger.error("Could not upload credential %s"%e)
if self.logger.debugEnabled():