-
Notifications
You must be signed in to change notification settings - Fork 900
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
Supports feature attributes #23028
Supports feature attributes #23028
Conversation
@Fryguy and I discussed with the following thoughts: while we want to get away from these The majority of the use cases of these columns are in the query mechanism, but this case brings back this information to the front end. |
2efb732
to
33b8ad2
Compare
app/models/vm_or_template.rb
Outdated
@@ -200,6 +201,9 @@ class VmOrTemplate < ApplicationRecord | |||
delegate :connect_lans, :disconnect_lans, :to => :hardware, :allow_nil => true | |||
delegate :queue_name_for_ems_operations, :to => :ext_management_system, :allow_nil => true | |||
|
|||
supports_attribute :feature => :reconfigure_network_adapters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While here we might as well add the rest which I believe includes CPU memory and disk. @GilbertCherrie can give the details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kbrock the other 3 item_supports? features in ui-classic are:
:reconfigure_disks
:reconfigure_disksize
:reconfigure_cdroms
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there no check for CPU and memory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:allowCpuChange => role_allows?(:feature => 'vm_reconfigure_cpu'),
:allowDiskChange => role_allows?(:feature => 'vm_reconfigure_disks') && item_supports?(:reconfigure_disks),
:allowDiskSizeChange => item_supports?(:reconfigure_disksize),
:allowNetworkChange => item_supports?(:reconfigure_network_adapters) && role_allows?(:feature => 'vm_reconfigure_networks'),
:allowCdromsChange => item_supports?(:reconfigure_cdroms) && role_allows?(:feature => 'vm_reconfigure_drives'),
:isVmwareInfra => vm.vendor == 'vmware' && vm.type.include?('InfraManager'),
:isVmwareCloud => vm.vendor == 'vmware' && vm.type.include?('CloudManager'),
:isRedhat => vm.vendor == 'redhat',
@Fryguy This is the whole list. I'm not sure if the role_allows? features are the same as the item_supports? ones or not.
- add 2 supports attributes for vm infra reconfigure field form - convert a manually defined attribute to using the plugin
33b8ad2
to
82c37c4
Compare
update:
not able to reproduce local build failure |
Checked commits kbrock/manageiq@f9846b3~...82c37c4 with ruby 2.7.8, rubocop 1.56.3, haml-lint 0.51.0, and yamllint |
@GilbertCherrie @Fryguy any other methods you all want to add? The only other definitions I see: |
@Fryguy any other attributes to add before merging? |
added
supports_
columns so the API can determine if the vm supports reconfiguration.related to #22980
/cc @jeffibm FYI - for the reconfiguration API that is currently on hold