Bug 1375314

Summary: Move join region logic into a rake task
Product: Red Hat CloudForms Management Engine Reporter: John Prause <jprause>
Component: ReplicationAssignee: Nick Carboni <ncarboni>
Status: CLOSED CURRENTRELEASE QA Contact: Alex Newman <anewman>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 5.6.0CC: anewman, jhardy, ncarboni, obarenbo, simaishi
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.7.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1376163 (view as bug list) Environment:
Last Closed: 2017-01-11 19:55:23 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: 1376163    

Description John Prause 2016-09-12 17:17:25 UTC
This PR fixes #10409 (the first, trivial, commit) and refactors the code used to join a region so that it is testable and easier to understand.

Before this change, join_region.rb would always fail, but it was also called in a strange way in order to get the code to execute in the rails environment (Using AwesomeSpawn calling bin/rails runner join_region.rb).

Because it was a plain ruby script it was also not tested (nor easily testable).

This PR makes the join region logic a rake task which has its body implemented in evm_application.rb which can easily be tested.
This also simplifies the logic greatly as we can use ApplicationRecord directly to retrieve the region number from the database configured in database.yml at the time the rake task is called.

Comment 2 John Prause 2016-09-12 17:18:40 UTC
https://github.com/ManageIQ/manageiq/pull/10442

Comment 4 Alex Newman 2016-10-17 20:12:25 UTC

    Version 5.7.0.5-alpha2.20161014143521_cd366b6
    Server Name EVM
    User Name Administrator
    User Role EvmRole-super_administrator
    Browser Firefox
    Browser Version 45
    Browser OS Linux