[
https://issues.apache.org/jira/browse/LIBCLOUD-394?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13763001#comment-13763001
]
Tomaz Muraus commented on LIBCLOUD-394:
---------------------------------------
First sorry about the documentation. We are aware that current documentation is
lacking and we are working on the improved version which is available at
https://libcloud.apache.org/docs/.
And now a couple of things:
1. Only purpose of "FileDeployment" is to install (copy) a file on the server.
It doesn't run the file, it simply copies it.
2. With your use case you might be interested in the ScriptDeployment class.
ScriptDeployment takes "script" argument which is the content of the shell
script to run. For example:
{code}
deployment = ScriptDeployment(script="sudo apt-get install cowsay").
{code}
ScriptDeployment works by writing contents of the "script" argument to the file
on the remote server and then running it.
It seems like you are more interested in running a script which is already
available on the server though.
Currently, libcloud doesn't expose a nice way to do that. In theory you could
use "ScriptDeployment" to do that - e.g. ScriptDeployment(script="bash
/path/to/existing/script.sh"), but that's hacky and I advise against doing it.
3. I do believe it would be reasonable to add a couple of things:
1. "args" argument to the ScriptDeploymeny class. This arguments would then be
passed to the uploaded script.
2. A new class which runs and existing script on the server - something I would
assume you are interested in.
We explicitly avoided added #2 in the beginning, because it could encourage bad
practices like using Libcloud as a configuration management tool which is not.
> ScriptDeployment needs to pass command line arguments to its uploaded script
> ----------------------------------------------------------------------------
>
> Key: LIBCLOUD-394
> URL: https://issues.apache.org/jira/browse/LIBCLOUD-394
> Project: Libcloud
> Issue Type: Improvement
> Components: Compute
> Affects Versions: 0.13.1
> Reporter: Hugh Esco
>
> All attempts to pass a command line argument to my deployment script
> have failed and a review of the pydoc for this module reveal no clues
> about how to accomplish this task.
> I would urge a syntax like the following:
> class FileDeployment(Deployment)
> __init__(self, source, target, args)
> where args would be a scalar representation of the
> command line arguments to be passed to the deployment script.
--
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