|
103 | 103 | @Local(value = {VirtualRoutingResource.class}) |
104 | 104 | public class VirtualRoutingResource implements Manager { |
105 | 105 | private static final Logger s_logger = Logger.getLogger(VirtualRoutingResource.class); |
106 | | - private String _savepasswordPath; // This script saves a random password to the DomR file system |
107 | 106 | private String _publicIpAddress; |
108 | 107 | private String _firewallPath; |
109 | 108 | private String _loadbPath; |
@@ -548,13 +547,14 @@ protected Answer execute(final SavePasswordCommand cmd) { |
548 | 547 | final String vmIpAddress = cmd.getVmIpAddress(); |
549 | 548 | final String local = vmName; |
550 | 549 |
|
551 | | - // Run save_password_to_domr.sh |
552 | | - final String result = savePassword(routerPrivateIPAddress, vmIpAddress, password, local); |
| 550 | + String args = "-v " + vmIpAddress; |
| 551 | + args += " -p " + password; |
| 552 | + |
| 553 | + String result = routerProxy("savepassword.sh", routerPrivateIPAddress, args); |
553 | 554 | if (result != null) { |
554 | 555 | return new Answer(cmd, false, "Unable to save password to DomR."); |
555 | | - } else { |
556 | | - return new Answer(cmd); |
557 | 556 | } |
| 557 | + return new Answer(cmd); |
558 | 558 | } |
559 | 559 |
|
560 | 560 | protected Answer execute(final DhcpEntryCommand cmd) { |
@@ -813,16 +813,6 @@ private Answer executeProxyLoadScan(final Command cmd, final long proxyVmId, fin |
813 | 813 | return new ConsoleProxyLoadAnswer(cmd, proxyVmId, proxyVmName, success, result); |
814 | 814 | } |
815 | 815 |
|
816 | | - public String savePassword(final String privateIpAddress, final String vmIpAddress, final String password, final String localPath) { |
817 | | - final Script command = new Script(_savepasswordPath, _startTimeout, s_logger); |
818 | | - command.add("-r", privateIpAddress); |
819 | | - command.add("-v", vmIpAddress); |
820 | | - command.add("-p", password); |
821 | | - command.add(localPath); |
822 | | - |
823 | | - return command.execute(); |
824 | | - } |
825 | | - |
826 | 816 | public String assignGuestNetwork(final String dev, final String routerIP, |
827 | 817 | final String routerGIP, final String gateway, final String cidr, |
828 | 818 | final String netmask, final String dns, final String domainName) { |
@@ -1128,11 +1118,6 @@ public boolean configure(final String name, final Map<String, Object> params) th |
1128 | 1118 | throw new ConfigurationException("Unable to find the call_loadbalancer.sh"); |
1129 | 1119 | } |
1130 | 1120 |
|
1131 | | - _savepasswordPath = findScript("save_password_to_domr.sh"); |
1132 | | - if (_savepasswordPath == null) { |
1133 | | - throw new ConfigurationException("Unable to find save_password_to_domr.sh"); |
1134 | | - } |
1135 | | - |
1136 | 1121 | _dhcpEntryPath = findScript("dhcp_entry.sh"); |
1137 | 1122 | if (_dhcpEntryPath == null) { |
1138 | 1123 | throw new ConfigurationException("Unable to find dhcp_entry.sh"); |
|
0 commit comments