git://git.onelab.eu
/
nodemanager.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
blind and brutal 2to3
[nodemanager.git]
/
plugins
/
interfaces.py
diff --git
a/plugins/interfaces.py
b/plugins/interfaces.py
index
6927b23
..
fe303a3
100644
(file)
--- a/
plugins/interfaces.py
+++ b/
plugins/interfaces.py
@@
-5,7
+5,7
@@
Configure interfaces inside a container by pulling down files via URL.
import logger
import os
import curlwrapper
import logger
import os
import curlwrapper
-import xmlrpc
lib
+import xmlrpc
.client
try:
from hashlib import sha1 as sha
except ImportError:
try:
from hashlib import sha1 as sha
except ImportError:
@@
-26,7
+26,7
@@
def start():
def GetSlivers(data, config=None, plc=None):
if 'slivers' not in data:
def GetSlivers(data, config=None, plc=None):
if 'slivers' not in data:
- logger.log_missing_data("interfaces.GetSlivers",'slivers')
+ logger.log_missing_data("interfaces.GetSlivers",
'slivers')
return
for sliver in data['slivers']:
return
for sliver in data['slivers']:
@@
-43,7
+43,7
@@
def GetSlivers(data, config=None, plc=None):
if tag['tagname'] == 'interface':
interfaces = eval(tag['value'])
if tag['tagname'] == 'interface':
interfaces = eval(tag['value'])
- if not isinstance(interfaces, (list,tuple)):
+ if not isinstance(interfaces, (list,
tuple)):
# if interface is not a list, then make it into a singleton list
interfaces = [interfaces]
# if interface is not a list, then make it into a singleton list
interfaces = [interfaces]
@@
-55,7
+55,7
@@
def GetSlivers(data, config=None, plc=None):
url = mydict['url']
try:
contents = curlwrapper.retrieve(url)
url = mydict['url']
try:
contents = curlwrapper.retrieve(url)
- except xmlrpc
lib.ProtocolError,
e:
+ except xmlrpc
.client.ProtocolError as
e:
logger.log('interfaces (%s): failed to retrieve %s' % (slicename, url))
continue
else:
logger.log('interfaces (%s): failed to retrieve %s' % (slicename, url))
continue
else:
@@
-66,7
+66,7
@@
def GetSlivers(data, config=None, plc=None):
logger.log('interfaces (%s): no DEVICE specified' % slicename)
continue
logger.log('interfaces (%s): no DEVICE specified' % slicename)
continue
- for key, value in
mydict.items(
):
+ for key, value in
list(mydict.items()
):
if key in ['bridge', 'vlan']:
continue
contents += '%s="%s"\n' % (key, value)
if key in ['bridge', 'vlan']:
continue
contents += '%s="%s"\n' % (key, value)