git://git.onelab.eu
/
tests.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
trailing spaces
[tests.git]
/
system
/
PlcapiUrlScanner.py
diff --git
a/system/PlcapiUrlScanner.py
b/system/PlcapiUrlScanner.py
index
82c7bf1
..
e3e8ee8
100755
(executable)
--- a/
system/PlcapiUrlScanner.py
+++ b/
system/PlcapiUrlScanner.py
@@
-8,6
+8,7
@@
import socket
import xmlrpc.client
import traceback
import socket
import xmlrpc.client
import traceback
+import ssl
class PlcapiUrlScanner:
class PlcapiUrlScanner:
@@
-17,10
+18,10
@@
class PlcapiUrlScanner:
if not hostname and not ip:
raise Exception("PlcapiUrlScanner needs _some_ input")
if hostname:
if not hostname and not ip:
raise Exception("PlcapiUrlScanner needs _some_ input")
if hostname:
- if not ip:
+ if not ip:
try:
ip = socket.gethostbyname(hostname)
try:
ip = socket.gethostbyname(hostname)
- except:
+ except:
hostname = "{}.pl.sophia.inria.fr".format(hostname)
ip = socket.gethostbyname(hostname)
else:
hostname = "{}.pl.sophia.inria.fr".format(hostname)
ip = socket.gethostbyname(hostname)
else:
@@
-28,10
+29,12
@@
class PlcapiUrlScanner:
self.hostname = hostname
self.ip = ip
self.verbose = verbose
self.hostname = hostname
self.ip = ip
self.verbose = verbose
-
+
def try_url (self, url):
try:
def try_url (self, url):
try:
- xmlrpc.client.ServerProxy (url, verbose=self.verbose, allow_none=True).GetNodes(self.auth)
+ proxy = xmlrpc.client.ServerProxy(url, verbose=self.verbose, allow_none=True,
+ context=ssl._create_unverified_context())
+ nodes = proxy.GetNodes(self.auth)
print('YES', url)
return True
except xmlrpc.client.ProtocolError as e:
print('YES', url)
return True
except xmlrpc.client.ProtocolError as e: