Bug 1429944 - In spacecmd, it should be clear whether I am referencing a system by its ID or its name
Summary: In spacecmd, it should be clear whether I am referencing a system by its ID o...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Server
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Tomáš Kašpárek
QA Contact: Pavel Studeník
URL:
Whiteboard:
Depends On:
Blocks: sat58-errata
TreeView+ depends on / blocked
 
Reported: 2017-03-07 14:42 UTC by Lukáš Hellebrandt
Modified: 2018-02-05 13:57 UTC (History)
3 users (show)

Fixed In Version: spacecmd-2.5.0-18-sat
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-05 13:57:18 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0274 0 normal SHIPPED_LIVE Red Hat Satellite 5.8.0 bug fix update 2018-02-09 23:18:15 UTC

Description Lukáš Hellebrandt 2017-03-07 14:42:05 UTC
Description of problem:
This is a follow-up of bug 1427905 .

After fixing the bug, when there is a system with the same name as other system's ID, the user is now asked to solve the problem by renaming or deleting a system and the command exits. No operations should now happen to the wrong system by accident.

However, this did not solve the problem of clearly specifying the system either by ID or by name: if there are some systems where these are the same, you are prevented from making unintended operations but you are also prevented from doing anything at all:

spacecmd {SSM:0}> system_list
1000010005 : 1000010006
1000010006 : 1000010005
spacecmd {SSM:0}> system_details 1000010005
WARNING: Duplicate system profile names found!
WARNING: Please reference systems by ID or resolve the
WARNING: underlying issue with 'system_delete' or 'system_rename'
WARNING: 
WARNING: 1000010005 = 1000010005, 1000010006
spacecmd {SSM:0}> system_delete 1000010005
WARNING: Duplicate system profile names found!
WARNING: Please reference systems by ID or resolve the
WARNING: underlying issue with 'system_delete' or 'system_rename'
WARNING: 
WARNING: 1000010005 = 1000010005, 1000010006
WARNING: No systems to delete
spacecmd {SSM:0}> system_delete search:id:1000010005
WARNING: Duplicate system profile names found!
WARNING: Please reference systems by ID or resolve the
WARNING: underlying issue with 'system_delete' or 'system_rename'
WARNING: 
WARNING: 1000010006 = 1000010006, 1000010005
WARNING: No systems to delete

There is no way whatsoever of doing anything with these systems, even if merely deleting them.

This could be solved by:

1) Either being able to specify which I am using - ID or name. E.g.:
system_details --id 1000010005

2) "search:" queries returning a set of system IDs and other commands taking their results directly (not evaluating them again). Now I suppose it goes like this: "search:id:1000010005" -> 1000010006 -> [result of search being used by the call] -> "Systems with name or ID 1000010006" -> Two possible systems again! 


Also, possibility of using system ID is still not documented in commands' help.

Comment 1 Tomáš Kašpárek 2017-08-22 09:08:25 UTC
system ID takes precedence over system name as it's unique
spacewalk.git(master): 6d4f495564cbdf5489daf76f60b6c6bbb74af2af

Comment 4 Pavel Studeník 2018-01-12 15:19:43 UTC
Description is strange, but I think that problem can be following scenario:

1) register 2 system with same name "client-rhel7"
2) system_list
client-rhel7 : 1000010005
client-rhel7 : 1000010006

3) system_delete search:id:1000010005
WARNING: Duplicate system profile names found!
WARNING: Please reference systems by ID or resolve the
WARNING: underlying issue with 'system_delete' or 'system_rename'
WARNING: 
WARNING: client = 1000010005, 1000010006
WARNING: No systems to delete

4) And:
>> system_delete search:name:client
WARNING: Duplicate system profile names found!
WARNING: Please reference systems by ID or resolve the
WARNING: underlying issue with 'system_delete' or 'system_rename'
WARNING: 
WARNING: client = 1000010005, 1000010006
Profile                   System ID
------------------------  ---------
client_01/12/18-09-37-10  1000010004
client_01/12/18-09-36-41  1000010003
client_01/10/18-11-04-31  1000010002

Comment 5 Tomáš Kašpárek 2018-01-16 09:24:36 UTC
spacewalk.git(master): fccb47f09697421373f2ee3371573cf2ed44d4c9

Comment 8 Pavel Studeník 2018-01-18 13:58:01 UTC
Verified with spacecmd-2.5.0-18.el6sat.noarch

Comment 11 errata-xmlrpc 2018-02-05 13:57:18 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:0274


Note You need to log in before you can comment on or make changes to this bug.