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

Zones - Save NTP settings before assigning vars for edit #2720

Merged
merged 1 commit into from
Nov 20, 2017

Conversation

chrisarcand
Copy link
Member

@chrisarcand chrisarcand commented Nov 14, 2017

With the changes to NTP settings made in 97088de, calling #add_settings_for_resource calls a save and reload which sets the attributes assigned before the call to their original values, ignoring the assignments from the form.

Instead, pull NTP settings outside of zone_set_record_vars, which is supposed to be just setting vars, and save it beforehand.

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

@chrisarcand
Copy link
Member Author

@miq-bot assign @bdunne

Does this make the most sense or is there a better way do you think?

@miq-bot
Copy link
Member

miq-bot commented Nov 14, 2017

@chrisarcand 'bdunne' is an invalid assignee, ignoring...

@chrisarcand
Copy link
Member Author

@miq-bot Go home, you're drunk

@miq-bot
Copy link
Member

miq-bot commented Nov 14, 2017

@chrisarcand unrecognized command 'Go', ignoring...

Accepted commands are: add_label, assign, close_issue, move_issue, remove_label, rm_label, set_milestone

@@ -28,8 +28,10 @@ def zone_edit
javascript_flash(:spinner_off => true)
return
end
# zone = @zone.id.blank? ? Zone.new : Zone.find(@zone.id) # Get new or existing record

zone_save_ntp_server_settings(@zone)
Copy link
Member

Choose a reason for hiding this comment

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

I think we need this after the @zone.save to avoid the case where the zone does not yet have an id, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Aye, yeah, oops.

With the changes to NTP settings made in
ManageIQ@97088de,
calling #add_settings_for_resource calls a save and reload which sets
the attributes assigned before the call to their original values,
ignoring the assignments from the form.

Instead, pull NTP settings outside of zone_set_record_vars, which is
supposed to be just setting vars, and save the settings afterward.

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

miq-bot commented Nov 16, 2017

Checked commit chrisarcand@c6b835a with ruby 2.3.3, rubocop 0.47.1, haml-lint 0.20.0, and yamllint 1.10.0
1 file checked, 0 offenses detected
Everything looks fine. 👍

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.

👍 LGTM

@martinpovolny martinpovolny merged commit 018270b into ManageIQ:master Nov 20, 2017
@martinpovolny martinpovolny added this to the Sprint 74 Ending Nov 27, 2017 milestone Nov 20, 2017
simaishi pushed a commit that referenced this pull request Nov 21, 2017
Zones - Save NTP settings before assigning vars for edit
(cherry picked from commit 018270b)

https://bugzilla.redhat.com/show_bug.cgi?id=1509452
@simaishi
Copy link
Contributor

Gaprindashvili backport details:

$ git log -1
commit a73a8f16186a12dfd185d073a25e2fc7cb3d45b5
Author: Martin Povolny <mpovolny@redhat.com>
Date:   Mon Nov 20 23:29:06 2017 +0100

    Merge pull request #2720 from chrisarcand/bz-1509172
    
    Zones - Save NTP settings before assigning vars for edit
    (cherry picked from commit 018270bf188eae00877803a8028bf983f9c5e10a)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1509452

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