Skip to content

Commit

Permalink
use imcgenutils.iteritems wrapper in place of bare iteritems method c…
Browse files Browse the repository at this point in the history
…all for python3 compatibility
  • Loading branch information
tzakrajs committed Feb 6, 2018
1 parent eff03e8 commit d85f133
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions imcsdk/apis/server/boot.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import logging
import imcsdk.imccoreutils as imccoreutils
import imcsdk.imcgenutils as imcgenutils
from imcsdk.mometa.lsboot.LsbootDevPrecision import LsbootDevPrecision

log = logging.getLogger('imc')
Expand Down Expand Up @@ -137,7 +138,7 @@ def _is_boot_order_policy(dn):

def _get_device_type(policy_type, in_device):
if policy_type == "boot-order-policy":
for device_type, device_props in policy_device_dict.iteritems():
for device_type, device_props in imcgenutils.iteritems(policy_device_dict):
if device_props["class_id"] == in_device._class_id and \
device_props["access"] == in_device.access:
return device_type
Expand Down Expand Up @@ -201,7 +202,7 @@ def _add_boot_device(handle, parent_dn, boot_device):
(boot_device["device-type"], boot_device["name"]))

device.order = boot_device["order"]
device_props = {key: value for key, value in boot_device.iteritems()
device_props = {key: value for key, value in imcgenutils.iteritems(boot_device)
if key not in ["order", "device-type", "name"]}
device.set_prop_multiple(**device_props)
if hasattr(device, "state"):
Expand Down Expand Up @@ -285,7 +286,7 @@ def boot_precision_configured_get(handle, server_id=1):

class_to_name_dict = {
value["class_id"]: key for key,
value in precision_device_dict.items()}
value in imcgenutils.iteritems(precision_device_dict)}

server_dn = get_server_dn(handle, server_id)
pmo = LsbootDevPrecision(parent_mo_or_dn=server_dn)
Expand Down

0 comments on commit d85f133

Please sign in to comment.