From 9a6d7a0723d6a944000096277eb16c40225c9755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Thu, 20 Jun 2024 11:44:47 +0200 Subject: [PATCH] Audit: Move poetry --version to the right place --- github_app_geo_project/module/audit/utils.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/github_app_geo_project/module/audit/utils.py b/github_app_geo_project/module/audit/utils.py index da3e7914d11..d4e24867f3e 100644 --- a/github_app_geo_project/module/audit/utils.py +++ b/github_app_geo_project/module/audit/utils.py @@ -423,6 +423,15 @@ async def _snyk_fix( ) message.title = f"Unable to fix {len(fixable_vulnerabilities)} vulnerabilities" _LOGGER.error(message) + + await module_utils.run_timeout( + ["poetry", "--version"], + os.environ.copy(), + 10, + "Poetry version", + "Error while getting the Poetry version", + "Timeout while getting the Poetry version", + ) return snyk_fix_success, snyk_fix_message @@ -447,15 +456,6 @@ async def _npm_audit_fix( ) if message is not None: result.append(message) - if not success: - await module_utils.run_timeout( - ["poetry", "--version"], - os.environ.copy(), - 10, - "Poetry version", - "Error while getting the Poetry version", - "Timeout while getting the Poetry version", - ) _LOGGER.debug("Fixing version in %s", package_lock_file_name) # Remove the add '~' in the version in the package.json with open(os.path.join(directory, "package.json"), encoding="utf-8") as package_file: