phosphor-discovery: Fixes some conditional check
Correct the return values from string to boolean
of distro feature check for avahi and slp.
This commit also correct the check if slp and avahi is
not enabled then return
Change-Id: I2a19c14fdaf19523702062e6466d636080eeabe6
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
diff --git a/meta-phosphor/classes/obmc-phosphor-discovery-service.bbclass b/meta-phosphor/classes/obmc-phosphor-discovery-service.bbclass
index 73a4875..313402f 100644
--- a/meta-phosphor/classes/obmc-phosphor-discovery-service.bbclass
+++ b/meta-phosphor/classes/obmc-phosphor-discovery-service.bbclass
@@ -3,12 +3,12 @@
python() {
avahi_enabled = bb.utils.contains(
- 'DISTRO_FEATURES', 'avahi', 'true', 'false', d)
+ 'DISTRO_FEATURES', 'avahi', True, False, d)
slp_enabled = bb.utils.contains(
- 'DISTRO_FEATURES', 'slp', 'true', 'false', d)
+ 'DISTRO_FEATURES', 'slp', True, False, d)
- if not avahi_enabled and slp_enabled:
+ if not avahi_enabled and not slp_enabled:
return
syscnfdir = d.getVar('sysconfdir', True)
@@ -48,11 +48,11 @@
python discovery_services_postinstall() {
avahi_enabled = bb.utils.contains(
- 'DISTRO_FEATURES', 'avahi', 'true', 'false', d)
+ 'DISTRO_FEATURES', 'avahi', True, False, d)
slp_enabled = bb.utils.contains(
- 'DISTRO_FEATURES', 'slp', 'true', 'false', d)
+ 'DISTRO_FEATURES', 'slp', True, False, d)
- if not avahi_enabled and slp_enabled:
+ if not avahi_enabled and not slp_enabled:
return
avahi_service_dir = d.getVar('AVAHI_SERVICES_DIR', True).strip()