Bug 2058243

Summary: pcs booth ticket add does not recognize mode option
Product: Red Hat Enterprise Linux 9 Reporter: Tomas Jelinek <tojeline>
Component: pcsAssignee: Tomas Jelinek <tojeline>
Status: CLOSED ERRATA QA Contact: cluster-qe <cluster-qe>
Severity: low Docs Contact: Steven J. Levine <slevine>
Priority: low    
Version: 9.0CC: cluster-maint, cluster-qe, idevat, jfriesse, jss, mlisik, mmazoure, mpospisi, nhostako, nwahl, omular, sbradley, slevine, svalasti, tojeline
Target Milestone: rcKeywords: EasyFix, Triaged
Target Release: 9.1Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: pcs-0.11.3-3.el9 Doc Type: Bug Fix
Doc Text:
.`pcs` now recognizes the `mode` option when creating a new Booth ticket Previously, when a user specified a `mode` option when adding a new Booth ticket, `pcs` reported the error `invalid booth ticket option 'mode'`. With this fix, you can now specify the `mode` option when creating a Booth ticket.
Story Points: ---
Clone Of: 1786964 Environment:
Last Closed: 2022-11-15 09:48:38 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:

Description Tomas Jelinek 2022-02-24 15:00:52 UTC
+++ This bug was initially created as a clone of Bug #1786964 +++

Description of problem:

`pcs booth ticket add` does not accept the mode option for tickets, which is described in the boothd(8) man page.

From man page:

       mode
           Specifies if the ticket is manual or automatic.

           By default all tickets are automatic (that is, they are fully controlled by Raft algorithm). Assign the strings "manual" or "MANUAL" to define the ticket as manually controlled.


Demo:

[root@fastvm-rhel-8-0-23 ~]# pcs booth ticket add test1 mode=auto
Error: invalid booth ticket option 'mode', allowed options are: acquire-after, attr-prereq, before-acquire-handler, expire, renewal-freq, retries, timeout, weights, use --force to override
[root@fastvm-rhel-8-0-23 ~]# pcs booth ticket add test1 mode=auto --force
Warning: invalid booth ticket option 'mode', allowed options are: acquire-after, attr-prereq, before-acquire-handler, expire, renewal-freq, retries, timeout, weights
[root@fastvm-rhel-8-0-23 ~]# cat /etc/booth/booth.conf
authfile = /etc/booth/booth.key
site = 192.168.22.71
site = 192.168.22.81
arbitrator = 192.168.22.52
ticket = "apacheticket2"
ticket = "apacheticket3"
ticket = "apacheticket"
ticket = "test1"
  mode = auto

-----

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

pcs-0.10.1-4.el8_0.4.x86_64
booth-core-1.0-5.f2d38ce.git.el8.x86_64

Also upstream master

-----

How reproducible:

Always

-----

Steps to Reproduce:

Use `pcs booth ticket add` to add a new ticket with the mode option set to either manual or auto.

-----

Actual results:

Error: invalid booth ticket option 'mode', allowed options are: acquire-after, attr-prereq, before-acquire-handler, expire, renewal-freq, retries, timeout, weights, use --force to override

-----

Expected results:

No error

Comment 1 Tomas Jelinek 2022-03-02 15:49:38 UTC
Upstream patch:
https://github.com/ClusterLabs/pcs/commit/83cb59f54b803138e176bf90b5310f8be287f775

See comment 0 for test / reproducer

Comment 3 Miroslav Lisik 2022-05-19 17:30:25 UTC
DevTestResults:

[root@r91-1 ~]# rpm -q pcs
pcs-0.11.2-1.el9.x86_64

[root@r91-1 ~]# pcs booth config
authfile = /etc/booth/booth.key
site = 127.0.0.1
site = 127.0.0.2
site = 127.0.0.3
[root@r91-1 ~]# pcs booth ticket add TicketB mode=mode
Error: booth ticket name 'TicketB' already exists in configuration
Error: 'mode' is not a valid mode value, use 'auto', 'manual', use --force to override
Error: Errors have occurred, therefore pcs is unable to continue
[root@r91-1 ~]# pcs booth ticket add TicketA mode=manual
[root@r91-1 ~]# pcs booth ticket add TicketB mode=auto
[root@r91-1 ~]# pcs booth config
authfile = /etc/booth/booth.key
site = 127.0.0.1
site = 127.0.0.2
site = 127.0.0.3
ticket = "TicketA"
  mode = manual
ticket = "TicketB"
  mode = auto

Comment 12 Tomas Jelinek 2022-07-19 11:12:44 UTC
Additional patch for making the mode value case insensitive, tests are included: https://github.com/ClusterLabs/pcs/commit/4b5bf253b0602548a1b3690e3c54623e06cffd76

Comment 14 Miroslav Lisik 2022-07-29 09:02:26 UTC
DevTestResults:

[root@r91-1 ~]# rpm -qa pcs booth*
booth-core-1.0-251.2.bfb2f92.git.el9.x86_64
booth-arbitrator-1.0-251.2.bfb2f92.git.el9.noarch
booth-site-1.0-251.2.bfb2f92.git.el9.noarch
booth-1.0-251.2.bfb2f92.git.el9.x86_64
pcs-0.11.3-3.el9.x86_64

[root@r91-1 ~]# pcs booth setup sites 127.0.0.{1..3}
[root@r91-1 ~]# pcs booth config
authfile = /etc/booth/booth.key
site = 127.0.0.1
site = 127.0.0.2
site = 127.0.0.3
[root@r91-1 ~]# pcs booth ticket add TicketA mode=MANUAL
[root@r91-1 ~]# pcs booth ticket add TicketB mode=AutO
[root@r91-1 ~]# pcs booth config
authfile = /etc/booth/booth.key
site = 127.0.0.1
site = 127.0.0.2
site = 127.0.0.3
ticket = "TicketA"
  mode = manual
ticket = "TicketB"
  mode = auto

Comment 21 errata-xmlrpc 2022-11-15 09:48:38 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 (Moderate: pcs security, bug fix, and enhancement update), 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://access.redhat.com/errata/RHSA-2022:7935