Katello/katello-cli — pull request #92 by bbuckingham (2013-09-18 13:43:13+00:00)
Title: 990476: system_group: improve behavior of [add|remove]_systems

This commit contains a few changes to improve the user behavior
when a user performs either the add_systems or remove_systems
command for a system_group. The intent is to better inform
the user of what actually happened as a result of the request.

The following are a few examples:

1. user adds 2 new systems to a group:

katello> system_group add_systems --org ACME_Corporation --name group1 --system_uuids "e9ee386f-b6f6-4177-b216-20d99461399b, 79e8671a-fc65-421d-9c68-2c7ef4f27cf5"
Successfully added systems [ e9ee386f-b6f6-4177-b216-20d99461399b, 79e8671a-fc65-421d-9c68-2c7ef4f27cf5 ] to system group [ group1 ].
katello>

2. user attempts to add systems, but one of them is invalid
Note: no change will be made to the group

katello> system_group add_systems --org ACME_Corporation --name group1 --system_uuids "e9ee386f-b6f6-4177-b216-20d99461399b, 79e8671a"
Could not find Systems [ 79e8671a ] in Org [ ACME_Corporation ]
katello>

3. user attempts to add systems, but one is already in the group

katello> system_group add_systems --org ACME_Corporation --name group1 --system_uuids "e9ee386f-b6f6-4177-b216-20d99461399b, 79e8671a-fc65-421d-9c68-2c7ef4f27cf5"
Successfully added systems [ e9ee386f-b6f6-4177-b216-20d99461399b ] to system group [ group1 ].
Note: Systems [ 79e8671a-fc65-421d-9c68-2c7ef4f27cf5 ] were already members of the system group; therefore, no changes were made for them.

4. user attempts to add systems, but all of them are already in the group

katello> system_group add_systems --org ACME_Corporation --name group1 --system_uuids "e9ee386f-b6f6-4177-b216-20d99461399b, 79e8671a-fc65-421d-9c68-2c7ef4f27cf5"
Systems [ e9ee386f-b6f6-4177-b216-20d99461399b, 79e8671a-fc65-421d-9c68-2c7ef4f27cf5 ] are already members of the system group; therefore, no changes were made to system group [ group1 ].
katello>

Similar behaviors exist for 'remove_systems'.