From: Ondrej Lichtner olichtne@redhat.com
The viewitems dictionary method was introduced in Python2.7. This breaks our setups on RHEL6 where only Python2.6 is present.
This fixes the issue by replacing viewitems() with items(). The functionality is the same, the difference is that viewitems() is just a lightweight view at the contents of the dictionary, whereas items() creates an actual list of the contents.
Signed-off-by: Ondrej Lichtner olichtne@redhat.com --- lnst/Controller/Machine.py | 2 +- lnst/Slave/InterfaceManager.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lnst/Controller/Machine.py b/lnst/Controller/Machine.py index 5a627ec..c5d9191 100644 --- a/lnst/Controller/Machine.py +++ b/lnst/Controller/Machine.py @@ -1222,7 +1222,7 @@ class Device(object): def get_ip_addrs(self, selector={}): return [ip["addr"] for ip in self._ip_addrs - if selector.viewitems() <= ip.viewitems()] + if selector.items() <= ip.items()]
@pre_call_decorate def get_ip_addr(self, num, selector={}): diff --git a/lnst/Slave/InterfaceManager.py b/lnst/Slave/InterfaceManager.py index 5a68f2e..5852254 100644 --- a/lnst/Slave/InterfaceManager.py +++ b/lnst/Slave/InterfaceManager.py @@ -454,7 +454,7 @@ class Device(object): def find_addrs(self, addr_spec): ret = [] for addr in self._ip_addrs: - if addr_spec.viewitems() <= addr.viewitems(): + if addr_spec.items() <= addr.items(): ret.append(addr) return ret
Fri, May 20, 2016 at 11:08:38AM CEST, olichtne@redhat.com wrote:
From: Ondrej Lichtner olichtne@redhat.com
The viewitems dictionary method was introduced in Python2.7. This breaks our setups on RHEL6 where only Python2.6 is present.
This fixes the issue by replacing viewitems() with items(). The functionality is the same, the difference is that viewitems() is just a lightweight view at the contents of the dictionary, whereas items() creates an actual list of the contents.
Signed-off-by: Ondrej Lichtner olichtne@redhat.com
Acked-by: Jan Tluka jtluka@redhat.com
Thanks for resolving/catching this, Ondrej and Jiri!
lnst-developers@lists.fedorahosted.org