Bug 1063839

Summary: Deletion of system custom info which is not set is ignored silently
Product: Red Hat Satellite 5 Reporter: Lukáš Hellebrandt <lhellebr>
Component: APIAssignee: Grant Gainey <ggainey>
Status: CLOSED CURRENTRELEASE QA Contact: Radovan Drazny <rdrazny>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 580CC: ggainey, rdrazny, tlestach
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-06-21 12:10:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1358815    

Description Lukáš Hellebrandt 2014-02-11 13:52:23 UTC
Description of problem:
Deletion of system custom info which is not set is ignored silently. This is not mentioned in API help and brobably shouldn't be the case.

How reproducible:

Always. Have a system registered to the satellite and some custom info key defined. Remove a custom info value (of the existing key) that the system hasn't set.

client.system.deleteCustomValues(session, sysID, [keyLabel])

Actual results:
No exception is thrown

Expected results:
Exception should be thrown

Comment 1 Jiri Precechtel 2016-03-24 10:54:31 UTC
This is OK that attempt for delete of non-existing Custom Data Value (but of existing Custom System Information Key) doesn't raise error.
It is because this operation is mentioned as delete of all given keys values and such condition (not assigned/non-existing value) is already met in such case.
API help for the method was updated to inform about this behavior.

Description changed in Spacewalk master commit: e6bc2bbde0c4948f62190498b16c80629900e34a

If you don't agree, let me know please.

Comment 3 Grant Gainey 2016-11-03 18:41:04 UTC
Commit says "API doc updated, but the change failed to change @xmlrpc.doc - not really fixed.

Comment 4 Grant Gainey 2016-11-04 20:28:01 UTC
#c3 incorrect, doc shows up correctly (just in a mildly-unexpected place)

Comment 6 Radovan Drazny 2016-11-08 10:19:48 UTC
Verified on spacewalk-java-2.3.8-155.el6sat. 
Steps to reproduce:
  1. Create one or more custom info keys on a Sat 5.8 server.
  2 .Register a system to the server and assign a custom info value to this system.
  3. Try do delete existing custom info item from the system:

        rhn-custom-info -u <user> -p <pass> -d existing-key

     The key is deleted without any message.
  4. Run the same command one more time to attempt to delete non-existing value. No error message is returned.
  5. Try to delete non-existing custom info key 

        rhn-custom-info -u <user> -p <pass> -d non-existing-key

     There is a following message:

        Error code:  1000
        redstone.xmlrpc.XmlRpcFault: One or more of the following custom info keys was not defined: 
        non-existing-key
     Message explicitly mentions missing key, not value.