mirror of
https://github.com/certbot/certbot.git
synced 2026-06-06 15:22:38 -04:00
Merge pull request #197 from ThomasWaldmann/help-no-sudo
check late for root, so letsencrypt --help also works without being root
This commit is contained in:
commit
248407c70e
1 changed files with 7 additions and 5 deletions
|
|
@ -19,11 +19,6 @@ from letsencrypt.client.apache import configurator
|
|||
|
||||
def main(): # pylint: disable=too-many-statements
|
||||
"""Command line argument parsing and main script execution."""
|
||||
if not os.geteuid() == 0:
|
||||
sys.exit(
|
||||
"{0}Root is required to run letsencrypt. Please use sudo.{0}"
|
||||
.format(os.linesep))
|
||||
|
||||
parser = argparse.ArgumentParser(
|
||||
description="An ACME client that can update Apache configurations.")
|
||||
|
||||
|
|
@ -63,8 +58,15 @@ def main(): # pylint: disable=too-many-statements
|
|||
parser.add_argument("--test", dest="test", action="store_true",
|
||||
help="Run in test mode.")
|
||||
|
||||
# note: arg parser internally handles --help (and exits afterwards)
|
||||
args = parser.parse_args()
|
||||
|
||||
# note: check is done after arg parsing as --help should work w/o root also.
|
||||
if not os.geteuid() == 0:
|
||||
sys.exit(
|
||||
"{0}Root is required to run letsencrypt. Please use sudo.{0}"
|
||||
.format(os.linesep))
|
||||
|
||||
# Set up logging
|
||||
logger = logging.getLogger()
|
||||
logger.setLevel(logging.INFO)
|
||||
|
|
|
|||
Loading…
Reference in a new issue