Updated Branches:
  refs/heads/master fe32dc766 -> d22306344

Baremetal: Fix permission deny to ipmi.py

The file 
cloudstack-oss.asf/client/target/cloud-client-ui-4.2.0-SNAPSHOT/WEB-INF/classes/scripts/util/ipmi.py
is not mark as executible, so we cannot execute it directly.

Involve "/usr/bin/python" for it. The position of python file maybe different in
the different machines.


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

Branch: refs/heads/master
Commit: d22306344b213c6764decd2d7aa12ab027e0f141
Parents: fe32dc7
Author: Sheng Yang <[email protected]>
Authored: Fri Jun 21 18:06:04 2013 -0700
Committer: Sheng Yang <[email protected]>
Committed: Fri Jun 21 18:06:04 2013 -0700

----------------------------------------------------------------------
 .../networkservice/BareMetalResourceBase.java   | 28 +++++++++++++-------
 1 file changed, 19 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d2230634/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BareMetalResourceBase.java
----------------------------------------------------------------------
diff --git 
a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BareMetalResourceBase.java
 
b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BareMetalResourceBase.java
index 86e41fe..d46048e 100755
--- 
a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BareMetalResourceBase.java
+++ 
b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BareMetalResourceBase.java
@@ -183,60 +183,70 @@ public class BareMetalResourceBase extends ManagerBase 
implements ServerResource
                if (scriptPath == null) {
                        throw new ConfigurationException("Cannot find ping 
script " + scriptPath);
                }
-               _pingCommand = new Script2(scriptPath, s_logger);
+               String pythonPath = "/usr/bin/python";
+               _pingCommand = new Script2(pythonPath, s_logger);
+               _pingCommand.add(scriptPath);
                _pingCommand.add("ping");
                _pingCommand.add("hostname=" + _ip);
                _pingCommand.add("usrname=" + _username);
                _pingCommand.add("password=" + _password, ParamType.PASSWORD);
 
-               _setPxeBootCommand = new Script2(scriptPath, s_logger);
+               _setPxeBootCommand = new Script2(pythonPath, s_logger);
+               _setPxeBootCommand.add(scriptPath);
                _setPxeBootCommand.add("boot_dev");
                _setPxeBootCommand.add("hostname=" + _ip);
                _setPxeBootCommand.add("usrname=" + _username);
                _setPxeBootCommand.add("password=" + _password, 
ParamType.PASSWORD);
                _setPxeBootCommand.add("dev=pxe");
 
-               _setDiskBootCommand = new Script2(scriptPath, s_logger);
+               _setDiskBootCommand = new Script2(pythonPath, s_logger);
+               _setDiskBootCommand.add(scriptPath);
                _setDiskBootCommand.add("boot_dev");
                _setDiskBootCommand.add("hostname=" + _ip);
                _setDiskBootCommand.add("usrname=" + _username);
                _setDiskBootCommand.add("password=" + _password, 
ParamType.PASSWORD);
                _setDiskBootCommand.add("dev=disk");
 
-               _rebootCommand = new Script2(scriptPath, s_logger);
+               _rebootCommand = new Script2(pythonPath, s_logger);
+               _rebootCommand.add(scriptPath);
                _rebootCommand.add("reboot");
                _rebootCommand.add("hostname=" + _ip);
                _rebootCommand.add("usrname=" + _username);
                _rebootCommand.add("password=" + _password, ParamType.PASSWORD);
 
-               _getStatusCommand = new Script2(scriptPath, s_logger);
+               _getStatusCommand = new Script2(pythonPath, s_logger);
+               _getStatusCommand.add(scriptPath);
                _getStatusCommand.add("ping");
                _getStatusCommand.add("hostname=" + _ip);
                _getStatusCommand.add("usrname=" + _username);
                _getStatusCommand.add("password=" + _password, 
ParamType.PASSWORD);
 
-               _powerOnCommand = new Script2(scriptPath, s_logger);
+               _powerOnCommand = new Script2(pythonPath, s_logger);
+               _powerOnCommand.add(scriptPath);
                _powerOnCommand.add("power");
                _powerOnCommand.add("hostname=" + _ip);
                _powerOnCommand.add("usrname=" + _username);
                _powerOnCommand.add("password=" + _password, 
ParamType.PASSWORD);
                _powerOnCommand.add("action=on");
 
-               _powerOffCommand = new Script2(scriptPath, s_logger);
+               _powerOffCommand = new Script2(pythonPath, s_logger);
+               _powerOffCommand.add(scriptPath);
                _powerOffCommand.add("power");
                _powerOffCommand.add("hostname=" + _ip);
                _powerOffCommand.add("usrname=" + _username);
                _powerOffCommand.add("password=" + _password, 
ParamType.PASSWORD);
                _powerOffCommand.add("action=soft");
 
-               _forcePowerOffCommand = new Script2(scriptPath, s_logger);
+               _forcePowerOffCommand = new Script2(pythonPath, s_logger);
+               _forcePowerOffCommand.add(scriptPath);
                _forcePowerOffCommand.add("power");
                _forcePowerOffCommand.add("hostname=" + _ip);
                _forcePowerOffCommand.add("usrname=" + _username);
                _forcePowerOffCommand.add("password=" + _password, 
ParamType.PASSWORD);
                _forcePowerOffCommand.add("action=off");
 
-               _bootOrRebootCommand = new Script2(scriptPath, s_logger);
+               _bootOrRebootCommand = new Script2(pythonPath, s_logger);
+               _bootOrRebootCommand.add(scriptPath);
                _bootOrRebootCommand.add("boot_or_reboot");
                _bootOrRebootCommand.add("hostname=" + _ip);
                _bootOrRebootCommand.add("usrname=" + _username);

Reply via email to