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 multi-target Set Ownership #5064

Merged
merged 2 commits into from
Dec 10, 2018
Merged

Fix multi-target Set Ownership #5064

merged 2 commits into from
Dec 10, 2018

Conversation

himdel
Copy link
Contributor

@himdel himdel commented Dec 7, 2018

Since #1578, when doing Set Ownership over multiple items:

  • set user to a User, set group to dont-change
    ... user gets set to User, and group gets reset to nil

  • set group to a Group, set user to dont-change
    ... group gets set to Group, and user gets reset to nil

This makes sure we don't reset groups or users unless asked to.

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


The difference is that...

Vm.set_ownership([123], {:user => (User)} only changes user,
but Vm.set_ownership([123], {:user => (User), :group => nil} updates both.

@himdel
Copy link
Contributor Author

himdel commented Dec 7, 2018

Aaand added a spec:

(fails without the fix:

         expected: ([71000000000176], {:group=>nil})
              got: ([71000000000176], {:owner=>nil, :group=>nil})

)

Since #1578, when doing Set Ownership over multiple items:

* set user to a User, set group to dont-change
... user gets set to User, and group gets reset to nil

* set group to a Group, set user to dont-change
... group gets set to Group, and user gets reset to nil

This makes sure we don't reset groups or users unless asked to.

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

miq-bot commented Dec 7, 2018

Checked commits https://github.com/himdel/manageiq-ui-classic/compare/b5c08fde841963ee07b663c1b071f99ee1cb1b0d~...3d8c0ef5f855e9da9bed443327f4198f162cf289 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 4 offenses detected

spec/controllers/vm_infra_controller_spec.rb

@himdel
Copy link
Contributor Author

himdel commented Dec 7, 2018

(specs should go green after #5065)

@himdel himdel closed this Dec 7, 2018
@himdel himdel reopened this Dec 7, 2018
@Hyperkid123
Copy link
Contributor

Tested in UI. Fixes the issue.

@mzazrivec mzazrivec self-assigned this Dec 10, 2018
@mzazrivec mzazrivec added this to the Sprint 101 Ending Dec 17, 2018 milestone Dec 10, 2018
@mzazrivec mzazrivec merged commit 91bacce into ManageIQ:master Dec 10, 2018
@himdel himdel deleted the ownership branch December 10, 2018 13:26
simaishi pushed a commit that referenced this pull request Dec 10, 2018
Fix multi-target Set Ownership

(cherry picked from commit 91bacce)

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

Hammer backport details:

$ git log -1
commit 848e3294fd46bd4d5907900d250e5a8308578d05
Author: Milan Zázrivec <mzazrivec@redhat.com>
Date:   Mon Dec 10 09:51:49 2018 +0100

    Merge pull request #5064 from himdel/ownership
    
    Fix multi-target Set Ownership
    
    (cherry picked from commit 91bacce0abaad57424741dcff4653133e2f0b352)
    
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1657260

simaishi pushed a commit that referenced this pull request Dec 14, 2018
Fix multi-target Set Ownership

(cherry picked from commit 91bacce)

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

Gaprindashvili backport details:

$ git log -1
commit 3239ca073c8d13bcf707215adb0393078198a2f5
Author: Milan Zázrivec <mzazrivec@redhat.com>
Date:   Mon Dec 10 09:51:49 2018 +0100

    Merge pull request #5064 from himdel/ownership
    
    Fix multi-target Set Ownership
    
    (cherry picked from commit 91bacce0abaad57424741dcff4653133e2f0b352)
    
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1657939

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.

5 participants