pt-slave-restart --config does not recognize '=' as separator

Bug #1635734 reported by Agustín
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
Fix Released
Low
Carlos Salguero

Bug Description

pt-slave-restart will show the following error if '=' is used between --config and the file:

$ pt-slave-restart --config=/tmp/pt-slave-restart.cnf
Unknown option: config
Usage: pt-slave-restart [OPTIONS] [DSN]
...

With no '=' it works as expected:

$ pt-slave-restart --config /tmp/pt-slave-restart.cnf
Cannot open /tmp/pt-slave-restart.cnf: No such file or directory

Adding quotes or single quotes to the file path does not help.

Also, the error is a bit cryptic, since config is a valid option.

Tags: i145494
Changed in percona-toolkit:
status: New → Confirmed
Changed in percona-toolkit:
importance: Undecided → Low
assignee: nobody → Carlos Salguero (carlos-salguero)
Revision history for this message
Carlos Salguero (carlos-salguero) wrote :

Since the error is in the option parser module, this error affects to all these tools:
        modified: bin/pt-align
        modified: bin/pt-archiver
        modified: bin/pt-config-diff
        modified: bin/pt-deadlock-logger
        modified: bin/pt-diskstats
        modified: bin/pt-duplicate-key-checker
        modified: bin/pt-fifo-split
        modified: bin/pt-find
        modified: bin/pt-fingerprint
        modified: bin/pt-fk-error-logger
        modified: bin/pt-heartbeat
        modified: bin/pt-index-usage
        modified: bin/pt-kill
        modified: bin/pt-online-schema-change
        modified: bin/pt-query-digest
        modified: bin/pt-show-grants
        modified: bin/pt-slave-delay
        modified: bin/pt-slave-find
        modified: bin/pt-slave-restart
        modified: bin/pt-table-checksum
        modified: bin/pt-table-sync
        modified: bin/pt-table-usage
        modified: bin/pt-upgrade
        modified: bin/pt-variable-advisor
        modified: bin/pt-visual-explain

Changed in percona-toolkit:
milestone: none → 2.2.20
status: Confirmed → In Progress
Revision history for this message
Agustín (agustin-gallego) wrote :

Here goes a working cnf file (just passing the DSN arguments on it):

$ cat ./pt-slave-restart.cnf
host=127.0.0.1
port=9981
user=root
password=msandbox

Then, the tool run as follows, works ok:

$ pt-slave-restart --config ./pt-slave-restart.cnf
2016-10-27T11:58:42 P=9981,h=127.0.0.1,p=...,u=root mysql-relay.000010 1362 1050

But not when `=` is added:

$ pt-slave-restart --config=./pt-slave-restart.cnf
Unknown option: config

Revision history for this message
Carlos Salguero (carlos-salguero) wrote :
Changed in percona-toolkit:
status: In Progress → Fix Committed
Changed in percona-toolkit:
status: Fix Committed → Fix Released
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PT-832

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.