Bug 1657260

Summary: Set Ownership over multiple items resets user/group
Product: Red Hat CloudForms Management Engine Reporter: Martin Hradil <mhradil>
Component: UI - OPSAssignee: Martin Hradil <mhradil>
Status: CLOSED CURRENTRELEASE QA Contact: Antonin Pagac <apagac>
Severity: high Docs Contact: Red Hat CloudForms Documentation <cloudforms-docs>
Priority: high    
Version: 5.9.5CC: apagac, bmidwood, dmetzger, hkataria, lavenel, mpovolny, obarenbo, simaishi
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.10.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.10.0.29 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1657939 (view as bug list) Environment:
Last Closed: 2019-02-12 16:50:27 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1657939    

Description Martin Hradil 2018-12-07 14:24:40 UTC
Description of problem:

When using Set Ownerships to change the owner user *or* group (not both) of multiple items, the other setting is reset to "none".


Version-Release number of selected component (if applicable):



How reproducible:

always


Steps to Reproduce:
1. Go to Compute > Infrastructure > Virtual Machines
2. make sure you have 2 VMs with different users and groups assigned as owners
3. Select 2+ machines, Configuration > Set Ownership
4. set User to "Don't change"
5. set Group to a specific group
6. save


Actual results:

Both items get set to the specific group,
both items' user is reset to nobody.


Expected results:

Both items get set to the specific group,
both items' user is unchanged.


Additional info:

This also works the other way around ... setting a user resets group, setting a group resets the user.


Present in gaprindashvili, hammer and master.

Comment 3 CFME Bot 2018-12-10 08:57:29 UTC
New commit detected on ManageIQ/manageiq-ui-classic/master:

https://github.com/ManageIQ/manageiq-ui-classic/commit/3d8c0ef5f855e9da9bed443327f4198f162cf289
commit 3d8c0ef5f855e9da9bed443327f4198f162cf289
Author:     Martin Hradil <mhradil>
AuthorDate: Fri Dec  7 09:02:14 2018 -0500
Commit:     Martin Hradil <mhradil>
CommitDate: Fri Dec  7 09:02:14 2018 -0500

    Fix multi-target Set Ownership

    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

 app/controllers/mixins/actions/vm_actions/ownership.rb | 13 +-
 1 file changed, 7 insertions(+), 6 deletions(-)

Comment 5 CFME Bot 2018-12-10 21:22:14 UTC
New commit detected on ManageIQ/manageiq-ui-classic/hammer:

https://github.com/ManageIQ/manageiq-ui-classic/commit/848e3294fd46bd4d5907900d250e5a8308578d05
commit 848e3294fd46bd4d5907900d250e5a8308578d05
Author:     Milan Zázrivec <mzazrivec>
AuthorDate: Mon Dec 10 03:51:49 2018 -0500
Commit:     Milan Zázrivec <mzazrivec>
CommitDate: Mon Dec 10 03:51:49 2018 -0500

    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

 app/controllers/mixins/actions/vm_actions/ownership.rb | 13 +-
 spec/controllers/vm_infra_controller_spec.rb | 14 +
 2 files changed, 21 insertions(+), 6 deletions(-)

Comment 6 Antonin Pagac 2019-01-08 13:26:19 UTC
Verified with 5.10.0.30.

Setting group ownership for multiple items now leaves the user ownership untouched and vice-versa.