incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@apache.org
Subject git commit: Create random version for StartupCommands in dev env setup
Date Thu, 30 Aug 2012 06:53:01 GMT
Updated Branches:
  refs/heads/master 0c915cd69 -> f7acd8fed


Create random version for StartupCommands in dev env setup


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

Branch: refs/heads/master
Commit: f7acd8fed8248b9b2c57c71c90bd8fd1f51e357b
Parents: 0c915cd
Author: Darren Shepherd <darren@godaddy.com>
Authored: Thu Aug 30 08:47:02 2012 +0200
Committer: Hugo Trippaers <htrippaers@schubergphilis.com>
Committed: Thu Aug 30 08:47:02 2012 +0200

----------------------------------------------------------------------
 .../xen/resource/CitrixResourceBase.java           |    3 ++-
 .../com/cloud/resource/ResourceManagerImpl.java    |    9 +++++++++
 2 files changed, 11 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/f7acd8fe/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
index c88ae80..d87c506 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
@@ -4646,7 +4646,8 @@ public abstract class CitrixResourceBase implements ServerResource,
HypervisorRe
 
     /* return : if setup is needed */
     protected boolean setupServer(Connection conn) {
-        String version = this.getClass().getName() + "-" + CitrixResourceBase.class.getPackage().getImplementationVersion();
+        String packageVersion = CitrixResourceBase.class.getPackage().getImplementationVersion();
+        String version = this.getClass().getName() + "-" + ( packageVersion == null ? Long.toString(System.currentTimeMillis())
: packageVersion );
 
         try {
             Host host = Host.getByUuid(conn, _host.uuid);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/f7acd8fe/server/src/com/cloud/resource/ResourceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/resource/ResourceManagerImpl.java b/server/src/com/cloud/resource/ResourceManagerImpl.java
index 98b3e5a..7dbf63f 100755
--- a/server/src/com/cloud/resource/ResourceManagerImpl.java
+++ b/server/src/com/cloud/resource/ResourceManagerImpl.java
@@ -1601,6 +1601,15 @@ public class ResourceManagerImpl implements ResourceManager, ResourceService,
Ma
                 return null;
             }
 
+            /* Generate a random version in a dev setup situation */
+            if ( this.getClass().getPackage().getImplementationVersion() == null ) {
+                for ( StartupCommand cmd : cmds ) {
+                    if ( cmd.getVersion() == null ) {
+                        cmd.setVersion(Long.toString(System.currentTimeMillis()));
+                    }
+                }
+            }
+            
             if (s_logger.isDebugEnabled()) {
                 new Request(-1l, -1l, cmds, true, false).logD("Startup request from directly
connected host: ", true);
             }


Mime
View raw message