Bug 1388558 - attrd_updater -Q prints attribute error rather than usage error
Summary: attrd_updater -Q prints attribute error rather than usage error
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: pacemaker
Version: 6.8
Hardware: All
OS: All
medium
low
Target Milestone: rc
: 6.9
Assignee: Klaus Wenninger
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-25 16:09 UTC by Ken Gaillot
Modified: 2017-03-21 09:52 UTC (History)
4 users (show)

Fixed In Version: pacemaker-1.1.15-3.el6
Doc Type: No Doc Update
Doc Text:
undefined
Clone Of:
Environment:
Last Closed: 2017-03-21 09:52:33 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2017:0629 0 normal SHIPPED_LIVE pacemaker bug fix update 2017-03-21 12:29:32 UTC

Description Ken Gaillot 2016-10-25 16:09:35 UTC
Description of problem: The -Q option to attrd_updater is not supported when legacy attrd is in use, as it is in RHEL 6. Trying to use it should result in a command usage error, but instead it results in an attribute error, which is confusing to users.


Version-Release number of selected component (if applicable): 6.8 and earlier


How reproducible: trivially


Steps to Reproduce:
1. Configure and start a pacemaker cluster.
2. Set a node attribute on any node.
3. Run "attrd_updater -Q" for the node attribute and node.

Actual results: an attribute error message


Expected results: a command usage error message


Additional info:

Comment 1 Klaus Wenninger 2016-10-25 16:19:35 UTC
HAVE_ATOMIC_ATTRD is either 0 or 1 thus usage of #ifdef
in attrd_updater makes it behave as if it had atomic-attrd
but the messaging upon a query fails which makes it think
the attribute is not defined.

Fixed in
https://github.com/ClusterLabs/pacemaker/pull/1160/commits/a22b02ec46e9c7323489fef9f2680f2d0c078083

Comment 5 michal novacek 2017-01-12 11:34:42 UTC
I have verified that calling 'attrd_updater' with incorrect parameter shows
usage instead of reporting error with pacemaker-1.1.15-4

fixed version: pacemaker-1.1.15-4.el6.x86_64
--------------------------------------------
[root@virt-009 ~]# rpm -q pacemaker
pacemaker-1.1.15-4.el6.x86_64

[root@virt-009 ~]# pcs node attribute
Node Attributes:
 virt-009: a=a

[root@virt-009 ~]# attrd_updater -Q
attrd_updater: invalid option -- 'Q'
attrd_updater - Tool for updating cluster node attributes
Usage: attrd_updater command -n attribute [options]
Options:
 -?, --help             This text
 -$, --version          Version information
 -V, --verbose          Increase debug output

 -n, --name=value       The attribute's name

Commands:
 -U, --update=value     Update the attribute's value in attrd.  If this causes the value to change, it will also be updated in the cluster configuration
 -B, --update-both=value        Update the attribute's value and time to wait (dampening) in attrd. If this causes the value or dampening to change, the attribute will also be written to the cluster configuration, so be aware that repeatedly changing the dampening reduces its effectiveness.
 -D, --delete           Delete the attribute in attrd.  If a value was previously set, it will also be removed from the cluster configuration
 -R, --refresh          (Advanced) Force the attrd daemon to resend all current values to the CIB


Additional options:
 -d, --delay=value      The time to wait (dampening) in seconds for further changes before writing
 -s, --set=value        (Advanced) The attribute set in which to place the value
 -N, --node=value       Set the attribute for the named node (instead of the local one)
 -l, --lifetime=value   Lifetime of the node attribute.  Allowed values: forever, reboot

Report bugs to pacemaker.org

Comment 7 errata-xmlrpc 2017-03-21 09:52:33 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://rhn.redhat.com/errata/RHEA-2017-0629.html


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