Piotr Kliczewski has uploaded a new change for review.

Change subject: engine: host-deploy changes for jsonrpc integration
......................................................................

engine: host-deploy changes for jsonrpc integration

Updated conditional jsonrpc packages deployment during host install.

Change-Id: I43df4d16d65cde6c4e225c093a2ce5d94783f43d
Signed-off-by: pkliczewski <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsDeploy.java
M pom.xml
2 files changed, 28 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/90/23090/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsDeploy.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsDeploy.java
index d7df476..dafe1ae 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsDeploy.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsDeploy.java
@@ -59,6 +59,7 @@
 import org.ovirt.ovirt_host_deploy.constants.GlusterEnv;
 import org.ovirt.ovirt_host_deploy.constants.OpenStackEnv;
 import org.ovirt.ovirt_host_deploy.constants.VdsmEnv;
+import org.ovirt.ovirt_host_deploy.constants.VdsmJsonEnv;
 import org.ovirt.ovirt_host_deploy.constants.VirtEnv;
 
 /**
@@ -250,6 +251,17 @@
         CustomizationCondition[] value();
     }
     /**
+     * Special annotation to specify when the customization is not necessary.
+     */
+    @Target(ElementType.METHOD)
+    @Retention(RetentionPolicy.RUNTIME)
+    private @interface CallWhenNot {
+        /**
+         * @return A condition that determines if the customization should run.
+         */
+        CustomizationCondition[] value();
+    }
+    /**
      * A set of conditions under which the conditional customizations should 
run.
      */
     private Set<CustomizationCondition> _customizationConditions = new 
HashSet<>();
@@ -355,6 +367,14 @@
             );
             return null;
         }},
+        new Callable<Object>() 
{@CallWhen(CustomizationCondition.INSTALL_JSON_RPMS)
+        public Object call() throws Exception {
+            _parser.cliEnvironmentSet(
+                    VdsmJsonEnv.ENABLE,
+                    true
+            );
+            return null;
+        }},
         new Callable<Object>() { public Object call() throws Exception {
             _setVdsmId((String)_parser.cliEnvironmentGet(VdsmEnv.VDSM_ID));
             return null;
@@ -369,7 +389,8 @@
             );
             return null;
         }},
-        new Callable<Object>() { public Object call() throws Exception {
+        new Callable<Object>() { 
@CallWhenNot(CustomizationCondition.INSTALL_JSON_RPMS)
+        public Object call() throws Exception {
             _parser.cliEnvironmentSet(
                 String.format(
                     "%saddresses/management_port",
@@ -597,6 +618,11 @@
                         _parser.cliNoop();
                         return;
                     }
+                    CallWhenNot callWhenNot = 
callMethod.getAnnotation(CallWhenNot.class);
+                    if (callWhenNot != null && 
_customizationConditions.containsAll(Arrays.asList(callWhenNot.value()))){
+                        _parser.cliNoop();
+                        return;
+                    }
                 }
                 customizationStep.call();
             }
diff --git a/pom.xml b/pom.xml
index 4508008..0241173 100644
--- a/pom.xml
+++ b/pom.xml
@@ -71,7 +71,7 @@
     <mina-core.version>2.0.1</mina-core.version>
     <sshd-core.version>0.7.0</sshd-core.version>
     <otopi.version>1.1.0</otopi.version>
-    <ovirt-host-deploy.version>1.1.0</ovirt-host-deploy.version>
+    <ovirt-host-deploy.version>1.2.0-master</ovirt-host-deploy.version>
     <vdsm-jsonrpc-java.version>1.0.0-master</vdsm-jsonrpc-java.version>
     <slf4j-jdk14.version>1.5.6</slf4j-jdk14.version>
     <gwt.version>2.5.1</gwt.version>


-- 
To view, visit http://gerrit.ovirt.org/23090
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I43df4d16d65cde6c4e225c093a2ce5d94783f43d
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to