From 6f1d685d9b101c52366a56067395054a2e7fe755 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Fri, 11 Sep 2020 12:51:34 +0200 Subject: [PATCH] plugin/builder: move argparse into main The argparse import is only needed when the plugin is used as a stand alone composer koji API client, therefore only include it in main(). --- plugins/builder/osbuild.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/builder/osbuild.py b/plugins/builder/osbuild.py index cef2004..50cf22f 100644 --- a/plugins/builder/osbuild.py +++ b/plugins/builder/osbuild.py @@ -309,8 +309,6 @@ class OSBuildImage(BaseTaskHandler): # Stand alone osbuild composer API client executable -import argparse - RESET = "\033[0m" GREEN = "\033[32m" BOLD = "\033[1m" @@ -361,6 +359,8 @@ def wait_cmd(client: Client, args): def main(): + import argparse # pylint: disable=import-outside-toplevel + parser = argparse.ArgumentParser(description="osbuild composer koji API client") parser.add_argument("--url", metavar="URL", type=str, default="http://localhost:8701/",