Skip to content

HelpfulArgumentParser not parsing arguments the same way when detect_defaults=True #6164

@sTywin

Description

@sTywin

Hi folks,

I am trying to write an installer plugin. I need an optional argument (parameter) from the user that has one or more values (i.e. nargs='+'). In the config namespace passed to my plugin's __init__, I can see the parameter I specify, and it works as expected:

  • When not specified, the config value is None
  • When specified with no values, I get an error "expected at least one argument"
  • When specified with a single value, the config is ["value0"]
  • When specified with e.g. 2 values, the config is ["value0","value1"]

These are all the correct behavior that I would expect from argparse.

However, if I combine this with the --dns-route53 authenticator plugin, I run into some problems. The config my plugin get when certbot starts up is still correct in all cases, the dns-route53 authenticator runs successfully, but then in the last case above (multiple values), I am getting certbot: error: unrecognized arguments: value1 (along with a usage printout) before my plugin is run, and then certbot quits.

If the dns-route53 authenticator is skipped (i.e. because an existing certificate is found), then my installer plugin is executed correctly.

Suggestions? I'm not really set up for other authentication methods so I haven't been able to try those.

macOS 10.13.5
Python 3.6.5
certbot==0.25.1
certbot-dns-route53==0.25.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions