fixed issue with viewkeys behaving different between versions of python 2.7

This commit is contained in:
Blake J. Harnden 2018-08-01 18:22:41 -07:00
parent 4a9c751935
commit 4f592d0651
2 changed files with 4 additions and 4 deletions

View file

@ -70,8 +70,8 @@ class ServiceDependencies(object):
if path:
paths.append(path)
if self.booted != self.node_services.viewkeys():
raise ValueError("failure to boot all services: %s != %s", self.booted, self.node_services.keys())
if self.booted != set(self.node_services.iterkeys()):
raise ValueError("failure to boot all services: %s != %s" % (self.booted, self.node_services.keys()))
return paths
@ -170,7 +170,7 @@ class ServiceShim(object):
:return: nothing
"""
if key not in cls.keys:
raise ValueError('key `%s` not in `%s`' % (key, cls.keys))
raise ValueError("key `%s` not in `%s`" % (key, cls.keys))
# this handles data conversion to int, string, and tuples
if value:
if key == "startidx":

View file

@ -155,7 +155,7 @@ def build_node_platform_xml(emane_manager, control_net, node, nem_id, platform_x
eventdev = None
platform_element = platform_xmls.get(key)
if not platform_element:
if platform_element is None:
platform_element = etree.Element("platform")
if otadev: