cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject [5/5] git commit: updated refs/heads/master to f321acd
Date Wed, 05 Jun 2013 07:22:27 GMT
Provide mock implementations of VPC network commands

Provide mock implementations for all network commands in the
MockNetworkManagerImpl of the simualtor

Signed-off-by: Prasanna Santhanam <tsp@apache.org>


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

Branch: refs/heads/master
Commit: f321acd06dcffe953bcdb1f3d54c7b88fab9dbdb
Parents: da6f39b
Author: Prasanna Santhanam <tsp@apache.org>
Authored: Tue Jun 4 21:40:30 2013 +0530
Committer: Prasanna Santhanam <tsp@apache.org>
Committed: Wed Jun 5 12:47:31 2013 +0530

----------------------------------------------------------------------
 .../cloud/agent/manager/MockNetworkManager.java    |   28 +++-
 .../agent/manager/MockNetworkManagerImpl.java      |  138 +++++++++++++--
 .../com/cloud/agent/manager/MockVmManagerImpl.java |   61 ++++++-
 .../cloud/agent/manager/SimulatorManagerImpl.java  |   14 +-
 4 files changed, 209 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f321acd0/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockNetworkManager.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockNetworkManager.java
b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockNetworkManager.java
index 61a556a..554af68 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockNetworkManager.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockNetworkManager.java
@@ -22,19 +22,29 @@ package com.cloud.agent.manager;
 import com.cloud.agent.api.Answer;
 import com.cloud.agent.api.CheckS2SVpnConnectionsCommand;
 import com.cloud.agent.api.NetworkUsageCommand;
+import com.cloud.agent.api.PlugNicAnswer;
 import com.cloud.agent.api.PlugNicCommand;
 import com.cloud.agent.api.PvlanSetupCommand;
+import com.cloud.agent.api.SetupGuestNetworkAnswer;
+import com.cloud.agent.api.SetupGuestNetworkCommand;
+import com.cloud.agent.api.UnPlugNicAnswer;
 import com.cloud.agent.api.UnPlugNicCommand;
 import com.cloud.agent.api.routing.DhcpEntryCommand;
+import com.cloud.agent.api.routing.IpAssocAnswer;
 import com.cloud.agent.api.routing.IpAssocCommand;
 import com.cloud.agent.api.routing.IpAssocVpcCommand;
 import com.cloud.agent.api.routing.LoadBalancerConfigCommand;
 import com.cloud.agent.api.routing.SetFirewallRulesCommand;
+import com.cloud.agent.api.routing.SetNetworkACLAnswer;
 import com.cloud.agent.api.routing.SetNetworkACLCommand;
+import com.cloud.agent.api.routing.SetPortForwardingRulesAnswer;
 import com.cloud.agent.api.routing.SetPortForwardingRulesCommand;
 import com.cloud.agent.api.routing.SetPortForwardingRulesVpcCommand;
+import com.cloud.agent.api.routing.SetSourceNatAnswer;
 import com.cloud.agent.api.routing.SetSourceNatCommand;
+import com.cloud.agent.api.routing.SetStaticNatRulesAnswer;
 import com.cloud.agent.api.routing.SetStaticNatRulesCommand;
+import com.cloud.agent.api.routing.SetStaticRouteAnswer;
 import com.cloud.agent.api.routing.SetStaticRouteCommand;
 import com.cloud.agent.api.routing.Site2SiteVpnCfgCommand;
 import com.cloud.utils.component.Manager;
