Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1683096 - hammer sync-plan update does not work with custom cron
Summary: hammer sync-plan update does not work with custom cron
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Sync Plans
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: 6.5.0
Assignee: Samir Jha
QA Contact: Stephen Wadeley
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-02-26 09:19 UTC by Stephen Wadeley
Modified: 2019-11-05 22:46 UTC (History)
2 users (show)

Fixed In Version: tfm-rubygem-katello-3.10.0.30-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-05-14 12:40:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 26283 0 Normal Closed hammer sync-plan update does not work with custom cron 2020-08-10 19:09:37 UTC
Red Hat Product Errata RHSA-2019:1222 0 None None None 2019-05-14 12:40:25 UTC

Description Stephen Wadeley 2019-02-26 09:19:49 UTC
Description of problem:

When trying to update a sync-plan created with interval set to custom cron, the command always fails with:

Could not update the sync plan:
  Cron expression is not valid!

Version-Release number of selected component (if applicable):

~]# hammer --version
hammer (0.15.1)


How reproducible:

I tried many different commands against sync-plan created in web UI and using hammer.


Steps to Reproduce:
1. ~]# hammer sync-plan create  --name BugTest --sync-date "2019/02/01" --enabled 1  --interval "custom cron" --cron-expression "1 2 3 4 5" --organization-id 1 
2. ~]# hammer sync-plan info --name BugTest --organization-id 1

3. ~]# hammer sync-plan update --name BugTest --organization-id 1 --description Hello
Could not update the sync plan:
  Cron expression is not valid!

4. ~]# hammer sync-plan update --name BugTest --organization-id 1 --description Hello --cron-expression "1 2 3 4 5"
Could not update the sync plan:
  Cron expression is not valid!


Actual results:

Could not update the sync plan

Expected results:

Could update the sync plan

Comment 4 Andrew Kofink 2019-02-26 14:04:27 UTC
This is definitely an issue in Katello. The following works just fine (with --interval _and_ --cron-expression):

hammer -d sync-plan update --id 3 --cron-expression "1 2 3 4 5" --interval "custom cron"

This logic in Katello isn't quite right https://github.com/Katello/katello/blob/master/app/models/katello/sync_plan.rb#L59. It only checks the params and not the currently set value (self.interval rather than params["interval"]). It looks like this is a regression starting in Katello 3.9 https://github.com/Katello/katello/commit/8ac17807def.

Comment 5 jcallaha 2019-03-08 16:58:10 UTC
This also breaks with valid cron

hammer sync-plan create  --name BugTest --sync-date "2019/02/01" --enabled 1  --interval "custom cron" --cron-expression "0 0 12 1 1 ? *" --organization-id 1
Could not create the sync plan:
  Cron expression is not valid!

Comment 6 Samir Jha 2019-03-08 21:26:19 UTC
Created redmine issue http://projects.theforeman.org/issues/26283 from this bug

Comment 7 Bryan Kearney 2019-03-14 18:04:41 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/26283 has been resolved.

Comment 12 errata-xmlrpc 2019-05-14 12:40:17 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2019:1222


Note You need to log in before you can comment on or make changes to this bug.