From 9af6d141f54a575e6a9a21c00eac3c79bc11d64d Mon Sep 17 00:00:00 2001 From: Mark Fuller Date: Jan 19 2022 21:17:01 +0000 Subject: Update fedpkg/cli.py Change behavior on missing config file to create a new empty file instead of erroring out. Signed-off-by: Mark E. Fuller --- diff --git a/fedpkg/cli.py b/fedpkg/cli.py index 5ae7bf9..a17c5a2 100644 --- a/fedpkg/cli.py +++ b/fedpkg/cli.py @@ -21,6 +21,7 @@ import re import shutil import textwrap from datetime import datetime +from pathlib import Path import pkg_resources import six @@ -1415,8 +1416,9 @@ class fedpkgClient(cliClient): # Ensure that user config file exists. if not os.path.isfile(PATH): - self.log.error("ERROR: User config file not found at: {0}\n".format(PATH)) - return + print("User config file not found at: {0}\n".format(PATH)) + print("Creating new empty config file\n") + Path(PATH).touch(mode=644, exist_ok=False) # Check that the user passed a valid token if self._check_token(TOKEN, token_type):