Fix getting target for pillar 'I@maas:cluster or I@maas:region'

Change-Id: Ia1636466787255f6621e7393d19bff9f712a0ee0
diff --git a/tcp_tests/tests/system/test_cvp_pipelines.py b/tcp_tests/tests/system/test_cvp_pipelines.py
index acad827..0a0d27c 100644
--- a/tcp_tests/tests/system/test_cvp_pipelines.py
+++ b/tcp_tests/tests/system/test_cvp_pipelines.py
@@ -121,16 +121,20 @@
         jenkins_start_timeout = 60
         jenkins_build_timeout = 1800
 
-        maas_minion_id = salt.get_single_pillar(
-            tgt='I@maas:cluster:enabled:True or I@maas:region:enabled:True',
-            pillar="__reclass__:nodename")
+        try:
+            maas_minion_id = salt.get_single_pillar(
+                tgt='I@maas:cluster or I@maas:region',
+                pillar="__reclass__:nodename")
+            ntp_skipped_nodes = 'ntp_skipped_nodes={0}'.format(maas_minion_id)
+        except LookupError:
+            ntp_skipped_nodes = ''
 
         job_name = 'cvp-sanity'
         job_parameters = {
             'TEST_SET': '/var/lib/cvp-sanity/cvp_checks/tests/',
             'TESTS_SETTINGS': (
-                'drivetrain_version={0};ntp_skipped_nodes={1}'
-                .format(settings.MCP_VERSION, maas_minion_id)),
+                'drivetrain_version={0};{1}'
+                .format(settings.MCP_VERSION, ntp_skipped_nodes)),
         }
 
         show_step(2)
diff --git a/tcp_tests/tests/system/test_offline.py b/tcp_tests/tests/system/test_offline.py
index 62b1c9f..d19316b 100644
--- a/tcp_tests/tests/system/test_offline.py
+++ b/tcp_tests/tests/system/test_offline.py
@@ -263,14 +263,18 @@
         salt_deployed.update_ssh_data_from_minions()
 
         show_step(4)
-        maas_minion_id = salt_deployed.get_single_pillar(
-            tgt='I@maas:cluster or I@maas:region',
-            pillar="__reclass__:nodename")
+        try:
+            maas_minion_id = salt_deployed.get_single_pillar(
+                tgt='I@maas:cluster or I@maas:region',
+                pillar="__reclass__:nodename")
+            ntp_skipped_nodes = 'ntp_skipped_nodes={0}'.format(maas_minion_id)
+        except LookupError:
+            ntp_skipped_nodes = ''
 
         params = jenkins.make_defults_params('cvp-sanity')
         params['TESTS_SETTINGS'] = (
-            'drivetrain_version={0};ntp_skipped_nodes={1}'
-            .format(settings.MCP_VERSION, maas_minion_id))
+            'drivetrain_version={0};{1}'
+            .format(settings.MCP_VERSION, ntp_skipped_nodes))
         build = jenkins.run_build('cvp-sanity', params)
         LOG.info("Take a look test progress here - %s. Build #%s",
                  "http://172.16.44.33:8081/job/cvp-sanity/", build[1])