Prevent broken include in case salt.control pillar is defined
Fixes: PROD-30707
Change-Id: I9a97d2d321c46c59ff335b51750abe0669a6c1a3
diff --git a/salt/control/init.sls b/salt/control/init.sls
index 0667db3..5415f97 100644
--- a/salt/control/init.sls
+++ b/salt/control/init.sls
@@ -1,15 +1,18 @@
{%- if pillar.salt.control is defined %}
+{%- set ctl = pillar.salt.control %}
+{%- if ctl.cloud_enabled is defined or ctl.docker_enabled is defined or ctl.maas_enabled is defined or ctl.virt_enabled is defined %}
include:
-{%- if pillar.salt.control.cloud_enabled is defined %}
+{%- if ctl.cloud_enabled is defined %}
- salt.control.cloud
{%- endif %}
-{%- if pillar.salt.control.docker_enabled is defined %}
+{%- if ctl.docker_enabled is defined %}
- salt.control.docker
{%- endif %}
-{%- if pillar.salt.control.maas_enabled is defined %}
+{%- if ctl.maas_enabled is defined %}
- salt.control.maas
{%- endif %}
-{%- if pillar.salt.control.virt_enabled is defined %}
+{%- if ctl.virt_enabled is defined %}
- salt.control.virt
{%- endif %}
{%- endif %}
+{%- endif %}