PEP 3113 removed the use of tuple parameter unpacking in conjunction with lambdas, replace this code with something that works in python2.7 and python3.
Signed-off-by: Joe Stringer <j...@ovn.org> --- xenserver/opt_xensource_libexec_InterfaceReconfigure.py | 16 ++++++++-------- .../opt_xensource_libexec_InterfaceReconfigureVswitch.py | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/xenserver/opt_xensource_libexec_InterfaceReconfigure.py b/xenserver/opt_xensource_libexec_InterfaceReconfigure.py index 7c642e9f5b96..2630077385a2 100644 --- a/xenserver/opt_xensource_libexec_InterfaceReconfigure.py +++ b/xenserver/opt_xensource_libexec_InterfaceReconfigure.py @@ -581,8 +581,8 @@ class DatabaseCache(object): os.rename(temp_file, cache_file) def get_pif_by_uuid(self, uuid): - pifs = map(lambda (ref,rec): ref, - filter(lambda (ref,rec): uuid == rec['uuid'], + pifs = map(lambda ref_rec: ref_rec[0], + filter(lambda ref_rec: uuid == ref_rec[1]['uuid'], self.__pifs.items())) if len(pifs) == 0: raise Error("Unknown PIF \"%s\"" % uuid) @@ -592,14 +592,14 @@ class DatabaseCache(object): return pifs[0] def get_pifs_by_device(self, device): - return map(lambda (ref,rec): ref, - filter(lambda (ref,rec): rec['device'] == device, - self.__pifs.items())) + return list(map(lambda ref_rec: ref_rec[0], + list(filter(lambda ref_rec: ref_rec[1]['device'] == device, + self.__pifs.items())))) def get_networks_with_bridge(self, bridge): - return map(lambda (ref,rec): ref, - filter(lambda (ref,rec): rec['bridge'] == bridge, - self.__networks.items())) + return list(map(lambda ref_rec: ref_rec[0], + list(filter(lambda ref_rec: ref_rec[1]['bridge'] == bridge, + self.__networks.items())))) def get_network_by_bridge(self, bridge): #Assumes one network has bridge. diff --git a/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py b/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py index d70c249146fb..d9eda6adcf27 100644 --- a/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py +++ b/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py @@ -196,9 +196,9 @@ def datapath_configure_bond(pif,slaves): # override defaults with values from other-config whose keys # being with "bond-" oc = pifrec['other_config'] - overrides = filter(lambda (key,val): - key.startswith("bond-"), oc.items()) - overrides = map(lambda (key,val): (key[5:], val), overrides) + overrides = filter(lambda key_val: + key_val[0].startswith("bond-"), oc.items()) + overrides = map(lambda key_val: (key_val[0][5:], key_val[1]), overrides) bond_options.update(overrides) mode = None halgo = None -- 2.8.2 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev