Hi Bogdan You should put the function in the fabfile.py. Anyway, if your script imports fabric, then you need to install fabric in the target machines, or refactor it. Take a look to virtualenv if you really need to install fabric on remote machines.
El 10/9/2016 7:01 p. m., "Bogdan" <[email protected]> escribió: > > where is this function located, do I need to add any additional files to my project, my project has only 1 file in it. Im sure I need to add fabric library to my project folder so i can run my script using fabric on different linux boxes. > > On Sat, Sep 10, 2016 at 9:55 AM, Carlos García < [email protected]> wrote: >> >> Hi, you can pass the contents of the script file as a parameter to this function >> >> def run_python(script): >> return run("echo -e '{contents}' | python".format(contents=script)) >> >> Then you can call it like this: >> >> fab run_python:'$(cat script.py)' -H hostname >> >> >> El 10/9/2016 6:09 p. m., "santosh kumar" <[email protected]> escribió: >>> >>> * U can use the put function to dump the Python file in all systems. >>> * Later run in using another function. >>> >>> We don't need fabric on all nodes. Make sure ssh is enabled. >>> >>> >>> On Sep 10, 2016 15:31, "bohdan kalytovskyy" <[email protected]> wrote: >>>> >>>> Need to run python script with fabric on multiple computers with out installing fabric on all of them, how can I achieve that? >>>> >>>> Thank you. >>>> _______________________________________________ >>>> Fab-user mailing list >>>> [email protected] <[email protected]> >>>> https://lists.nongnu.org/mailman/listinfo/fab-user <https://lists.nongnu.org/mailman/listinfo/fab-user> >>> >>> >>> >>> _______________________________________________ >>> Fab-user mailing list >>> [email protected] <[email protected]> >>> https://lists.nongnu.org/mailman/listinfo/fab-user <https://lists.nongnu.org/mailman/listinfo/fab-user> >>> >
_______________________________________________ Fab-user mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/fab-user
