From 1a79f8208267985798e606a4f0ea93e284bc74a6 Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Wed, 6 Sep 2017 20:22:27 -0700 Subject: [PATCH] Also check new path when determining cli_command (#5082) --- certbot/cli.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/certbot/cli.py b/certbot/cli.py index fe80a8cdf..97954004b 100644 --- a/certbot/cli.py +++ b/certbot/cli.py @@ -49,8 +49,13 @@ if "CERTBOT_AUTO" in os.environ: # user saved the script under a different name LEAUTO = os.path.basename(os.environ["CERTBOT_AUTO"]) -fragment = os.path.join(".local", "share", "letsencrypt") -cli_command = LEAUTO if fragment in sys.argv[0] else "certbot" +old_path_fragment = os.path.join(".local", "share", "letsencrypt") +new_path_prefix = os.path.abspath(os.path.join(os.sep, "opt", + "eff.org", "certbot", "venv")) +if old_path_fragment in sys.argv[0] or sys.argv[0].startswith(new_path_prefix): + cli_command = LEAUTO +else: + cli_command = "certbot" # Argparse's help formatting has a lot of unhelpful peculiarities, so we want # to replace as much of it as we can...