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 StorageManagers Cross Linkers #14795

Merged
merged 1 commit into from
Apr 19, 2017

Conversation

jerryk55
Copy link
Member

@jerryk55 jerryk55 commented Apr 18, 2017

Fix Cinder and Swift Cross Linkers to make sure valid data is available before
processing. Cinder should have Volumes, Backups, or Snapshots. Swift must
have Object Storage.

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

@roliveri @hsong-rh @Fryguy please review. Merge when appropriate.

Steps for Testing/QA

Add an Openstack cloud provider that does not have any objects (for Swift) or volumes, backups, or snapshots (for Cinder). Do a refresh of the provider after adding it. The refresh should not result in the issue shown in the above Bugzilla.

Fix Cinder and Swift Cross Linkers to make sure valid data is available before
processing.  Cinder should have Volumes, Backups, or Snapshots.  Swift must
have Object Storage.

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

miq-bot commented Apr 18, 2017

Checked commit jerryk55@3c1c6b9 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
2 files checked, 0 offenses detected
Everything looks good. 🏆

Copy link
Member

@bdunne bdunne left a comment

Choose a reason for hiding this comment

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

It would be nice to deduplicate some of this logic, but that's for a followup PR.

@@ -5,6 +5,10 @@ def self.cross_link(ems, data)
_log.warn "Manager does not have a parent."
return
end
unless data
_log.warn "Manager does not have volumes, snapshots, or volume backups."
Copy link
Member

Choose a reason for hiding this comment

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

We usually require parenthesis around method arguments.

Copy link
Member Author

Choose a reason for hiding this comment

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

Just duplicating the previous code. Are you asking for me to go back and change existing code, or to have the new code be inconsistent with the old code?

@@ -5,6 +5,10 @@ def self.cross_link(ems, data)
_log.warn "Manager does not have a parent."
return
end
unless data
_log.warn "Manager does not have any object storage."
Copy link
Member

Choose a reason for hiding this comment

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

Same

Copy link
Member Author

Choose a reason for hiding this comment

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

Ditto.

Copy link
Member Author

Choose a reason for hiding this comment

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

And just for perspective, under manageiq/app/models - there are 1373 calls to log methods using "(" and 642 not using them. It is not consistent although there is a 2/1 ratio for.

Copy link
Member

Choose a reason for hiding this comment

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

That's why I made it just a comment, not request changes. We seem to be losing consistency on this one since the rubocop doesn't complain about it.

Copy link
Member

Choose a reason for hiding this comment

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

We seem to be losing consistency on this one since the rubocop doesn't complain about it.

This is troubling since it should be complaining.

Copy link
Member

Choose a reason for hiding this comment

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

@Fryguy See http://www.rubydoc.info/github/bbatsov/rubocop/Rubocop/Cop/Lint/RequireParentheses
They only seem concerned about having parenthesis if there is && or ||. 😢

Copy link
Member

@roliveri roliveri left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@roliveri roliveri assigned roliveri and unassigned Fryguy Apr 19, 2017
@roliveri roliveri merged commit 3cc89dc into ManageIQ:master Apr 19, 2017
@roliveri roliveri added this to the Sprint 59 Ending Apr 24, 2017 milestone Apr 19, 2017
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.

6 participants