|
32 | 32 | import com.cloud.agent.api.PingCommand; |
33 | 33 | import com.cloud.agent.api.PingRoutingCommand; |
34 | 34 | import com.cloud.agent.api.routing.VmDataCommand; |
| 35 | +import com.cloud.utils.exception.CloudRuntimeException; |
35 | 36 | import com.cloud.utils.script.Script; |
36 | 37 | import com.cloud.utils.ssh.SSHCmdHelper; |
37 | 38 | import com.cloud.vm.VirtualMachine.State; |
@@ -70,27 +71,27 @@ public boolean configure(String name, Map<String, Object> params) throws Configu |
70 | 71 | String prepareScript = "scripts/network/ping/prepare_kickstart_bootfile.py"; |
71 | 72 | String prepareScriptPath = Script.findScript("", prepareScript); |
72 | 73 | if (prepareScriptPath == null) { |
73 | | - throw new ConfigurationException("Can not find prepare_kickstart_bootfile.py at " + prepareScriptPath); |
| 74 | + throw new ConfigurationException("Can not find prepare_kickstart_bootfile.py at " + prepareScript); |
74 | 75 | } |
75 | 76 | scp.put(prepareScriptPath, "/usr/bin/", "0755"); |
76 | 77 |
|
77 | 78 | String cpScript = "scripts/network/ping/prepare_kickstart_kernel_initrd.py"; |
78 | 79 | String cpScriptPath = Script.findScript("", cpScript); |
79 | 80 | if (cpScriptPath == null) { |
80 | | - throw new ConfigurationException("Can not find prepare_kickstart_kernel_initrd.py at " + cpScriptPath); |
| 81 | + throw new ConfigurationException("Can not find prepare_kickstart_kernel_initrd.py at " + cpScript); |
81 | 82 | } |
82 | 83 | scp.put(cpScriptPath, "/usr/bin/", "0755"); |
83 | 84 |
|
84 | 85 | String userDataScript = "scripts/network/ping/baremetal_user_data.py"; |
85 | 86 | String userDataScriptPath = Script.findScript("", userDataScript); |
86 | 87 | if (userDataScriptPath == null) { |
87 | | - throw new ConfigurationException("Can not find baremetal_user_data.py at " + userDataScriptPath); |
| 88 | + throw new ConfigurationException("Can not find baremetal_user_data.py at " + userDataScript); |
88 | 89 | } |
89 | 90 | scp.put(userDataScriptPath, "/usr/bin/", "0755"); |
90 | 91 |
|
91 | 92 | return true; |
92 | 93 | } catch (Exception e) { |
93 | | - throw new ConfigurationException(e.getMessage()); |
| 94 | + throw new CloudRuntimeException(e); |
94 | 95 | } finally { |
95 | 96 | if (sshConnection != null) { |
96 | 97 | sshConnection.close(); |
|
0 commit comments