Description of problem: In spacecmd commands that allow you to specify a system by its ID, you hit a problem when system A's NAME is same as system B's ID. In that case, you specify system A by its name and you actually get system B, because the number gets evaluated as ID. Example: # system_lock 1000010053 # system_details 1000010053 Name: SystemName System ID: 1000010053 Locked: True # system_unlock 1000010053 This would be fine if ID was the ONLY way to specify the system, but you can also use NAME in this call and this becomes ambiguous if you have a system named "1000010053". Using "search:name:1000010053" does not help either. How reproducible: Deterministic Steps to Reproduce: 1. Have two systems: one with some name and another with name equal to the first system's ID 2. Try to use some call on the second system using its name 3. Observe a call was actually used on the first system Actual results: Ambiguos system selection Expected results: There should be clear difference between specifying a system by its ID and its name
Furthermore, I do not see possibility of using ID documented anywhere: <SYSTEMS> can be any of the following: name ssm (see 'help ssm') search:QUERY (see 'help system_search') group:GROUP channel:CHANNEL
Closing this BZ as duplicate of 1427938 as 1427938 is clearly a subset of this one. *** This bug has been marked as a duplicate of bug 1427938 ***
Of course I meant this one is subset of 1427938.
Reopening as this is really a subset of bz#1427938 a bit but there's something more happening inside of this bug.
spacewalk.git(master): 8f29dfc3896a12657adcab913a066c07de20371a
After consulting with tkasparek, I am verifying this and making a follow-up 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.