def run_script_on_server(<EOL>script_name,<EOL>server_name,<EOL>inputs=None,<EOL>timeout_s=<NUM_LIT:10>,<EOL>output=sys.stdout<EOL>):
api = get_api()<EOL>script = find_by_name(api.right_scripts, script_name)<EOL>server = find_by_name(api.servers, server_name)<EOL>path = server.links['<STR_LIT>'] + '<STR_LIT>'<EOL>data = {<EOL>'<STR_LIT>': script.href,<EOL>}<EOL>if inputs:<EOL><INDENT>for k, v in inputs.items():<EOL><INDENT>data['<STR_LIT>' % k] = '<STR_LIT>' + v<EOL><DEDENT><DEDENT>response = api.client.post(path, data=data)<EOL>status_path = response.headers['<STR_LIT:location>']<EOL>for i in range(timeout_s):<EOL><INDENT>status = api.client.get(status_path).json()<EOL>summary = status.get('<STR_LIT>', '<STR_LIT>')<EOL>output.write('<STR_LIT>' % summary)<EOL>if summary.startswith('<STR_LIT>'):<EOL><INDENT>return<EOL><DEDENT>time.sleep(<NUM_LIT:1>)<EOL><DEDENT>output.write('<STR_LIT>' % status_path)<EOL>
Runs a RightScript and polls for status.

Sample usage::

    from rightscale import run_script_on_server
    run_script_on_server(
            'my cool bob lol script',
            'some server',
            inputs={'BOB': 'blah blah', 'LOL': 'fubar'},
            )

Sample output::

    status: Querying tags
    status: Querying tags
    status: Preparing execution
    status: RightScript: 'my cool bob lol script'
    status: completed: my cool bob lol script

Defaults to printing status message to stdout, but will accept any object
that implements ``write()`` passed in to :attr:`output`.