Skip to content
This repository was archived by the owner on Jan 22, 2026. It is now read-only.

Commit 0fa08e5

Browse files
committed
virt-convert: Move logging earlier to catch option errors
1 parent 67dd993 commit 0fa08e5

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

virt-convert

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ def parse_args():
9393

9494

9595
(options, args) = opts.parse_args()
96+
97+
cli.setupLogging("virt-convert", options.debug)
98+
9699
if len(args) < 1:
97100
opts.error(_("You need to provide an input VM definition"))
98101
if len(args) > 2:
@@ -177,7 +180,6 @@ def cleanup(msg, options, vmdef, paths):
177180

178181
def main():
179182
options = parse_args()
180-
cli.setupLogging("virt-convert", options.debug)
181183

182184
inp = formats.parser_by_name(options.input_format)
183185
outp = formats.parser_by_name(options.output_format)

0 commit comments

Comments
 (0)