@@ -57,19 +67,23 @@ public interface MockNetworkManager extends Manager {
 
     Answer setupPVLAN(PvlanSetupCommand cmd);
 
-    Answer plugNic(PlugNicCommand cmd);
+    PlugNicAnswer plugNic(PlugNicCommand cmd);
 
-    Answer unplugNic(UnPlugNicCommand cmd);
+    UnPlugNicAnswer unplugNic(UnPlugNicCommand cmd);
 
-    Answer ipAssoc(IpAssocVpcCommand cmd);
+    IpAssocAnswer ipAssoc(IpAssocVpcCommand cmd);
 
-    Answer setSourceNat(SetSourceNatCommand cmd);
+    SetSourceNatAnswer setSourceNat(SetSourceNatCommand cmd);
 
-    Answer setNetworkAcl(SetNetworkACLCommand cmd);
+    SetNetworkACLAnswer setNetworkAcl(SetNetworkACLCommand cmd);
 
-    Answer setVpcPortForwards(SetPortForwardingRulesVpcCommand cmd);
+    SetPortForwardingRulesAnswer setVpcPortForwards(SetPortForwardingRulesVpcCommand cmd);
 
-    Answer setStaticRoute(SetStaticRouteCommand cmd);
+    SetupGuestNetworkAnswer setUpGuestNetwork(SetupGuestNetworkCommand cmd);
+
+    SetStaticNatRulesAnswer setVPCStaticNatRules(SetStaticNatRulesCommand cmd);
+
+    SetStaticRouteAnswer setStaticRoute(SetStaticRouteCommand cmd);
 
     Answer siteToSiteVpn(Site2SiteVpnCfgCommand cmd);
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f321acd0/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockNetworkManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockNetworkManagerImpl.java
b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockNetworkManagerImpl.java
index 232146a..ea8bcce 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockNetworkManagerImpl.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockNetworkManagerImpl.java
@@ -23,24 +23,47 @@ import com.cloud.agent.api.Answer;
 import com.cloud.agent.api.CheckS2SVpnConnectionsCommand;
 import com.cloud.agent.api.NetworkUsageAnswer;
 import com.cloud.agent.api.NetworkUsageCommand;
+import com.cloud.agent.api.PlugNicAnswer;
 import com.cloud.agent.api.PlugNicCommand;
 import com.cloud.agent.api.PvlanSetupCommand;
+import com.cloud.agent.api.SetupGuestNetworkAnswer;
+import com.cloud.agent.api.SetupGuestNetworkCommand;
+import com.cloud.agent.api.UnPlugNicAnswer;
 import com.cloud.agent.api.UnPlugNicCommand;
 import com.cloud.agent.api.routing.DhcpEntryCommand;
+import com.cloud.agent.api.routing.IpAssocAnswer;
 import com.cloud.agent.api.routing.IpAssocCommand;
 import com.cloud.agent.api.routing.IpAssocVpcCommand;
 import com.cloud.agent.api.routing.LoadBalancerConfigCommand;
+import com.cloud.agent.api.routing.NetworkElementCommand;
+import com.cloud.agent.api.routing.SetFirewallRulesAnswer;
 import com.cloud.agent.api.routing.SetFirewallRulesCommand;
+import com.cloud.agent.api.routing.SetNetworkACLAnswer;
 import com.cloud.agent.api.routing.SetNetworkACLCommand;
+import com.cloud.agent.api.routing.SetPortForwardingRulesAnswer;
 import com.cloud.agent.api.routing.SetPortForwardingRulesCommand;
 import com.cloud.agent.api.routing.SetPortForwardingRulesVpcCommand;
+import com.cloud.agent.api.routing.SetSourceNatAnswer;
 import com.cloud.agent.api.routing.SetSourceNatCommand;
+import com.cloud.agent.api.routing.SetStaticNatRulesAnswer;
 import com.cloud.agent.api.routing.SetStaticNatRulesCommand;
+import com.cloud.agent.api.routing.SetStaticRouteAnswer;
 import com.cloud.agent.api.routing.SetStaticRouteCommand;
 import com.cloud.agent.api.routing.Site2SiteVpnCfgCommand;
+import com.cloud.agent.api.to.IpAddressTO;
+import com.cloud.agent.api.to.PortForwardingRuleTO;
+import com.cloud.simulator.MockVMVO;
+import com.cloud.simulator.dao.MockVMDao;
 import com.cloud.utils.component.ManagerBase;
+import org.apache.log4j.Logger;
+
+import javax.inject.Inject;
 
 public class MockNetworkManagerImpl extends ManagerBase implements MockNetworkManager {
+    private static final Logger s_logger = Logger.getLogger(MockVmManagerImpl.class);
+
+    @Inject
+    MockVMDao _mockVmDao;
 
     @Override
     public Answer SetStaticNatRules(SetStaticNatRulesCommand cmd) {
@@ -53,8 +76,22 @@ public class MockNetworkManagerImpl extends ManagerBase implements MockNetworkMa
     }
 
     @Override
-    public Answer SetFirewallRules(SetFirewallRulesCommand cmd) {
-        return new Answer(cmd);
+    public SetFirewallRulesAnswer SetFirewallRules(SetFirewallRulesCommand cmd) {
+        String[] results = new String[cmd.getRules().length];
+        String routerIp = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP);
+        if (routerIp == null) {
+            return new SetFirewallRulesAnswer(cmd, false, results);
+        }
+
+        String[][] rules = cmd.generateFwRules();
+        StringBuilder sb = new StringBuilder();
+        String[] fwRules = rules[0];
+        if (fwRules.length > 0) {
+            for (int i = 0; i < fwRules.length; i++) {
+                sb.append(fwRules[i]).append(',');
+            }
+        }
+        return new SetFirewallRulesAnswer(cmd, true, results);
     }
 
 
@@ -84,38 +121,107 @@ public class MockNetworkManagerImpl extends ManagerBase implements MockNetworkMa
     }
 
     @Override
-    public Answer plugNic(PlugNicCommand cmd) {
-        return new Answer(cmd);
+    public PlugNicAnswer plugNic(PlugNicCommand cmd) {
+        String vmname = cmd.getVmName();
+        if (_mockVmDao.findByVmName(vmname) != null) {
+            s_logger.debug("Plugged NIC (dev=" + cmd.getNic().getDeviceId() + ", " + cmd.getNic().getIp()
+ ") into " + cmd.getVmName());
+            return new PlugNicAnswer(cmd,  true, "success");
+        }
+        s_logger.error("Plug NIC failed for (dev=" + cmd.getNic().getDeviceId() + ", " +
cmd.getNic().getIp() + ") into " + cmd.getVmName());
+        return new PlugNicAnswer(cmd, false, "failure");
     }
 
     @Override
-    public Answer unplugNic(UnPlugNicCommand cmd) {
-        return new Answer(cmd);
+    public UnPlugNicAnswer unplugNic(UnPlugNicCommand cmd) {
+        String vmname = cmd.getVmName();
+        if (_mockVmDao.findByVmName(vmname) != null) {
+            s_logger.debug("Plugged NIC (dev=" + cmd.getNic().getDeviceId() + ", " + cmd.getNic().getIp()
+ ") into " + cmd.getVmName());
+            return new UnPlugNicAnswer(cmd,  true, "success");
+        }
+        s_logger.error("Plug NIC failed for (dev=" + cmd.getNic().getDeviceId() + ", " +
cmd.getNic().getIp() + ") into " + cmd.getVmName());
+        return new UnPlugNicAnswer(cmd, false, "failure");
     }
 
     @Override
-    public Answer ipAssoc(IpAssocVpcCommand cmd) {
-        return new Answer(cmd);
+    public IpAssocAnswer ipAssoc(IpAssocVpcCommand cmd) {
+        String[] results = new String[cmd.getIpAddresses().length];
+        int i = 0;
+        IpAddressTO[] ips = cmd.getIpAddresses();
+        for (IpAddressTO ip : ips) {
+            results[i++] = ip.getPublicIp() + " - success";
+        }
+        return new IpAssocAnswer(cmd, results);
     }
 
     @Override
-    public Answer setSourceNat(SetSourceNatCommand cmd) {
-        return new Answer(cmd);
+    public SetSourceNatAnswer setSourceNat(SetSourceNatCommand cmd) {
+        return new SetSourceNatAnswer(cmd, true, "success");
     }
 
     @Override
-    public Answer setNetworkAcl(SetNetworkACLCommand cmd) {
-        return new Answer(cmd);
+    public SetNetworkACLAnswer setNetworkAcl(SetNetworkACLCommand cmd) {
+        String[] results = new String[cmd.getRules().length];
+        String routerName = cmd.getAccessDetail(NetworkElementCommand.ROUTER_NAME);
+        String routerIp = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP);
+
+        StringBuilder sb = new StringBuilder();
+        sb.append(routerIp);
+        sb.append(routerName);
+
+        String [][] rules = cmd.generateFwRules();
+        String[] aclRules = rules[0];
+
+        for (int i = 0; i < aclRules.length; i++) {
+            sb.append(aclRules[i]).append(',');
+        }
+        return new SetNetworkACLAnswer(cmd, true, results);
     }
 
     @Override
-    public Answer setVpcPortForwards(SetPortForwardingRulesVpcCommand cmd) {
-        return new Answer(cmd);
+    public SetPortForwardingRulesAnswer setVpcPortForwards(SetPortForwardingRulesVpcCommand
cmd) {
+        String[] results = new String[cmd.getRules().length];
+        StringBuilder sb = new StringBuilder();
+        for (PortForwardingRuleTO rule : cmd.getRules()) {
+            sb.append("src:");
+            sb.append(rule.getStringSrcPortRange());
+            sb.append("dst:");
+            sb.append(rule.getStringDstPortRange());
+        }
+        return new SetPortForwardingRulesAnswer(cmd, results, true);
     }
 
     @Override
-    public Answer setStaticRoute(SetStaticRouteCommand cmd) {
-        return new Answer(cmd);
+    public SetStaticRouteAnswer setStaticRoute(SetStaticRouteCommand cmd) {
+        String[] results = new String[cmd.getStaticRoutes().length];
+        String [][] rules = cmd.generateSRouteRules();
+        StringBuilder sb = new StringBuilder();
+        String[] srRules = rules[0];
+        for (int i = 0; i < srRules.length; i++) {
+            sb.append(srRules[i]).append(',');
+        }
+        return new SetStaticRouteAnswer(cmd, true, results);
+    }
+
+    @Override
+    public SetupGuestNetworkAnswer setUpGuestNetwork(SetupGuestNetworkCommand cmd) {
+        String domrName = cmd.getAccessDetail(NetworkElementCommand.ROUTER_NAME);
+        try {
+            MockVMVO vms = _mockVmDao.findByVmName(domrName);
+            if (vms == null) {
+                return new SetupGuestNetworkAnswer(cmd, false, "Can not find VM " + domrName);
+            }
+            return new SetupGuestNetworkAnswer(cmd, true, "success");
+        } catch (Exception e) {
+            String msg = "Creating guest network failed due to " + e.toString();
+            s_logger.warn(msg, e);
+            return new SetupGuestNetworkAnswer(cmd, false, msg);
+        }
+    }
+
+    @Override
+    public SetStaticNatRulesAnswer setVPCStaticNatRules(SetStaticNatRulesCommand cmd) {
+        String[] results = new String[cmd.getRules().length];
+        return new SetStaticNatRulesAnswer(cmd, results, true);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f321acd0/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManagerImpl.java
b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManagerImpl.java
index 6ee9d60..64df113 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManagerImpl.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManagerImpl.java
@@ -17,12 +17,47 @@
 package com.cloud.agent.manager;
 
 
-import com.cloud.agent.api.*;
+import com.cloud.agent.api.Answer;
+import com.cloud.agent.api.BumpUpPriorityCommand;
+import com.cloud.agent.api.CheckRouterAnswer;
+import com.cloud.agent.api.CheckRouterCommand;
+import com.cloud.agent.api.CheckVirtualMachineAnswer;
+import com.cloud.agent.api.CheckVirtualMachineCommand;
+import com.cloud.agent.api.CleanupNetworkRulesCmd;
+import com.cloud.agent.api.CreateVMSnapshotAnswer;
+import com.cloud.agent.api.CreateVMSnapshotCommand;
+import com.cloud.agent.api.DeleteVMSnapshotAnswer;
+import com.cloud.agent.api.DeleteVMSnapshotCommand;
+import com.cloud.agent.api.GetDomRVersionAnswer;
+import com.cloud.agent.api.GetDomRVersionCmd;
+import com.cloud.agent.api.GetVmStatsAnswer;
+import com.cloud.agent.api.GetVmStatsCommand;
+import com.cloud.agent.api.GetVncPortAnswer;
+import com.cloud.agent.api.GetVncPortCommand;
+import com.cloud.agent.api.MigrateAnswer;
+import com.cloud.agent.api.MigrateCommand;
+import com.cloud.agent.api.NetworkRulesVmSecondaryIpCommand;
+import com.cloud.agent.api.PrepareForMigrationAnswer;
+import com.cloud.agent.api.PrepareForMigrationCommand;
+import com.cloud.agent.api.RebootAnswer;
+import com.cloud.agent.api.RebootCommand;
+import com.cloud.agent.api.RevertToVMSnapshotAnswer;
+import com.cloud.agent.api.RevertToVMSnapshotCommand;
+import com.cloud.agent.api.ScaleVmCommand;
+import com.cloud.agent.api.SecurityGroupRuleAnswer;
+import com.cloud.agent.api.SecurityGroupRulesCmd;
+import com.cloud.agent.api.StartAnswer;
+import com.cloud.agent.api.StartCommand;
+import com.cloud.agent.api.StopAnswer;
+import com.cloud.agent.api.StopCommand;
+import com.cloud.agent.api.VmStatsEntry;
 import com.cloud.agent.api.check.CheckSshAnswer;
 import com.cloud.agent.api.check.CheckSshCommand;
 import com.cloud.agent.api.proxy.CheckConsoleProxyLoadCommand;
 import com.cloud.agent.api.proxy.WatchConsoleProxyLoadCommand;
-import com.cloud.agent.api.routing.*;
+import com.cloud.agent.api.routing.NetworkElementCommand;
+import com.cloud.agent.api.routing.SavePasswordCommand;
+import com.cloud.agent.api.routing.VmDataCommand;
 import com.cloud.agent.api.to.NicTO;
 import com.cloud.agent.api.to.VirtualMachineTO;
 import com.cloud.network.Networks.TrafficType;
@@ -437,17 +472,33 @@ public class MockVmManagerImpl extends ManagerBase implements MockVmManager
{
 
     @Override
     public Answer createVmSnapshot(CreateVMSnapshotCommand cmd) {
-        return null;  //To change body of implemented methods use File | Settings | File
Templates.
+        String vmName = cmd.getVmName();
+        String vmSnapshotName = cmd.getTarget().getSnapshotName();
+
+        s_logger.debug("Created snapshot " +vmSnapshotName+ " for vm " + vmName);
+        return new CreateVMSnapshotAnswer(cmd, cmd.getTarget(), cmd.getVolumeTOs());
     }
 
     @Override
     public Answer deleteVmSnapshot(DeleteVMSnapshotCommand cmd) {
-        return null;  //To change body of implemented methods use File | Settings | File
Templates.
+        String vm = cmd.getVmName();
+        String snapshotName = cmd.getTarget().getSnapshotName();
+        if(_mockVmDao.findByVmName(cmd.getVmName()) != null) {
+            return new DeleteVMSnapshotAnswer(cmd, false, "No VM by name "+ cmd.getVmName());
+        }
+        s_logger.debug("Removed snapshot " +snapshotName+ " of VM "+vm);
+        return new DeleteVMSnapshotAnswer(cmd, true, "success");
     }
 
     @Override
     public Answer revertVmSnapshot(RevertToVMSnapshotCommand cmd) {
-        return null;  //To change body of implemented methods use File | Settings | File
Templates.
+        String vm = cmd.getVmName();
+        String snapshot = cmd.getTarget().getSnapshotName();
+        if(_mockVmDao.findByVmName(cmd.getVmName()) != null) {
+            return new RevertToVMSnapshotAnswer(cmd, false, "No VM by name "+ cmd.getVmName());
+        }
+        s_logger.debug("Reverted to snapshot " +snapshot+ " of VM "+vm);
+        return new RevertToVMSnapshotAnswer(cmd, true, "success");
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f321acd0/plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java
b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java
index 8f6116c..1f1f4c5 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java
@@ -59,6 +59,7 @@ import com.cloud.agent.api.ScaleVmCommand;
 import com.cloud.agent.api.SecStorageSetupCommand;
 import com.cloud.agent.api.SecStorageVMSetupCommand;
 import com.cloud.agent.api.SecurityGroupRulesCmd;
+import com.cloud.agent.api.SetupGuestNetworkCommand;
 import com.cloud.agent.api.StartCommand;
 import com.cloud.agent.api.StopCommand;
 import com.cloud.agent.api.StoragePoolInfo;
@@ -331,8 +332,12 @@ public class SimulatorManagerImpl extends ManagerBase implements SimulatorManage
                 return _mockNetworkMgr.setSourceNat((SetSourceNatCommand) cmd);
             } else if (cmd instanceof SetNetworkACLCommand) {
                 return _mockNetworkMgr.setNetworkAcl((SetNetworkACLCommand) cmd);
+            } else if (cmd instanceof SetupGuestNetworkCommand) {
+                return _mockNetworkMgr.setUpGuestNetwork((SetupGuestNetworkCommand) cmd);
             } else if (cmd instanceof SetPortForwardingRulesVpcCommand) {
                 return _mockNetworkMgr.setVpcPortForwards((SetPortForwardingRulesVpcCommand)
cmd);
+            } else if (cmd instanceof SetStaticNatRulesCommand) {
+                return _mockNetworkMgr.setVPCStaticNatRules((SetStaticNatRulesCommand) cmd);
             } else if (cmd instanceof SetStaticRouteCommand) {
                 return _mockNetworkMgr.setStaticRoute((SetStaticRouteCommand) cmd);
             } else if (cmd instanceof Site2SiteVpnCfgCommand) {
@@ -340,18 +345,19 @@ public class SimulatorManagerImpl extends ManagerBase implements SimulatorManage
             } else if (cmd instanceof CheckS2SVpnConnectionsCommand) {
                 return _mockNetworkMgr.checkSiteToSiteVpnConnection((CheckS2SVpnConnectionsCommand)
cmd);
             } else if (cmd instanceof CreateVMSnapshotCommand) {
-                return _mockVmMgr.createVmSnapshot((CreateVMSnapshotCommand)cmd);
+                return _mockVmMgr.createVmSnapshot((CreateVMSnapshotCommand) cmd);
             } else if (cmd instanceof DeleteVMSnapshotCommand) {
-                return _mockVmMgr.deleteVmSnapshot((DeleteVMSnapshotCommand)cmd);
+                return _mockVmMgr.deleteVmSnapshot((DeleteVMSnapshotCommand) cmd);
             } else if (cmd instanceof RevertToVMSnapshotCommand) {
-                return _mockVmMgr.revertVmSnapshot((RevertToVMSnapshotCommand)cmd);
+                return _mockVmMgr.revertVmSnapshot((RevertToVMSnapshotCommand) cmd);
             } else if (cmd instanceof NetworkRulesVmSecondaryIpCommand) {
-                return _mockVmMgr.plugSecondaryIp((NetworkRulesVmSecondaryIpCommand)cmd);
+                return _mockVmMgr.plugSecondaryIp((NetworkRulesVmSecondaryIpCommand) cmd);
             } else if (cmd instanceof ScaleVmCommand) {
                 return _mockVmMgr.scaleVm((ScaleVmCommand) cmd);
             } else if (cmd instanceof PvlanSetupCommand) {
                 return _mockNetworkMgr.setupPVLAN((PvlanSetupCommand) cmd);
             } else {
+                s_logger.error("Simulator does not implement command of type "+cmd.toString());
                 return Answer.createUnsupportedCommandAnswer(cmd);
             }
         } catch(Exception e) {


Mime
View raw message