X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=sfa%2Fclient%2Fmanifolduploader.py;h=510382fd985642016661386ca56db7ef669992dd;hb=2b8fb7af76b173ad4ad6583dbedbdf11a49f9549;hp=c469b357a0b4c1426714a342c7a5be8f81859dbc;hpb=f27128bd33db08114f264c4028ae667c962b64c5;p=sfa.git diff --git a/sfa/client/manifolduploader.py b/sfa/client/manifolduploader.py index c469b357..510382fd 100755 --- a/sfa/client/manifolduploader.py +++ b/sfa/client/manifolduploader.py @@ -22,19 +22,14 @@ # so the defaults below are of no real importance # this for now points at demo.myslice.info, but sounds like a # better default for the long run -DEFAULT_URL = "http://myslice.onelab.eu:7080" -DEFAULT_PLATFORM = 'ple' +import getpass -# starting with 2.7.9 we need to turn off server verification -import ssl -try: - turn_off_server_verify = {'context': ssl._create_unverified_context()} -except: - turn_off_server_verify = {} +import xmlrpc.client -import getpass +from sfa.util.ssl import simple_ssl_context -from sfa.util.py23 import xmlrpc_client +DEFAULT_URL = "http://myslice.onelab.eu:7080" +DEFAULT_PLATFORM = 'ple' class ManifoldUploader: @@ -88,17 +83,10 @@ class ManifoldUploader: # won't be happy with several calls issued in the same session # so we do not cache this one def proxy(self): - # if not self._proxy: - # url=self.url() - # self.logger.info("Connecting manifold url %s"%url) - # self._proxy = xmlrpc_client.ServerProxy(url, allow_none = True) - # return self._proxy url = self.url() self.logger.debug("Connecting manifold url %s" % url) - proxy = xmlrpc_client.ServerProxy(url, allow_none=True, - **turn_off_server_verify) - - return proxy + return xmlrpc.client.ServerProxy(url, allow_none=True, + context=simple_ssl_context()) # does the job for one credential # expects the credential (string) and an optional message (e.g. hrn) for reporting