--version-check default should be explicitly "off"

Bug #1069951 reported by Daniel Nichter
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
Fix Released
High
Brian Fraser

Bug Description

[12:30pm] Daniel: brian|lunch: i just noticed optional_value. it needs to be reverted. optional values are not something we want to do because it confuses the issue. there only 3 types of options: off unless specified (e.g. --version), negatable (on unless negated, e.g. --no-check-slave for --[no]check-slave), then options with values. an optional value crosses the line between the previous three and is not inline with the rest of the tools' options.

[12:30pm] Daniel: --version-check just needs to be type: string; default: https then docu possible values are https, and http

Related branches

Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

Here's a solution:

type: string

Possible values: auto, http, https, off*

Right now, with no default value, the feature is effectively off because if ( $o->get('version-check') ) will be false. But in the future we're going to change that default to either auto or https. Auto means "try https, if that fails, try http, else give up." Off means off, which will allow users to --version-check off when we set the default to auto or https.

* I thought of maybe "disable(d)" instead of "off", but "off" is a lot shorter; also "none" but that doesn't seem to make as much sense as "off".

Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

Maybe we should keep it simple and do default: off right now, else users may ask, "it's not off, so what is it?" default: off is crystal clear. Then we can still my $vc = $o->get('v-c') if ( $vc ne 'off' ) ...

Brian Fraser (fraserbn)
Changed in percona-toolkit:
status: Confirmed → In Progress
Brian Fraser (fraserbn)
Changed in percona-toolkit:
status: In Progress → Fix Committed
Brian Fraser (fraserbn)
Changed in percona-toolkit:
milestone: none → 2.1.6
Revision history for this message
Daniel Nichter (daniel-nichter) wrote : Re: --version-check default should be "off"

Changed bug title to make it a little more meaningful for users in the Changelog, i.e. that the default has changed, though the functionality has not changed. The real technical work here was reverting changes that introduced options with optional values, which is not something we want to do.

summary: - Revert optional_value attrib in OptionParser
+ --version-check default should be "off"
summary: - --version-check default should be "off"
+ --version-check default should be explicitly "off"
tags: added: version-check
Brian Fraser (fraserbn)
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-335

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.