You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2018/01/13 20:14:26 UTC

[GitHub] DaanHoogland closed pull request #2403: CLOUDSTACK-10227: Stabilization fixes for 4.11.0.0

DaanHoogland closed pull request #2403: CLOUDSTACK-10227: Stabilization fixes for 4.11.0.0
URL: https://github.com/apache/cloudstack/pull/2403
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/api/src/org/apache/cloudstack/api/response/HostHAResponse.java b/api/src/org/apache/cloudstack/api/response/HostHAResponse.java
index 942250cbc21..a8b44bd5649 100644
--- a/api/src/org/apache/cloudstack/api/response/HostHAResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/HostHAResponse.java
@@ -84,6 +84,9 @@ public void setEnabled(Boolean enabled) {
 
     public void setHaState(HAConfig.HAState haState) {
         this.haState = haState;
+        if (haState == null) {
+            this.haState = HAConfig.HAState.Disabled;
+        }
     }
 
     public String getProvider() {
diff --git a/packaging/centos63/cloud.spec b/packaging/centos63/cloud.spec
index ef9d0278598..898118fa96d 100644
--- a/packaging/centos63/cloud.spec
+++ b/packaging/centos63/cloud.spec
@@ -130,8 +130,6 @@ Requires: perl
 Requires: libvirt-python
 Requires: qemu-img
 Requires: qemu-kvm
-Requires: epel-release
-Requires: aria2
 Provides: cloud-agent
 Obsoletes: cloud-agent < 4.1.0
 Obsoletes: cloud-agent-libs < 4.1.0
diff --git a/packaging/centos7/cloud.spec b/packaging/centos7/cloud.spec
index 78ee7d55199..f16858a4a8f 100644
--- a/packaging/centos7/cloud.spec
+++ b/packaging/centos7/cloud.spec
@@ -111,8 +111,6 @@ Requires: perl
 Requires: libvirt-python
 Requires: qemu-img
 Requires: qemu-kvm
-Requires: epel-release
-Requires: aria2
 Provides: cloud-agent
 Group: System Environment/Libraries
 %description agent
diff --git a/server/src/com/cloud/template/HypervisorTemplateAdapter.java b/server/src/com/cloud/template/HypervisorTemplateAdapter.java
index 10832593589..bfa73af6bcd 100644
--- a/server/src/com/cloud/template/HypervisorTemplateAdapter.java
+++ b/server/src/com/cloud/template/HypervisorTemplateAdapter.java
@@ -451,6 +451,7 @@ public boolean delete(TemplateProfile profile) {
 
         if (imageStores == null || imageStores.size() == 0) {
             // already destroyed on image stores
+            success = true;
             s_logger.info("Unable to find image store still having template: " + template.getName() + ", so just mark the template removed");
         } else {
             // Make sure the template is downloaded to all found image stores
@@ -536,10 +537,7 @@ public boolean delete(TemplateProfile profile) {
                                 templateZoneDao.remove(templateZone.getId());
                             }
                         }
-                    } catch (InterruptedException e) {
-                        s_logger.debug("Delete template Failed", e);
-                        throw new CloudRuntimeException("Delete template Failed", e);
-                    } catch (ExecutionException e) {
+                    } catch (InterruptedException|ExecutionException e) {
                         s_logger.debug("Delete template Failed", e);
                         throw new CloudRuntimeException("Delete template Failed", e);
                     }
@@ -551,7 +549,7 @@ public boolean delete(TemplateProfile profile) {
 
         }
         if (success) {
-            if ((imageStores.size() > 1) && (profile.getZoneIdList() != null)) {
+            if ((imageStores != null && imageStores.size() > 1) && (profile.getZoneIdList() != null)) {
                 //if template is stored in more than one image stores, and the zone id is not null, then don't delete other templates.
                 return success;
             }
diff --git a/server/src/org/apache/cloudstack/ha/HAManagerImpl.java b/server/src/org/apache/cloudstack/ha/HAManagerImpl.java
index 49d9432fa15..86ac0376de4 100644
--- a/server/src/org/apache/cloudstack/ha/HAManagerImpl.java
+++ b/server/src/org/apache/cloudstack/ha/HAManagerImpl.java
@@ -199,13 +199,16 @@ private boolean checkHAOwnership(final HAConfig haConfig) {
 
     private HAResource validateAndFindHAResource(final HAConfig haConfig) {
         HAResource resource = null;
+        if (haConfig == null) {
+            return null;
+        }
         if (haConfig.getResourceType() == HAResource.ResourceType.Host) {
             final Host host = hostDao.findById(haConfig.getResourceId());
             if (host != null && host.getRemoved() != null) {
                 return null;
             }
             resource = host;
-            if (resource == null && haConfig.getState() != HAConfig.HAState.Disabled) {
+            if (haConfig.getState() == null || (resource == null && haConfig.getState() != HAConfig.HAState.Disabled)) {
                 disableHA(haConfig.getResourceId(), haConfig.getResourceType());
                 return null;
             }
@@ -224,6 +227,9 @@ private HAResource validateAndFindHAResource(final HAConfig haConfig) {
     }
 
     private HAProvider<HAResource> validateAndFindHAProvider(final HAConfig haConfig, final HAResource resource) {
+        if (haConfig == null) {
+            return null;
+        }
         final HAProvider<HAResource> haProvider = haProviderMap.get(haConfig.getHaProvider());
         if (haProvider != null && !haProvider.isEligible(resource)) {
             if (haConfig.getState() != HAConfig.HAState.Ineligible) {
@@ -639,6 +645,10 @@ protected void runInContext() {
                 }
                 final List<HAConfig> haConfigList = new ArrayList<HAConfig>(haConfigDao.listAll());
                 for (final HAConfig haConfig : haConfigList) {
+                    if (haConfig == null) {
+                        continue;
+                    }
+
                     if (!checkHAOwnership(haConfig)) {
                         continue;
                     }
diff --git a/test/integration/smoke/test_hostha_simulator.py b/test/integration/smoke/test_hostha_simulator.py
index bb5fcb97c37..4dfb9e9ba6c 100644
--- a/test/integration/smoke/test_hostha_simulator.py
+++ b/test/integration/smoke/test_hostha_simulator.py
@@ -352,6 +352,7 @@ def test_ha_configure_enabledisable_across_clusterzones(self):
             Zone > Cluster > Host
         """
         host = self.getHost()
+        self.configureAndDisableHostHa(host.id)
         self.configureAndEnableHostHa()
 
         self.checkSyncToState('Available')
diff --git a/test/integration/smoke/test_templates.py b/test/integration/smoke/test_templates.py
index 22fead94d66..7057abe3342 100644
--- a/test/integration/smoke/test_templates.py
+++ b/test/integration/smoke/test_templates.py
@@ -540,7 +540,6 @@ def setUpClass(cls):
         cls.services["template"]["ostypeid"] = template.ostypeid
         cls.services["template_2"]["ostypeid"] = template.ostypeid
         cls.services["ostypeid"] = template.ostypeid
-        cls.services["isdynamicallyscalable"] = template.isdynamicallyscalable
         cls.account = Account.create(
                             cls.apiclient,
                             cls.services["account"],
@@ -590,6 +589,7 @@ def setUpClass(cls):
                                          account=cls.account.name,
                                          domainid=cls.account.domainid
                                          )
+        cls.services["isdynamicallyscalable"] = cls.template_1.isdynamicallyscalable
         cls.template_2 = Template.create(
                                          cls.apiclient,
                                          cls.services["template_2"],
diff --git a/test/integration/smoke/test_volumes.py b/test/integration/smoke/test_volumes.py
index 879f7b56957..27b46249f24 100644
--- a/test/integration/smoke/test_volumes.py
+++ b/test/integration/smoke/test_volumes.py
@@ -246,8 +246,6 @@ def test_01_create_volume(self):
                 ret = checkVolumeSize(ssh_handle=ssh,volume_name=volume_name,size_to_verify=vol_sz)
             elif list_volume_response[0].hypervisor.lower() == "hyperv":
                 ret = checkVolumeSize(ssh_handle=ssh,volume_name="/dev/sdb",size_to_verify=vol_sz)
-            elif list_volume_response[0].hypervisor.lower() == "vmware":
-                ret = checkVolumeSize(ssh_handle=ssh,volume_name="/dev/sdb",size_to_verify=vol_sz)
             else:
                 ret = checkVolumeSize(ssh_handle=ssh,size_to_verify=vol_sz)
             self.debug(" Volume Size Expected %s  Actual :%s" %(vol_sz,ret[1]))
@@ -634,10 +632,8 @@ def test_07_resize_fail(self):
         elif hosts[0].hypervisor.lower() in ("vmware", "hyperv"):
             self.skipTest("Resize Volume is unsupported on VmWare and Hyper-V")
 
-        # Attempting to resize it should throw an exception, as we're using a non
-        # customisable disk offering, therefore our size parameter should be ignored
-        with self.assertRaises(Exception):
-            self.apiClient.resizeVolume(cmd)
+        # Online resize should be supported
+        self.apiClient.resizeVolume(cmd)
 
         if hosts[0].hypervisor == "XenServer":
             self.virtual_machine.start(self.apiClient)
diff --git a/ui/scripts/templates.js b/ui/scripts/templates.js
index 5f601d839e4..d9d3af0deb0 100755
--- a/ui/scripts/templates.js
+++ b/ui/scripts/templates.js
@@ -258,8 +258,9 @@
                                                     $form.find('.form-item[rel=rootDiskControllerTypeKVM]').hide();
                                                     $form.find('.form-item[rel=directdownload]').hide();
 
-                                                    if (isAdmin())
+                                                    if (isAdmin()) {
                                                         $form.find('.form-item[rel=xenserverToolsVersion61plus]').css('display', 'inline-block');
+                                                    }
                                                 } else if ($(this).val() == "KVM") {
                                                     $form.find('.form-item[rel=rootDiskControllerType]').hide();
                                                     $form.find('.form-item[rel=nicAdapterType]').hide();
@@ -267,7 +268,9 @@
                                                     $form.find('.form-item[rel=xenserverToolsVersion61plus]').hide();
                                                     $form.find('.form-item[rel=rootDiskControllerTypeKVM]').css('display', 'inline-block');
                                                     $form.find('.form-item[rel=xenserverToolsVersion61plus]').css('display', 'inline-block');
-                                                    $form.find('.form-item[rel=directdownload]').css('display', 'inline-block');
+                                                    if (isAdmin()) {
+                                                      $form.find('.form-item[rel=directdownload]').css('display', 'inline-block');
+                                                    }
                                                 } else {
                                                     $form.find('.form-item[rel=rootDiskControllerType]').hide();
                                                     $form.find('.form-item[rel=nicAdapterType]').hide();
diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/mo/HostMO.java b/vmware-base/src/com/cloud/hypervisor/vmware/mo/HostMO.java
index 5f64e83c770..22bfafc2bad 100644
--- a/vmware-base/src/com/cloud/hypervisor/vmware/mo/HostMO.java
+++ b/vmware-base/src/com/cloud/hypervisor/vmware/mo/HostMO.java
@@ -1039,7 +1039,7 @@ public ComputeResourceSummary getHyperHostHardwareSummary() throws Exception {
     @Override
     public boolean isHyperHostConnected() throws Exception {
         HostRuntimeInfo runtimeInfo = (HostRuntimeInfo)_context.getVimClient().getDynamicProperty(_mor, "runtime");
-        return runtimeInfo.getConnectionState() == HostSystemConnectionState.CONNECTED;
+        return runtimeInfo != null && runtimeInfo.getConnectionState() == HostSystemConnectionState.CONNECTED;
     }
 
     public boolean revertToSnapshot(ManagedObjectReference morSnapshot) throws Exception {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services