Merge "Fixed labels in master node config enforcing"
diff --git a/_states/jenkins_node.py b/_states/jenkins_node.py
index dbba23d..ca0bbae 100644
--- a/_states/jenkins_node.py
+++ b/_states/jenkins_node.py
@@ -178,14 +178,15 @@
     ret['result'] = None if test else result
     return ret
 
-def setup_master(name, num_executors = "1", node_mode="Normal", lbl_text=""):
+
+def setup_master(name, num_executors="1", node_mode="Normal", labels=[]):
     """
     Jenkins setup master state method
 
     :param name: node name (master)
     :param num_executors: number of executors (optional, default 1)
     :param node_mode: Node mode (Normal or Exclusive)
-    :param lbl_text: label text
+    :param labels: array of labels
     :returns: salt-specified state dict
     """
     test = __opts__['test']  # noqa
@@ -199,10 +200,10 @@
     if test:
         status = 'CREATED'
         ret['changes'][name] = status
-        ret['comment'] = 'Label %s %s' % (name, status.lower())
+        ret['comment'] = 'Master node %s' % (status.lower())
     else:
         call_result = __salt__['jenkins_common.call_groovy_script'](
-            configure_master_groovy, {'num_executors': num_executors, 'lbl_text': lbl_text, 'node_mode': node_mode})
+            configure_master_groovy, {'num_executors': num_executors, 'lbl_text': " ".join(labels), 'node_mode': node_mode})
         if call_result["code"] == 200 and call_result["msg"] in ["CREATED", "EXISTS"]:
             status = "CREATED"
             ret['changes'][name] = status
@@ -215,4 +216,4 @@
             ret['comment'] = 'Jenkins master configure API call failure: %s' % (
                 call_result["msg"])
     ret['result'] = None if test else result
-    return ret
\ No newline at end of file
+    return ret