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

Move supports :create to Openstack provider repo #613

Merged
merged 1 commit into from
Jul 7, 2020

Conversation

agrare
Copy link
Member

@agrare agrare commented Jul 6, 2020

Currently the supports :create/:delete features are enabled at the base Flavor model, however only Openstack implements these operations

Cross Repo Tests: ManageIQ/manageiq-cross_repo-tests#149
Dependent PR: ManageIQ/manageiq#20332

@@ -1,6 +1,11 @@
class ManageIQ::Providers::Openstack::CloudManager::Flavor < ::Flavor
include ManageIQ::Providers::Openstack::HelperMethods

supports :create
supports :delete do
unsupported_reason_add(:delete, _("The Flavor is not connected to an active Provider")) if ext_management_system.nil?
Copy link
Member

@chessbyte chessbyte Jul 6, 2020

Choose a reason for hiding this comment

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

shouldn't it be checking whether ext_management_system.nil? on :create as well? in fact, the original code in this file seems to have been checking only on :create and not on :delete

Copy link
Member Author

Choose a reason for hiding this comment

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

shouldn't it be checking whether ext_management_system.nil? on :create as well

There is no flavor instance to check on create since we're trying to create it. The supports feature blocks are only invoked on the instance level not the class level.

in fact, the original code in this file seems to have been checking only on :create and not on :delete

Yeah I don't think those validations make any sense (see ManageIQ/manageiq#20332 (comment)). We're validating that when we create a flavor that it has an EMS but it isn't created yet.

Copy link
Member Author

Choose a reason for hiding this comment

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

Going to simplify this for this bugfix and leave the validates_* methods and just move the supports * calls

Currently the supports :create/:delete features are enabled at the base
Flavor model, however only Openstack implements these operations
@agrare agrare force-pushed the move_supports_create_flavor branch from c4fe7e9 to cc98f90 Compare July 6, 2020 17:50
@miq-bot
Copy link
Member

miq-bot commented Jul 6, 2020

Checked commit agrare@cc98f90 with ruby 2.5.7, rubocop 0.69.0, haml-lint 0.28.0, and yamllint
1 file checked, 0 offenses detected
Everything looks fine. 🏆

@chessbyte chessbyte merged commit 78cdb0b into ManageIQ:master Jul 7, 2020
@agrare agrare deleted the move_supports_create_flavor branch July 7, 2020 16:27
simaishi pushed a commit that referenced this pull request Jul 7, 2020
Move supports :create to Openstack provider repo

(cherry picked from commit 78cdb0b)
@simaishi
Copy link
Contributor

simaishi commented Jul 7, 2020

Jansa backport details:

$ git log -1
commit c5b6c0ac22d25203c3d0969dd9e0e7cb90140661
Author: Oleg Barenboim <[email protected]>
Date:   Tue Jul 7 12:23:58 2020 -0400

    Merge pull request #613 from agrare/move_supports_create_flavor

    Move supports :create to Openstack provider repo

    (cherry picked from commit 78cdb0b1641dc1e1d3a19cfcd07cddbaed7bcf9e)

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.

4 participants