Description of problem: After creating a Software Channel and repository, I want to set a sync schedule with spacecmd softwarechannel_setsyncschedule. This does not seem to be parsing the Quartz CronTrigger schedule correctly. Setting the same schedule on the GUI works, but it's impossible to do from the command line: spacecmd {SSM:0}> softwarechannel_listsyncschedule key Channel Name Update Schedule ----- --------------------- --------------- 101 centos6-x86_64 0 0 22 ? * 6 spacecmd {SSM:0}> softwarechannel_setsyncschedule centos6-x86_64 0 0 22 ? * 6 ERROR: redstone.xmlrpc.XmlRpcFault: unhandled internal exception: redstone.xmlrpc.XmlRpcFault: com.redhat.rhn.taskomatic.InvalidParamException: Cron trigger: 0 0 22 ? .* 6 spacecmd {SSM:0}> softwarechannel_setsyncschedule centos6-x86_64 0 0 22 ? \* 6 ERROR: redstone.xmlrpc.XmlRpcFault: unhandled internal exception: redstone.xmlrpc.XmlRpcFault: com.redhat.rhn.taskomatic.InvalidParamException: Cron trigger: 0 0 22 ? .* 6 spacecmd {SSM:0}> softwarechannel_setsyncschedule centos6-x86_64 0 0 22 ? \\* 6 ERROR: redstone.xmlrpc.XmlRpcFault: unhandled internal exception: redstone.xmlrpc.XmlRpcFault: com.redhat.rhn.taskomatic.InvalidParamException: Cron trigger: 0 0 22 ? \.* 6 spacecmd {SSM:0}> softwarechannel_setsyncschedule centos6-x86_64 0 0 22 ? "*" 6 ERROR: redstone.xmlrpc.XmlRpcFault: unhandled internal exception: redstone.xmlrpc.XmlRpcFault: com.redhat.rhn.taskomatic.InvalidParamException: Cron trigger: 0 0 22 ? .* 6 spacecmd {SSM:0}> softwarechannel_setsyncschedule centos6-x86_64 0 0 22 ? '*' 6 ERROR: redstone.xmlrpc.XmlRpcFault: unhandled internal exception: redstone.xmlrpc.XmlRpcFault: com.redhat.rhn.taskomatic.InvalidParamException: Cron trigger: 0 0 22 ? .* 6 Version: # rpm -qa|grep spacecmd spacecmd-2.8.25-1.el7.centos.noarch How reproducible: Always Steps to Reproduce: As above
This should be already fixed in master by commit 3e8942219def2910ca45e0cfc4a337e69fee8efa Could you please try to use latest nightly version of spacecmd to see whether it fails or not? It can be easily found here: https://copr.fedorainfracloud.org/coprs/g/spacewalkproject/nightly/build/758551/
Yes, that seems to work. I do however find it odd that the exit code is still 0 when the command fails: # spacecmd -- softwarechannel_setsyncschedule --sync-kickstart "epel7-centos7-x86_64" "0 15 0 \? \* 7" INFO: Connected to https://spacewalk.example.com/rpc/api as admin softwarechannel_setsyncschedule: Sets the repo sync schedule for a software channel usage: softwarechannel_setsyncschedule <CHANNEL> <SCHEDULE> Options: -e/--no-errata : Do not sync errata -f/--fail : Terminate upon any error -k/--sync-kickstart : Create kickstartable tree -l/--latest : Only download latest package versions when repo syncs The schedule is specified in Quartz CronTrigger format without enclosing quotes. For example, to set a schedule of every day at 1am, <SCHEDULE> would be 0 0 1 * * ? If <SCHEDULE> is left empty, it will be disabled. # echo $? 0 This makes it hard to implement with Config Management tools like Ansible. Should I open a new bug about it?
If you'd be so kind, please open a new bug regarding the exit code, I'd appreciate that. Also if you could state if the exit code is always zero (even for other failing commands) that would be great information for me to begin with.
Move Spacewalk 2.9 bugs ON_QA.
Spacewalk 2.9 has been released. https://github.com/spacewalkproject/spacewalk/wiki/ReleaseNotes29