diff --git a/devstack/plugin.sh b/devstack/plugin.sh index dabdadb..2df8214 100755 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -68,6 +68,13 @@ function update_ironic_enabled_drivers { } function install_ironic_staging_drivers { + # FIXME(derekh) Copied from similar fix in + # networking-generic-switch/devstack/plugin.sh + # See: Change-Id: I70f50584a7552e294681375e42879f68750f5096 + # we need to ensure pep8 is present before proceeding, as it + # is required to install ironic-staging-drivers. For some unknown reason + # its getting removed before this point. + sudo -H pip install -I --force-reinstall pep8 setup_develop $IRONIC_STAGING_DRIVERS_DIR } diff --git a/ironic_staging_drivers/intel_nm/nm_commands.py b/ironic_staging_drivers/intel_nm/nm_commands.py index a8e0987..5308517 100644 --- a/ironic_staging_drivers/intel_nm/nm_commands.py +++ b/ironic_staging_drivers/intel_nm/nm_commands.py @@ -249,11 +249,15 @@ def set_policy(policy): 0x10 if policy['enable'] else 0x00)) _append_to_command(cmd, _hex(policy['policy_id'])) # 0x10 is policy add flag - _append_to_command(cmd, _hex(TRIGGERS[policy['policy_trigger']] | - CPU_CORRECTION[policy['cpu_power_correction']] - | STORAGE[policy['storage']] | 0x10)) - _append_to_command(cmd, _hex(ACTIONS[policy['action']] | - POWER_DOMAIN[policy['power_domain']])) + flags = TRIGGERS[policy['policy_trigger']] + flags |= CPU_CORRECTION[policy['cpu_power_correction']] + flags |= STORAGE[policy['storage']] + flags |= 0x10 + _append_to_command(cmd, _hex(flags)) + + flags = ACTIONS[policy['action']] + flags |= POWER_DOMAIN[policy['power_domain']] + _append_to_command(cmd, _hex(flags)) if isinstance(policy['target_limit'], int): limit = policy['target_limit']