Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1063808 - Custom info with empty value can be added to system
Summary: Custom info with empty value can be added to system
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: API
Version: 560
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Tomas Lestach
QA Contact: Lukáš Hellebrandt
Depends On:
Blocks: sat570-lowbug
TreeView+ depends on / blocked
Reported: 2014-02-11 13:21 UTC by Lukáš Hellebrandt
Modified: 2015-01-13 09:55 UTC (History)
2 users (show)

Fixed In Version: rhn-custom-info-5.4.22-1 spacewalk-java-2.3.8-9
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2015-01-13 09:55:02 UTC
Target Upstream Version:

Attachments (Terms of Use)
Patch for the rhn-custom-info python part (deleted)
2014-02-13 20:10 UTC, Dimitar Yordanov
no flags Details | Diff
Patch - java part (deleted)
2014-02-14 12:12 UTC, Dimitar Yordanov
no flags Details | Diff

Description Lukáš Hellebrandt 2014-02-11 13:21:52 UTC
Description of problem:
Custom info with empty value can be added to system using the rhn-custom-info tool or API. This is not possible in webUI

How reproducible:

Always. Have a system registered to satellite with the provisioning entitlement and an existing custom info key.
Set the key's value to empty via API or the rhn-custom-info tool.

./ <hostname> <user> <password> setCustomValue keyLabel ''
rhn-custom-info -u <user> -p <password> -s http://<hostname>/rpc/api keyLabel ''

Actual results:
The empty value is set to system

Expected results:
This shouldn't be possible

Additional info:
Test RHN-Tools/rhn-custom-info (currently workaround)

Comment 1 Lukáš Hellebrandt 2014-02-11 13:55:34 UTC
Ad test-rhn-custom-info:

client.system.setCustomValues(session, sysID, {keyLabel: ''})

Comment 2 Dimitar Yordanov 2014-02-13 20:10:19 UTC
Created attachment 862957 [details]
Patch for the rhn-custom-info python part

Comment 3 Tomas Lestach 2014-02-14 10:34:09 UTC
Dimitar, thank you for the patch, I committed it as ...

spacewalk.git: 1d893694cebf56245ac0034fb41c6addff1e888f

Leaving the BZ in NEW state, as only part of the fix is available.

Comment 4 Dimitar Yordanov 2014-02-14 12:12:37 UTC
Created attachment 863243 [details]
Patch - java part

Comment 5 Tomas Lestach 2014-08-14 14:31:06 UTC
Dimitar, could you make a pull request, please?
The patch looks good, there's just no need to call "toString()" method since the StringUtils.trim() already return a string.

Comment 6 Dimitar Yordanov 2014-08-15 11:02:50 UTC
Hi Tomas,
  Thanks for taking a look.
  I have created the following PR:


Comment 7 Tomas Lestach 2014-08-25 15:01:00 UTC
PR request applied, then you!

spacewalk.git: 3517961217bafb51cd55ca7a6cf7ff266e16f731

Comment 9 Lukáš Hellebrandt 2014-12-19 11:06:18 UTC

An attempt to set an empty value now fails with "Not valid value is provided for key/value pairs" error.

Comment 10 Clifford Perry 2015-01-13 09:55:02 UTC
With the release of Red Hat Satellite 5.7 on January 12th 2015 this bug is
being moved to a Closed Current Release state. 

The Satellite 5.7 GA Errata:

Satellite 5.7 Release Notes:

Satellite Customer Portal Blog announcement for release:


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