Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Step:15
salt
do-not-load-pip-state-if-there-is-no-3rd-party-...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File do-not-load-pip-state-if-there-is-no-3rd-party-depen.patch of Package salt
From e0b91c626c10b29d328fa92415393cd57bb4c962 Mon Sep 17 00:00:00 2001 From: Bo Maryniuk <bo@suse.de> Date: Fri, 21 Sep 2018 17:31:39 +0200 Subject: [PATCH] Do not load pip state if there is no 3rd party dependencies Safe import 3rd party dependency --- salt/modules/pip.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/salt/modules/pip.py b/salt/modules/pip.py index f68cafaeaf..14cfafed4b 100644 --- a/salt/modules/pip.py +++ b/salt/modules/pip.py @@ -96,6 +96,12 @@ import salt.utils.url import salt.utils.versions from salt.exceptions import CommandExecutionError, CommandNotFoundError +try: + import pkg_resources +except ImportError: + pkg_resources = None + + # This needs to be named logger so we don't shadow it in pip.install logger = logging.getLogger(__name__) # pylint: disable=invalid-name @@ -113,7 +119,12 @@ def __virtual__(): entire filesystem. If it's not installed in a conventional location, the user is required to provide the location of pip each time it is used. """ - return "pip" + if pkg_resources is None: + ret = False, 'Package dependency "pkg_resource" is missing' + else: + ret = "pip" + + return ret def _pip_bin_env(cwd, bin_env): -- 2.33.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor