You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@libcloud.apache.org by "Tomaz Muraus (JIRA)" <ji...@apache.org> on 2013/03/10 05:31:13 UTC

[dev] [jira] [Commented] (LIBCLOUD-278) Name a ScriptDeployment object without absolute path fails the execution

    [ https://issues.apache.org/jira/browse/LIBCLOUD-278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13598152#comment-13598152 ] 

Tomaz Muraus commented on LIBCLOUD-278:
---------------------------------------

I just noticed while working on some other code that this change introduced a pretty bad regression.

run method allows you to run an arbitrary command on a remote server. With this change, users current working directory will be prep-pended to the command.

For example, if you pass bin "ls -la ." to run it would result in "<users home directory>/ls -la" which is wrong.

I will revert this change and add some tests so a regression like this won't be able to slip in next time.

I think a better change is to modify "client.put" method to return a directory where a file has been saved. Then we can prep-pend this path to the command which is passed to "client.run" inside ScriptDeployment.
                
> Name a ScriptDeployment object without absolute path fails the execution
> ------------------------------------------------------------------------
>
>                 Key: LIBCLOUD-278
>                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-278
>             Project: Libcloud
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 0.11.2
>            Reporter: Jaume Devesa
>            Assignee: Tomaz Muraus
>             Fix For: 0.12.1
>
>         Attachments: libcloud_278_full.patch, libcloud_278.patch
>
>
> If you set a name to a ScriptDeployment this way:
> sd = ScriptDeployment('touch total_success', name='success.sh')
> it fails the execution when you call the conn.deploy_node() function without feedback to the user. 
> The 'put' method of the 'ParamikoSSHClient' copies the file 'success.sh'  in the relative path of the logged user (/root/success.sh or /home/ubuntu/success.sh in Ubuntu machines), but the 'run' method of the same class runs directly the 'success.sh' script and this file is not in the classpath. 
> If you set the line previous to the return statement of the 'run' method:
> print ("Out: '%s', Error: '%s', Status: '%d'") % (so, se, status)
> You get:
> Out: '', Error: 'bash: success.sh: command not found', Status: '127'
> If the name of the 'ScriptDeployment' is an absolute path (sd = ScriptDeployment('touch total_success', name='/home/ubuntu/success.sh')), the execution runs fine.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira