relinker command line will not accept workers=auto

Bug #1926757 reported by Alistair Coles
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Fix Released
Undecided
Unassigned

Bug Description

The relinker command line parsing requires workers to be an int value, but the conf file is allowed to have 'auto'. This means that the command line cannot override an integer value int the conf file with 'auto'.

vagrant@saio:~/swift$ swift-object-relinker --workers auto
usage: swift-object-relinker [-h] [--swift-dir SWIFT_DIR] [--policy POLICIES]
                             [--devices DEVICES] [--user USER]
                             [--device DEVICE_LIST] [--partition PARTITIONS]
                             [--skip-mount-check]
                             [--files-per-second FILES_PER_SECOND]
                             [--workers WORKERS] [--logfile LOGFILE] [--debug]
                             [--link-check-limit LINK_CHECK_LIMIT]
                             {relink,cleanup} [conf_file]
swift-object-relinker: error: argument --workers: invalid non_negative_int value: 'auto'

clayg (clay-gerrard)
Changed in swift:
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to swift (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/swift/+/790200

Changed in swift:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to swift (master)

Reviewed: https://review.opendev.org/c/openstack/swift/+/790200
Committed: https://opendev.org/openstack/swift/commit/f140de75e4e63ae0d101a2903a737e5727e7d794
Submitter: "Zuul (22348)"
Branch: master

commit f140de75e4e63ae0d101a2903a737e5727e7d794
Author: Matthew Oliver <email address hidden>
Date: Fri May 7 12:11:25 2021 +1000

    relinker: let --workers accept auto

    Currently from the relinker cli we allow a --workers parameter but it
    currently _must_ be an int. However, if someone wants to override a
    static int worker value from the config back to the 'auto' this results
    in a VALUE error.

    This patch changes the argparse type check for the worker param to use
    config_auto_int_value, via a small shim, so a value of 'auto' will be
    accepted.

    Closes-Bug: #1926757
    Change-Id: I5691bf644ade9fd7f7490f91add388a1d5a4aaa2

Changed in swift:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/swift 2.28.0

This issue was fixed in the openstack/swift 2.28.0 release.

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.