Bug 1389533

Summary: [RFE] Disable sync plans automatically before upgrade
Product: Red Hat Satellite Reporter: sthirugn <sthirugn>
Component: Foreman MaintainAssignee: Anurag Patel <apatel>
Status: CLOSED CURRENTRELEASE QA Contact: Nikhil Kathole <nkathole>
Severity: high Docs Contact:
Priority: high    
Version: 6.2.0CC: bbuckingham, bkearney, inecas, kgaikwad, nkathole, oshtaier, szadok
Target Milestone: UnspecifiedKeywords: FutureFeature, PrioBumpField, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/17743
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-01-11 19:46:57 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:
Bug Depends On:    
Bug Blocks: 1459226    

Description sthirugn@redhat.com 2016-10-27 20:07:58 UTC
Description of problem:
[RFE] Disable sync plans automatically before upgrade

Version-Release number of selected component (if applicable):
satellite-6.2.3-1.0.el7sat.noarch

How reproducible:
Always

Steps to Reproduce:
1. Keeping the sync plans enabled during a lengthy upgrade process - creates sync plan tasks which errors or never completes.

Actual results:
Errored sync plan tasks.

Expected results:
[1] Upgrade process needs to automatically disable all the enabled sync plans.
[2] The disabled sync plans should be re-enabled at the end of the upgrade process

Additional info:

Comment 2 Shlomi Zadok 2016-12-19 17:02:47 UTC
Created redmine issue http://projects.theforeman.org/issues/17743 from this bug

Comment 8 Nikhil Kathole 2017-12-19 14:35:00 UTC
VERIFIED

# rpm -q rubygem-foreman_maintain
rubygem-foreman_maintain-0.1.1-1.el7sat.noarch

Running Procedures before migrating to Satellite 6.2.z
================================================================================
Turn on maintenance mode:                                             [OK]
--------------------------------------------------------------------------------
disable active sync plans:
| Total 2 sync plans are now disabled.                                [OK]
--------------------------------------------------------------------------------

D, [2017-12-19 09:28:07-0500 #99697] DEBUG -- : Running command su postgres -c 'cd ~; psql -d foreman' with stdin "COPY (        SELECT id FROM kat
ello_sync_plans WHERE enabled ='t'\n) TO STDOUT WITH CSV HEADER"
D, [2017-12-19 09:28:07-0500 #99697] DEBUG -- : output of the command:
 id
1
2
D, [2017-12-19 09:28:07-0500 #99697] DEBUG -- : Running command LANG=en_US.utf-8 hammer -c "/etc/foreman-maintain/foreman-maintain-hammer.yml" --in
teractive=no sync-plan update --id 1 --enabled false with stdin nil
D, [2017-12-19 09:28:08-0500 #99697] DEBUG -- : output of the command:
 Sync plan updated
D, [2017-12-19 09:28:08-0500 #99697] DEBUG -- : Running command LANG=en_US.utf-8 hammer -c "/etc/foreman-maintain/foreman-maintain-hammer.yml" --in
teractive=no sync-plan update --id 2 --enabled false with stdin nil
D, [2017-12-19 09:28:09-0500 #99697] DEBUG -- : output of the command:
 Sync plan updated


Running Procedures after migrating to Satellite 6.2.z
================================================================================
katello-service start:
| No katello service to start                                         [OK]
--------------------------------------------------------------------------------
Turn off maintenance mode:                                            [OK]
--------------------------------------------------------------------------------
re-enable sync plans:
- Total 2 sync plans are now enabled.                                 [OK]
--------------------------------------------------------------------------------

D, [2017-12-19 09:33:08-0500 #99697] DEBUG -- : Running command LANG=en_US.utf-8 hammer -c "/etc/foreman-maintain/foreman-maintain-hammer.yml" --in
teractive=no sync-plan update --id 1 --enabled true with stdin nil
D, [2017-12-19 09:33:12-0500 #99697] DEBUG -- : output of the command:
 Sync plan updated
D, [2017-12-19 09:33:12-0500 #99697] DEBUG -- : Running command LANG=en_US.utf-8 hammer -c "/etc/foreman-maintain/foreman-maintain-hammer.yml" --in
teractive=no sync-plan update --id 2 --enabled true with stdin nil
D, [2017-12-19 09:33:13-0500 #99697] DEBUG -- : output of the command:
 Sync plan updated

Comment 9 Bryan Kearney 2018-01-11 19:46:57 UTC
rubygem-foreman_maintain-0.1.1-1.el7sat.noarch has been released. Closing this out.