Merge "Add a possibility to specify branches for cvp repos"
diff --git a/src/com/mirantis/mcp/MCPArtifactory.groovy b/src/com/mirantis/mcp/MCPArtifactory.groovy
index 025ac7d..b272e25 100644
--- a/src/com/mirantis/mcp/MCPArtifactory.groovy
+++ b/src/com/mirantis/mcp/MCPArtifactory.groovy
@@ -32,14 +32,17 @@
 }
 
 /**
- * Get URL to artifact by properties
- * Returns String with URL to found artifact or null if nothing
+ * Get URL to artifact(s) by properties
+ * Returns String(s) with URL to found artifact or null if nothing
  *
  * @param artifactoryURL String, an URL to Artifactory
  * @param properties LinkedHashMap, a Hash of properties (key-value) which
  *        which should determine artifact in Artifactory
+ * @param onlyLastItem Boolean, return only last URL if true(by default),
+ *        else return list of all found artifact URLS
+ *
  */
-def uriByProperties(String artifactoryURL, LinkedHashMap properties) {
+def uriByProperties(String artifactoryURL, LinkedHashMap properties, Boolean onlyLastItem=true) {
     def key, value
     def properties_str = ''
     for (int i = 0; i < properties.size(); i++) {
@@ -55,12 +58,21 @@
     def content = new groovy.json.JsonSlurperClassic().parseText(result)
     def uri = content.get("results")
     if (uri) {
-        return uri.last().get("uri")
+        if (onlyLastItem) {
+            return uri.last().get("uri")
+        } else {
+            res = []
+            uri.each {it ->
+                res.add(it.get("uri"))
+            }
+            return res
+        }
     } else {
         return null
     }
 }
 
+
 /**
  * Set properties for artifact in Artifactory repo
  *
diff --git a/src/com/mirantis/mk/Orchestrate.groovy b/src/com/mirantis/mk/Orchestrate.groovy
index 409d15c..613f666 100644
--- a/src/com/mirantis/mk/Orchestrate.groovy
+++ b/src/com/mirantis/mk/Orchestrate.groovy
@@ -552,6 +552,11 @@
             }
         }
     }
+
+    // Run nova:controller to map cmp with cells
+    if (salt.testTarget(master, 'I@nova:controller')) {
+      salt.enforceState(master, 'I@nova:controller and *01*', 'nova.controller')
+    }
 }
 
 
@@ -568,6 +573,7 @@
     salt.enforceStateWithExclude(master, "I@opencontrail:control and *01*", "opencontrail", "opencontrail.client")
     salt.enforceStateWithExclude(master, "I@opencontrail:control", "opencontrail", "opencontrail.client")
     salt.enforceStateWithExclude(master, "I@opencontrail:collector and *01*", "opencontrail", "opencontrail.client")
+    salt.enforceStateWithExclude(master, "I@opencontrail:collector", "opencontrail", "opencontrail.client")
 
     if (salt.testTarget(master, 'I@docker:client and I@opencontrail:control')) {
         salt.enforceState(master, 'I@opencontrail:control or I@opencontrail:collector', 'docker.client')
@@ -785,7 +791,7 @@
         }
 
         if (salt.testTarget(master, 'I@glusterfs:client')) {
-            salt.enforceState(master, 'I@glusterfs:client', 'glusterfs.client')
+            salt.enforceState(master, 'I@glusterfs:client', 'glusterfs.client', true, true, null, false, -1, 2)
         }
     }