Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing reason constants #13919

Merged
merged 2 commits into from
Feb 14, 2017

Conversation

jrafanie
Copy link
Member

The first commit is just a refactoring/cleanup so I can add the fix and it's test in the second commit.

Fixes #13901 introduced in #13805

Fix Reason NameError using constants included in MiqServer
Due to module inclusion spaghetti, it's easier and less confusing
to reference the Reason constants consistently in the MiqServer class,
which is the ultimate destination for all of these modules.

https://bugzilla.redhat.com/show_bug.cgi?id=1395736

@durandom Please review

* remove any_instance_of since we have an instance of a server!  🎉
* use lets, remove some ivars

https://bugzilla.redhat.com/show_bug.cgi?id=1395736
Due to module inclusion spaghetti, it's easier and less confusing
to reference the Reason constants consistently in the MiqServer class,
which is the ultimate destination for all of these modules.

Fixes ManageIQ#13901 introduced in ManageIQ#13805

https://bugzilla.redhat.com/show_bug.cgi?id=1395736
@miq-bot
Copy link
Member

miq-bot commented Feb 14, 2017

Checked commits jrafanie/manageiq@6636853~...3ea55fa with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
3 files checked, 0 offenses detected
Everything looks good. 🍪

Copy link
Member

@durandom durandom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The monitor part looks good and works - tested here.

@chrisarcand merge?

@chrisarcand chrisarcand merged commit 89dfba8 into ManageIQ:master Feb 14, 2017
@chrisarcand chrisarcand added this to the Sprint 55 Ending Feb 27, 2017 milestone Feb 14, 2017
@chrisarcand chrisarcand self-assigned this Feb 14, 2017
@jrafanie jrafanie deleted the fix_missing_reason_contants branch February 14, 2017 19:12
@worker1 = FactoryGirl.create(:miq_worker, :miq_server_id => @miq_server.id, :memory_usage => 2.gigabytes, :pid => 42)
allow_any_instance_of(MiqServer).to receive(:get_time_threshold).and_return(2.minutes)
allow_any_instance_of(MiqServer).to receive(:get_memory_threshold).and_return(500.megabytes)
allow_any_instance_of(MiqServer).to receive(:get_restart_interval).and_return(0.hours)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not even a 👏 from @chrisarcand. 😢

I was so excited to be able to remove allow_any_instance_of. 😉

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha! Funny story is that I saw it, screamed with joy, and hit merge as I was headed out the door with no time to comment.

WOOOOO!!!!! 😱 ❤️ 😍 😘 💋 🎉 🎊 👏 💯 🏅

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha! Nice emoji variety. Funny story: I looked at those tests and couldn't understand why it was using allow_any_instance_of. I was shocked and overly excited when the tests still passed using the server instance we already had!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hit merge as I was headed out the door with no time to comment.

Drive-by merging...

@jrafanie jrafanie changed the title Fix missing reason contants Fix missing reason constants Feb 14, 2017
jrafanie pushed a commit to jrafanie/manageiq that referenced this pull request Feb 16, 2017
jrafanie pushed a commit to jrafanie/manageiq that referenced this pull request Feb 16, 2017
@jrafanie
Copy link
Member Author

Euwe backport: #13949
Darga backport: #13950

@simaishi
Copy link
Contributor

simaishi commented Mar 3, 2017

Backported to Euwe via #13949

@simaishi
Copy link
Contributor

Backported to Darga via #13950

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

uninitialized constant MiqServer::WorkerManagement::Monitor::Validation::Reason
5 participants