Skip to content

Commit

Permalink
Merge branch 'bug_19187/detection_of_dependencies_for_plugin_can_fail…
Browse files Browse the repository at this point in the history
…_if_the_python_lib_of_another_distrib_is_present_pr' into branches/rudder/6.1
  • Loading branch information
Jenkins CI committed Apr 28, 2021
2 parents a76fd98 + 9111171 commit dd94d79
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions relay/sources/rudder-pkg/lib/rudder-pkg/rudderPkgUtils.py
Expand Up @@ -307,6 +307,9 @@ def rpkg_metadata(package_file):
return json.loads(output)

def install_dependencies(metadata):
dependencyToCheck = False
packageManagerQueried = False

# not supported yet
has_depends = False
depends_printed = False
Expand All @@ -318,8 +321,6 @@ def install_dependencies(metadata):
logger.warning("The binary " + executable + " was not found on the system, you must install it before installing " + metadata['name'])
return False
else:
dependencyToCheck = False
packageManagerQueried = False
try:
if system == "rpm":
dependencyToCheck = True
Expand All @@ -346,14 +347,15 @@ def install_dependencies(metadata):
except Exception:
logger.error("Could not query rpm or apt package repository to check dependencies for this plugin.")

# dependency check failed
if dependencyToCheck and not packageManagerQueried:
logger.warning("Neither rpm nor apt could be queried successfully - cannot check the dependencies for this plugin.")

if not depends_printed:
logger.info("This package depends on the following")
depends_printed = True
logger.info(" on " + system + " : " + ", ".join(metadata["depends"][system]))

# dependency check failed
if dependencyToCheck and not packageManagerQueried:
logger.warning("Neither rpm nor apt could be queried successfully - cannot check the dependencies for this plugin.")

if has_depends:
logger.info("It is up to you to make sure those dependencies are installed")
return True
Expand Down

0 comments on commit dd94d79

Please sign in to comment.