<div dir="ltr">Hello,<div>Should we understand that this regression won't be fixed until v2.2?</div><div>I think that many people execute scripts with redirections... and still wants to use the UI. At least I do.</div>
<div><br></div><div>Thanks in advance,</div><div><br></div><div>Pierre</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-04-02 10:16 GMT+02:00 Milan Zázrivec <span dir="ltr"><<a href="mailto:mzazrivec@redhat.com" target="_blank">mzazrivec@redhat.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Tuesday 01 April 2014 21:09:31 BERGMAN Andrew wrote:<br>
> Milan,<br>
><br>
> Thanks for confirming this is a bug not a lack of functionality.<br>
><br>
> I am not sure what I am supposed to do with that link to be honest<br>
><br>
> I am gathering that somewhere there is a call made when it schedules a<br>
> command and I need to change that call to be another kind of call that<br>
> works in 2.1?<br>
<br>
</div>Most of the stuff you can do in Spacewalk webui you are also able to achieve<br>
with Spacewalk's XML-RPC API (i.e. you don't need your browser, but you're<br>
able to write set of scripts which will automate whatever you'd otherwise<br>
be doing manually clicking in webui).<br>
<br>
So just as you're able to schedule a remote command in the webui, you're able<br>
to do it with a xml-rpc script. Webui in Spacewalk 2.1 won't accept >< signs,<br>
but xml-rpc api does (tested).<br>
<br>
Some example scripts:<br>
<br>
<a href="http://www.spacewalkproject.org/documentation/api/2.1/scripts.html" target="_blank">http://www.spacewalkproject.org/documentation/api/2.1/scripts.html</a><br>
<br>
And in your particular case, the script you'd want (in python):<br>
<br>
...<br>
#!/usr/bin/python<br>
import xmlrpclib<br>
<br>
SATELLITE_URL = "<a href="http://your.spacewalk.url.com/rpc/api" target="_blank">http://your.spacewalk.url.com/rpc/api</a>"<br>
SATELLITE_LOGIN = "youruser"<br>
SATELLITE_PASSWORD = "yourpassword"<br>
<br>
system_id = 0 # change this to the system id you want to schedule the run for<br>
user = "root"     # change this to the user to run the remote command as<br>
groupt = "root"  # change this to the group to run the remote command as<br>
timeout = 60 # in seconds<br>
script = """<br>
#!/bin/bash<br>
<br>
echo "whatever" > /tmp/wherever<br>
"""<br>
<br>
client = xmlrpclib.Server(SATELLITE_URL, verbose=0)<br>
<br>
key = client.auth.login(SATELLITE_LOGIN, SATELLITE_PASSWORD)<br>
client.system.schedule_script_run(key,<br>
    system_id, \<br>
    user, \<br>
    group, \<br>
    timeout, \<br>
    script, \<br>
    xmlrpclib.DateTime())<br>
client.auth.logout(key)<br>
...<br>
<br>
Regards<br>
<span class="HOEnZb"><font color="#888888">-MZ<br>
</font></span><div class="HOEnZb"><div class="h5">> -----Original Message-----<br>
> From: <a href="mailto:spacewalk-list-bounces@redhat.com">spacewalk-list-bounces@redhat.com</a><br>
> [mailto:<a href="mailto:spacewalk-list-bounces@redhat.com">spacewalk-list-bounces@redhat.com</a>] On Behalf Of Milan Zázrivec<br>
> Sent: Tuesday, 1 April 2014 7:02 PM<br>
> To: <a href="mailto:spacewalk-list@redhat.com">spacewalk-list@redhat.com</a><br>
> Subject: Re: [Spacewalk-list] Spacewalk 2.1 - characters in remote commands<br>
><br>
> On Monday 31 March 2014 21:36:10 BERGMAN Andrew wrote:<br>
> > Hi ,<br>
> ><br>
> > I have done a bit of google searching but not had much luck finding an<br>
> > answer so I am posting on here.<br>
> ><br>
> > When sending a remote commands I am finding > characters getting<br>
> > stripped out and making the command fail.  I haven't noticed any<br>
> > others yet but I get the feeling that the > character will not be the only<br>
> > one.<br>
> You have just discovered a bug in Spacewalk 2.1 webui. This used to work<br>
> just fine in Spacewalk 2.0.<br>
> > Does anyone know a way of sending such characters using remote<br>
> > commands or are we limited to very basic forms of commands?<br>
><br>
> Using > or < in the remote commands is all right. Right now though your only<br>
> option is to use XML-RPC API and system.scheduleScriptRun() call:<br>
><br>
> <a href="http://www.spacewalkproject.org/documentation/api/2.1/handlers/SystemHandler" target="_blank">http://www.spacewalkproject.org/documentation/api/2.1/handlers/SystemHandler</a><br>
> .html#scheduleScriptRun<br>
><br>
> Regards<br>
> -Milan Zázrivec<br>
><br>
> _______________________________________________<br>
> Spacewalk-list mailing list<br>
> <a href="mailto:Spacewalk-list@redhat.com">Spacewalk-list@redhat.com</a><br>
> <a href="https://www.redhat.com/mailman/listinfo/spacewalk-list" target="_blank">https://www.redhat.com/mailman/listinfo/spacewalk-list</a><br>
><br>
> ______________________________________________________________________<br>
> This email has been scanned by the Symantec Email Security.cloud service.<br>
> For more information please visit <a href="http://www.symanteccloud.com" target="_blank">http://www.symanteccloud.com</a><br>
> ______________________________________________________________________<br>
><br>
> Disclaimer : The contents of this e-mail including any attachments are<br>
> intended only for the person or entity to which this e-mail is addressed<br>
> and may contain confidential, privileged and/or commercially sensitive<br>
> material. If you are not, or believe you may not be, the intended<br>
> recipient, please advise the sender immediately by return e-mail, delete<br>
> this e-mail and destroy any copies.<br>
> ______________________________________________________________________ This<br>
> email has been scanned by the Symantec Email Security.cloud service. For<br>
> more information please visit <a href="http://www.symanteccloud.com" target="_blank">http://www.symanteccloud.com</a><br>
> ______________________________________________________________________<br>
><br>
> _______________________________________________<br>
> Spacewalk-list mailing list<br>
> <a href="mailto:Spacewalk-list@redhat.com">Spacewalk-list@redhat.com</a><br>
> <a href="https://www.redhat.com/mailman/listinfo/spacewalk-list" target="_blank">https://www.redhat.com/mailman/listinfo/spacewalk-list</a><br>
<br>
<br>
_______________________________________________<br>
Spacewalk-list mailing list<br>
<a href="mailto:Spacewalk-list@redhat.com">Spacewalk-list@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/spacewalk-list" target="_blank">https://www.redhat.com/mailman/listinfo/spacewalk-list</a><br>
</div></div></blockquote></div><br></div>