From 1fbe4bb31a9781ac1cfc89203bc1c35a958b1461 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Tue, 8 Jun 2021 08:54:46 +0200 Subject: [PATCH] runners/rhel82: extract code into main function Move the code in `__main__` to a `main` function to not pollute the global namespace. --- runners/org.osbuild.rhel82 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/runners/org.osbuild.rhel82 b/runners/org.osbuild.rhel82 index 81054b1b..4d823d8d 100755 --- a/runners/org.osbuild.rhel82 +++ b/runners/org.osbuild.rhel82 @@ -49,7 +49,7 @@ def python_alternatives(): pass -if __name__ == "__main__": +def main(): with osbuild.api.exception_handler(): ldconfig() sysusers() @@ -59,3 +59,7 @@ if __name__ == "__main__": r = subprocess.run(sys.argv[1:], check=False) sys.exit(r.returncode) + + +if __name__ == "__main__": + main()