cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From weiz...@apache.org
Subject git commit: updated refs/heads/4.5 to 76dc20a
Date Fri, 12 Dec 2014 10:15:24 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.5 fbe54974c -> 76dc20a0e


CLOUDSTACK-255: fix NPE in createPortForwardingRule due to no PortForwarding provider
(cherry picked from commit c9d492d7140dd53f1630bc5ea14b948184233612)


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

Branch: refs/heads/4.5
Commit: 76dc20a0ee199d0b2d15f7ffe21fc9c45c72e9cc
Parents: fbe5497
Author: Wei Zhou <w.zhou@tech.leaseweb.com>
Authored: Fri Dec 12 11:13:18 2014 +0100
Committer: Wei Zhou <w.zhou@tech.leaseweb.com>
Committed: Fri Dec 12 11:15:08 2014 +0100

----------------------------------------------------------------------
 server/src/com/cloud/network/NetworkModelImpl.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/76dc20a0/server/src/com/cloud/network/NetworkModelImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkModelImpl.java b/server/src/com/cloud/network/NetworkModelImpl.java
index 2edf970..1fd354d 100755
--- a/server/src/com/cloud/network/NetworkModelImpl.java
+++ b/server/src/com/cloud/network/NetworkModelImpl.java
@@ -424,14 +424,14 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel
{
 
         // We only support one provider for one service now
         Map<Service, Set<Provider>> serviceToProviders = getServiceProvidersMap(networkId);
-        Set<Provider> oldProviders = serviceToProviders.get(services.toArray()[0]);
-        Provider oldProvider = (Provider)oldProviders.toArray()[0];
         // Since IP already has service to bind with, the oldProvider can't be null
         Set<Provider> newProviders = serviceToProviders.get(service);
         if (newProviders == null || newProviders.isEmpty()) {
             throw new InvalidParameterException("There is no new provider for IP " + publicIp.getAddress()
+ " of service " + service.getName() + "!");
         }
         Provider newProvider = (Provider)newProviders.toArray()[0];
+        Set<Provider> oldProviders = serviceToProviders.get(services.toArray()[0]);
+        Provider oldProvider = (Provider)oldProviders.toArray()[0];
         Network network = _networksDao.findById(networkId);
         NetworkElement oldElement = getElementImplementingProvider(oldProvider.getName());
         NetworkElement newElement = getElementImplementingProvider(newProvider.getName());


Mime
View raw message