utils: Shuffle [cf|mf|df]_enabled arguments
Reorder the arguments to these functions so that an optional
falsevalue can be provided.
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Change-Id: I7eff61064d05d7f0983e404f2c67306ed12a237b
diff --git a/classes/obmc-phosphor-image.bbclass b/classes/obmc-phosphor-image.bbclass
index 32b7317..ec6b928 100644
--- a/classes/obmc-phosphor-image.bbclass
+++ b/classes/obmc-phosphor-image.bbclass
@@ -21,21 +21,21 @@
inherit obmc-phosphor-license
inherit obmc-phosphor-utils
-FEATURE_PACKAGES_obmc-bmc-state-mgmt ?= "${@cf_enabled('obmc-bmc-state-mgmt', 'virtual-obmc-bmc-state-mgmt', d)}"
-FEATURE_PACKAGES_obmc-chassis-mgmt ?= "${@cf_enabled('obmc-phosphor-chassis-mgmt', 'virtual-obmc-chassis-mgmt', d)}"
-FEATURE_PACKAGES_obmc-chassis-state-mgmt ?= "${@cf_enabled('obmc-chassis-state-mgmt', 'virtual-obmc-chassis-state-mgmt', d)}"
-FEATURE_PACKAGES_obmc-event-mgmt ?= "${@df_enabled('obmc-phosphor-event-mgmt', 'virtual-obmc-event-mgmt', d)}"
-FEATURE_PACKAGES_obmc-fan-mgmt ?= "${@cf_enabled('obmc-phosphor-fan-mgmt', 'virtual-obmc-fan-mgmt', d)}"
-FEATURE_PACKAGES_obmc-flash-mgmt ?= "${@cf_enabled('obmc-phosphor-flash-mgmt', 'virtual-obmc-flash-mgmt', d)}"
-FEATURE_PACKAGES_obmc-host-ctl ?= "${@cf_enabled('obmc-host-ctl', 'virtual-obmc-host-ctl', d)}"
-FEATURE_PACKAGES_obmc-host-ipmi ?= "${@cf_enabled('obmc-host-ipmi', 'virtual-obmc-host-ipmi-hw', d)}"
-FEATURE_PACKAGES_obmc-host-state-mgmt ?= "${@cf_enabled('obmc-host-state-mgmt', 'virtual-obmc-host-state-mgmt', d)}"
-FEATURE_PACKAGES_obmc-logging-mgmt ?= "${@df_enabled('obmc-logging-mgmt', 'virtual-obmc-logging-mgmt', d)}"
-FEATURE_PACKAGES_obmc-net-ipmi ?= "${@df_enabled('obmc-net-ipmi', 'virtual-obmc-net-ipmi', d)}"
-FEATURE_PACKAGES_obmc-sensor-mgmt ?= "${@cf_enabled('obmc-phosphor-sensor-mgmt', 'virtual-obmc-sensor-mgmt', d)}"
-FEATURE_PACKAGES_obmc-settings-mgmt ?= "${@df_enabled('obmc-settings-mgmt', 'virtual-obmc-settings-mgmt', d)}"
-FEATURE_PACKAGES_obmc-system-mgmt ?= "${@df_enabled('obmc-phosphor-system-mgmt', 'virtual-obmc-system-mgmt', d)}"
-FEATURE_PACKAGES_obmc-user-mgmt ?= "${@df_enabled('obmc-phosphor-user-mgmt', 'virtual-obmc-user-mgmt', d)}"
+FEATURE_PACKAGES_obmc-bmc-state-mgmt ?= "${@cf_enabled(d, 'obmc-bmc-state-mgmt', 'virtual-obmc-bmc-state-mgmt')}"
+FEATURE_PACKAGES_obmc-chassis-mgmt ?= "${@cf_enabled(d, 'obmc-phosphor-chassis-mgmt', 'virtual-obmc-chassis-mgmt')}"
+FEATURE_PACKAGES_obmc-chassis-state-mgmt ?= "${@cf_enabled(d, 'obmc-chassis-state-mgmt', 'virtual-obmc-chassis-state-mgmt')}"
+FEATURE_PACKAGES_obmc-event-mgmt ?= "${@df_enabled(d, 'obmc-phosphor-event-mgmt', 'virtual-obmc-event-mgmt')}"
+FEATURE_PACKAGES_obmc-fan-mgmt ?= "${@cf_enabled(d, 'obmc-phosphor-fan-mgmt', 'virtual-obmc-fan-mgmt')}"
+FEATURE_PACKAGES_obmc-flash-mgmt ?= "${@cf_enabled(d, 'obmc-phosphor-flash-mgmt', 'virtual-obmc-flash-mgmt')}"
+FEATURE_PACKAGES_obmc-host-ctl ?= "${@cf_enabled(d, 'obmc-host-ctl', 'virtual-obmc-host-ctl')}"
+FEATURE_PACKAGES_obmc-host-ipmi ?= "${@cf_enabled(d, 'obmc-host-ipmi', 'virtual-obmc-host-ipmi-hw')}"
+FEATURE_PACKAGES_obmc-host-state-mgmt ?= "${@cf_enabled(d, 'obmc-host-state-mgmt', 'virtual-obmc-host-state-mgmt')}"
+FEATURE_PACKAGES_obmc-logging-mgmt ?= "${@df_enabled(d, 'obmc-logging-mgmt', 'virtual-obmc-logging-mgmt')}"
+FEATURE_PACKAGES_obmc-net-ipmi ?= "${@df_enabled(d, 'obmc-net-ipmi', 'virtual-obmc-net-ipmi')}"
+FEATURE_PACKAGES_obmc-sensor-mgmt ?= "${@cf_enabled(d, 'obmc-phosphor-sensor-mgmt', 'virtual-obmc-sensor-mgmt')}"
+FEATURE_PACKAGES_obmc-settings-mgmt ?= "${@df_enabled(d, 'obmc-settings-mgmt', 'virtual-obmc-settings-mgmt')}"
+FEATURE_PACKAGES_obmc-system-mgmt ?= "${@df_enabled(d, 'obmc-phosphor-system-mgmt', 'virtual-obmc-system-mgmt')}"
+FEATURE_PACKAGES_obmc-user-mgmt ?= "${@df_enabled(d, 'obmc-phosphor-user-mgmt', 'virtual-obmc-user-mgmt')}"
# Install entire Phosphor application stack by default
IMAGE_FEATURES += " \
diff --git a/classes/obmc-phosphor-utils.bbclass b/classes/obmc-phosphor-utils.bbclass
index b5073a6..713c892 100644
--- a/classes/obmc-phosphor-utils.bbclass
+++ b/classes/obmc-phosphor-utils.bbclass
@@ -3,18 +3,18 @@
inherit utils
-def df_enabled(feature, value, d):
- return base_contains("DISTRO_FEATURES", feature, value, "", d)
+def df_enabled(d, feature, truevalue, falsevalue=""):
+ return base_contains("DISTRO_FEATURES", feature, truevalue, falsevalue, d)
-def mf_enabled(feature, value, d):
- return base_contains("MACHINE_FEATURES", feature, value, "", d)
+def mf_enabled(d, feature, truevalue, falsevalue=""):
+ return base_contains("MACHINE_FEATURES", feature, truevalue, falsevalue, d)
-def cf_enabled(feature, value, d):
- return value if df_enabled(feature, value, d) \
- and mf_enabled(feature, value, d) \
- else ""
+def cf_enabled(d, feature, truevalue, falsevalue=""):
+ return truevalue if df_enabled(d, feature, truevalue) \
+ and mf_enabled(d, feature, truevalue) \
+ else falsevalue
def set_append(d, var, val, sep=' '):