Bug 1375314 - Move join region logic into a rake task
Summary: Move join region logic into a rake task
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Replication
Version: 5.6.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: GA
: 5.7.0
Assignee: Nick Carboni
QA Contact: Alex Newman
URL:
Whiteboard:
Depends On:
Blocks: 1376163
TreeView+ depends on / blocked
 
Reported: 2016-09-12 17:17 UTC by John Prause
Modified: 2018-01-19 21:23 UTC (History)
5 users (show)

Fixed In Version: 5.7.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1376163 (view as bug list)
Environment:
Last Closed: 2017-01-11 19:55:23 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:


Attachments (Terms of Use)

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


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