Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/plugins/python/reporter_bugzilla.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,11 @@ def log_out(bug_info, rhbz, dump_dir_name):
"\n -D, --debug[STR] Debug\n"
)

dump_dir_name = os.getcwd()
try:
dump_dir_name = os.getcwd()
except FileNotFoundError:
# delay handling till after opts are parsed
dump_dir_name = None
conf_files = []
fmt_file = os.path.join(const.CONF_DIR, 'plugins/bugzilla_format.conf')
fmt_file2 = fmt_file
Expand Down Expand Up @@ -438,6 +442,14 @@ def log_out(bug_info, rhbz, dump_dir_name):
elif opt in ('-D', '--debug'):
debug = True

# If os.getcwd didn't work and -d was not set, this will still be
# None and we need to bail now
if not dump_dir_name:
sys.exit(
"Current working directory does not exist and -d not passed, cannot determine "
"dump location"
)

g_verbose = min(g_verbose, 2)
logger_init(logger, ['WARNING', 'INFO', 'DEBUG'][g_verbose])

Expand Down