Bug 1933130
| Summary: | foreman-rake templates:sync task undocumented lock parameter change causes import failure | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | Red Hat Satellite | Reporter: | Jason Dickerson <jdickers> | ||||||||
| Component: | Templates Plugin | Assignee: | satellite6-bugs <satellite6-bugs> | ||||||||
| Status: | CLOSED WONTFIX | QA Contact: | Ondrej Gajdusek <ogajduse> | ||||||||
| Severity: | medium | Docs Contact: | |||||||||
| Priority: | unspecified | ||||||||||
| Version: | 6.8.0 | CC: | jdickers, jredman, mhulan | ||||||||
| Target Milestone: | Unspecified | Keywords: | Triaged | ||||||||
| Target Release: | Unused | ||||||||||
| Hardware: | x86_64 | ||||||||||
| OS: | Linux | ||||||||||
| Whiteboard: | |||||||||||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |||||||||
| Doc Text: | Story Points: | --- | |||||||||
| Clone Of: | Environment: | ||||||||||
| Last Closed: | 2022-10-28 18:04:20 UTC | Type: | Bug | ||||||||
| Regression: | --- | Mount Type: | --- | ||||||||
| Documentation: | --- | CRM: | |||||||||
| Verified Versions: | Category: | --- | |||||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||||
| Embargoed: | |||||||||||
| Attachments: |
|
||||||||||
There is also a hammer command: hammer import-templates --associate always --branch MYBRANCH --dirname /mydir --lock true --organization "Default Organization" --prefix "_DEBUG " --repo https://github.com/myrepo --verbose true This command still accepts the lock=true parameter. The reason we use the foreman-rake templates:sync vs the api endpoint, is for logging and debuging/troubleshooting purposes. The hammer command and api endpoint to not give details of the sync. So if there are errors, you really do not know what the error is or where it came from. I suspect that the proper way to handle this is to switch to: hammer import-templates --associate always --branch MYBRANCH --dirname /mydir --lock true --organization "Default Organization" --prefix "_DEBUG " --repo https://github.com/myrepo/mycode.git --verbose true There is also a hammer command: hammer import-templates --associate always --branch MYBRANCH --dirname /mydir --lock true --organization "Default Organization" --prefix "_DEBUG " --repo https://github.com/myrepo --verbose true This command still accepts the lock=true parameter. The rake task is not mentioned in documentation because it will be removed and CLI/API should be used instead. The new options for lock were added but API and CLI are backwards compatible, so they still accept true/false. Comment#2 mentions that there are not enough details about errors, does '--verbose true' help? Is there any information in particular that is missing in verbose mode? Created attachment 1766288 [details]
Hammer output when importing templates
Created attachment 1766289 [details]
Hammer output when importing changed templates
Created attachment 1766290 [details]
API output when importing templates
Created redmine issue https://projects.theforeman.org/issues/32207 from this bug Upon review of our valid but aging backlog the Satellite Team has concluded that this Bugzilla does not meet the criteria for a resolution in the near term, and are planning to close in a month. This message may be a repeat of a previous update and the bug is again being considered to be closed. If you have any concerns about this, please contact your Red Hat Account team. Thank you. Upon review of our valid but aging backlog the Satellite Team has concluded that this Bugzilla does not meet the criteria for a resolution in the near term, and are planning to close in a month. This message may be a repeat of a previous update and the bug is again being considered to be closed. If you have any concerns about this, please contact your Red Hat Account team. Thank you. Thank you for your interest in Red Hat Satellite. We have evaluated this request, and while we recognize that it is a valid request, we do not expect this to be implemented in the product in the foreseeable future. This is due to other priorities for the product, and not a reflection on the request itself. We are therefore closing this out as WONTFIX. If you have any concerns about this feel free to contact your Red Hat Account Team. Thank you. |
Description of problem: The following foreman-rake task no longer works after upgrade from 6.7.4 to 6.8.3: rake_task = [ '/usr/sbin/foreman-rake', 'templates:sync', 'repo=%s' %(repo), 'branch=%s' %(branch), 'verbose=true', 'dirname=%s' %(subdir), 'prefix=%s' %(prefix), 'associate=always', 'lock=true', '--trace', ] Version-Release number of selected component (if applicable): Satellite 6.8.3 How reproducible: Consistently Steps to Reproduce: 1. Configure TemplateSync plugin 2. Run the above foreman-rake task Actual results: {:name=>"TEMPLATE", :id=>nil, :changed=>false, :imported=>false, :additional_errors=>nil, :additional_info=>nil, :exception=> "ERF42-5723 [Foreman::Exception]: Unknown lock option type, expected one of [\"lock\", \"keep_lock_new\", \"keep\", \"unlock\"], got true", :validation_errors=>{}, :file=>"TEMPLATE.erb", :type=>nil, :diff=>nil}, Expected results: The template imports correctly Additional info: The only documentation I could find for this rake task is located at: https://www.rubydoc.info/gems/foreman_templates/Setting/TemplateSync#lock_types-class_method It seems the lock parameter used to accept: lock, keep_lock_new, keep, unlock, true, false, 0, 1 but now only accepts: lock, keep_lock_new, keep, unlock The Satellite documentation does not even reference this rake task but instead the templates/import api endpoint. The endpoint accepts: lock, keep_lock_new, keep, unlock, true, false, 0, 1 Also, the rake task does not show up in "foreman-rake -T" but rather in "foreman-rake -AT", as it is an uncommented task. Workaround: specify lock=lock in the foreman-rake task. rake_task = [ '/usr/sbin/foreman-rake', 'templates:sync', 'repo=%s' %(repo), 'branch=%s' %(branch), 'verbose=true', 'dirname=%s' %(subdir), 'prefix=%s' %(prefix), 'associate=always', 'lock=lock', '--trace', ] Questions: Is this foreman-rake templates:sync task to be deprecated? Should the documentation be updated? ie perhaps a deprecation warning? Should we be using the templates:import api endpoint instead?