-
Notifications
You must be signed in to change notification settings - Fork 357
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
Use copy_params_if_present in cloud network/subnet and floating ip controllers #6139
Use copy_params_if_present in cloud network/subnet and floating ip controllers #6139
Conversation
@romanblanco What do you think about these changes? Thanks! :) |
43cf0fc
to
cd28fec
Compare
@@ -223,17 +223,12 @@ def form_params | |||
# Admin_state_Up is true by default | |||
params[:enabled] = false unless params[:enabled] | |||
|
|||
options[:name] = params[:name] if params[:name] | |||
options[:ems_id] = params[:ems_id] if params[:ems_id] | |||
copy_params_if_present(options, params, %i[name ems_id qos_policy_id provider_network_type provider_physical_network provider_segmentation_id]) | |||
options[:admin_state_up] = switch_to_bol(params[:enabled]) | |||
options[:shared] = switch_to_bol(params[:shared]) | |||
options[:external_facing] = switch_to_bol(params[:external_facing]) | |||
# TODO: uncomment once form contains this field | |||
# options[:port_security_enabled] = params[:port_security_enabled] if params[:port_security_enabled] |
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.
I feel like you can also remove the commented lines, as they are 3 years old now
Checked commit hstastna@cd28fec with ruby 2.4.6, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0 |
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.
LGTM 👍
Issue: #6105
We can use new
copy_params_if_present
method in many places in the code and to improve functionality (remove""
vsnil
issues and bad response ofAdd/Save
buttons), to simplify the code.Related PRs/changes:
#5815
d3c3878#diff-956e46b33fb5307990c4e1a4b5fd86ccR1267