Bug 1063839 - Deletion of system custom info which is not set is ignored silently
Summary: Deletion of system custom info which is not set is ignored silently
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: API
Version: 580
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Grant Gainey
QA Contact: Radovan Drazny
URL:
Whiteboard:
Depends On:
Blocks: sat580-low
TreeView+ depends on / blocked
 
Reported: 2014-02-11 13:52 UTC by Lukáš Hellebrandt
Modified: 2017-06-21 12:10 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-06-21 12:10:10 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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.


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