cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [4/5] git commit: updated refs/heads/master to 219da64
Date Wed, 18 Nov 2015 12:13:35 GMT
CLOUDSTACK-8956: Remove assert(false) on opaque network and ping method on NiciraNvpApiVersion


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/b20c5be1
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/b20c5be1
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/b20c5be1

Branch: refs/heads/master
Commit: b20c5be1ce0be945485f6dfae92ade91460f411a
Parents: e1d1a40
Author: nvazquez <nicolas.m.vazquez@gmail.com>
Authored: Fri Oct 23 06:10:27 2015 -0700
Committer: nvazquez <nicovazquez90@gmail.com>
Committed: Mon Nov 16 11:29:31 2015 -0800

----------------------------------------------------------------------
 .../network/resource/NiciraNvpResource.java     |  2 +-
 .../nicira/nvp/plugin/NiciraNvpApiVersion.java  | 25 ++++----------------
 .../hypervisor/vmware/util/VmwareHelper.java    |  1 -
 3 files changed, 6 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b20c5be1/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/resource/NiciraNvpResource.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/resource/NiciraNvpResource.java
b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/resource/NiciraNvpResource.java
index 8ac2844..80a9386 100644
--- a/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/resource/NiciraNvpResource.java
+++ b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/resource/NiciraNvpResource.java
@@ -190,7 +190,7 @@ public class NiciraNvpResource implements ServerResource {
         ClusterRoleConfig[] configuredRoles = ccs.getConfiguredRoles();
         if (configuredRoles != null){
             String apiProviderMajorityVersion = searchApiProvider(configuredRoles);
-            NiciraNvpApiVersion.pingNiciraApiVersion(apiProviderMajorityVersion);
+            NiciraNvpApiVersion.setNiciraApiVersion(apiProviderMajorityVersion);
             NiciraNvpApiVersion.logNiciraApiVersion();
         }
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b20c5be1/utils/src/main/java/com/cloud/utils/nicira/nvp/plugin/NiciraNvpApiVersion.java
----------------------------------------------------------------------
diff --git a/utils/src/main/java/com/cloud/utils/nicira/nvp/plugin/NiciraNvpApiVersion.java
b/utils/src/main/java/com/cloud/utils/nicira/nvp/plugin/NiciraNvpApiVersion.java
index b2d6e16..4dfd4e2 100755
--- a/utils/src/main/java/com/cloud/utils/nicira/nvp/plugin/NiciraNvpApiVersion.java
+++ b/utils/src/main/java/com/cloud/utils/nicira/nvp/plugin/NiciraNvpApiVersion.java
@@ -26,34 +26,19 @@ import com.cloud.maint.Version;
 public class NiciraNvpApiVersion {
     private static final Logger s_logger = Logger.getLogger(NiciraNvpApiVersion.class);
 
-    private static String niciraApiVersion = null;
-
-    public static void pingNiciraApiVersion(String apiVersion){
-        if (apiVersion == null){
-            niciraApiVersion = null;
-        }
-        else{
-            if (niciraApiVersion == null){
-                setNiciraApiVersion(apiVersion);
-            }
-            else {
-                if (! apiVersion.equals(niciraApiVersion)){
-                    setNiciraApiVersion(apiVersion);
-                }
-            }
-        }
-    }
+    private static String niciraApiVersion;
 
-    private static void setNiciraApiVersion(String apiVersion){
+    public static synchronized void setNiciraApiVersion(String apiVersion){
         niciraApiVersion = apiVersion;
     }
 
-    public static boolean isApiVersionLowerThan(String apiVersion){
+    public static synchronized boolean isApiVersionLowerThan(String apiVersion){
+        if (niciraApiVersion == null) return false;
         int compare = Version.compare(niciraApiVersion, apiVersion);
         return (compare < 0);
     }
 
-    public static void logNiciraApiVersion(){
+    public static synchronized void logNiciraApiVersion(){
         s_logger.info("NSX API VERSION: " + ((niciraApiVersion != null) ? niciraApiVersion
: " NOT PRESENT"));
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b20c5be1/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareHelper.java
----------------------------------------------------------------------
diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareHelper.java b/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareHelper.java
index 204b1cd..3d62fdc 100644
--- a/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareHelper.java
+++ b/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareHelper.java
@@ -103,7 +103,6 @@ public class VmwareHelper {
             break;
 
         default:
-            assert (false);
             nic = new VirtualE1000();
         }
 


Mime
View raw message