You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ro...@apache.org on 2017/12/12 07:44:20 UTC

[cloudstack] 01/02: more fixes

This is an automated email from the ASF dual-hosted git repository.

rohit pushed a commit to branch debian9-systemvmtemplate
in repository https://gitbox.apache.org/repos/asf/cloudstack.git

commit ff3de93116d2f0de8d35c220b4856db37b854792
Author: Rohit Yadav <ro...@shapeblue.com>
AuthorDate: Tue Dec 12 12:31:33 2017 +0530

    more fixes
    
    Signed-off-by: Rohit Yadav <ro...@shapeblue.com>
---
 .../cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java  |  4 ++++
 server/src/com/cloud/server/StatsCollector.java              | 12 ++++++++++--
 systemvm/debian/etc/issue                                    |  2 +-
 test/integration/smoke/test_nic.py                           |  6 +++---
 test/integration/smoke/test_service_offerings.py             |  2 +-
 5 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
index 7f2e156..3ce96a6 100644
--- a/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
@@ -216,6 +216,10 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
             @SuppressWarnings("rawtypes")
             final GenericDao dao = GenericDaoBase.getDao(job.getClass());
 
+            if (dao == null) {
+                throw new CloudRuntimeException(String.format("Failed to get dao from job's class=%s, for job id=%d, cmd=%s", job.getClass(), job.getId(), job.getCmd()));
+            }
+
             publishOnEventBus(job, "submit");
 
             if (!_vmInstanceDao.lockInLockTable(String.valueOf(syncObjId), VmJobLockTimeout.value())){
diff --git a/server/src/com/cloud/server/StatsCollector.java b/server/src/com/cloud/server/StatsCollector.java
index 305711e..96b51f5 100644
--- a/server/src/com/cloud/server/StatsCollector.java
+++ b/server/src/com/cloud/server/StatsCollector.java
@@ -918,7 +918,12 @@ public class StatsCollector extends ManagerBase implements ComponentMethodInterc
                     try {
                         HashMap<String, VolumeStatsEntry> volumeStatsByUuid = _userVmMgr.getVolumeStatistics(pool.getClusterId(), pool.getUuid(), pool.getPoolType(), volumeLocators, StatsTimeout.value());
                         if (volumeStatsByUuid != null){
-                            _volumeStats.putAll(volumeStatsByUuid);
+                            for (final Map.Entry<String, VolumeStatsEntry> entry : volumeStatsByUuid.entrySet()) {
+                                if (entry == null || entry.getKey() == null || entry.getValue() == null) {
+                                    continue;
+                                }
+                                _volumeStats.put(entry.getKey(), entry.getValue());
+                            }
                         }
                     } catch (Exception e) {
                         s_logger.warn("Failed to get volume stats for cluster with ID: " + pool.getClusterId(), e);
@@ -932,7 +937,10 @@ public class StatsCollector extends ManagerBase implements ComponentMethodInterc
     }
 
     public VolumeStats getVolumeStats(String volumeLocator) {
-        return _volumeStats.get(volumeLocator);
+        if (_volumeStats.containsKey(volumeLocator)) {
+            return _volumeStats.get(volumeLocator);
+        }
+        return null;
     }
 
     class StorageCollector extends ManagedContextRunnable {
diff --git a/systemvm/debian/etc/issue b/systemvm/debian/etc/issue
index 94e8f84..84a2d1e 100644
--- a/systemvm/debian/etc/issue
+++ b/systemvm/debian/etc/issue
@@ -1,4 +1,4 @@
-   __?.o/  Apache CloudStack SystemVM 4.11
+   __?.o/  Apache CloudStack SystemVM
   (  )#    https://cloudstack.apache.org
  (___(_)   \s \r \n \l
 
diff --git a/test/integration/smoke/test_nic.py b/test/integration/smoke/test_nic.py
index 584ccf5..c7f8468 100644
--- a/test/integration/smoke/test_nic.py
+++ b/test/integration/smoke/test_nic.py
@@ -22,7 +22,7 @@ from marvin.lib.base import (Account,
                              VirtualMachine,
                              NetworkOffering)
 from marvin.lib.common import (get_zone,
-                               get_test_template,
+                               get_template,
                                get_domain)
 from marvin.lib.utils import validateList
 from marvin.codes import PASS
@@ -76,10 +76,10 @@ class TestNic(cloudstackTestCase):
                 self.services["service_offerings"][
                     "tiny"]["storagetype"] = 'local'
 
-            template = get_test_template(
+            template = get_template(
                 self.apiclient,
                 self.zone.id,
-                self.hypervisor
+                self.services["ostype"]
             )
             # Set Zones and disk offerings
             self.services["small"]["zoneid"] = self.zone.id
diff --git a/test/integration/smoke/test_service_offerings.py b/test/integration/smoke/test_service_offerings.py
index 42bebe0..50c69d7 100644
--- a/test/integration/smoke/test_service_offerings.py
+++ b/test/integration/smoke/test_service_offerings.py
@@ -385,7 +385,7 @@ class TestServiceOfferings(cloudstackTestCase):
             "Check CPU Speed for small offering"
         )
 
-        range = 20
+        range = 25
         if self.hypervisor.lower() == "hyperv":
             range = 200
         # TODO: Find the memory allocated to VM on hyperv hypervisor using

-- 
To stop receiving notification emails like this one, please contact
"commits@cloudstack.apache.org" <co...@cloudstack.apache.org>.