From c988d2de3f17a453b32b0b6909b7a12a6b6b272d Mon Sep 17 00:00:00 2001 From: Bo Maryniuk Date: Thu, 15 Mar 2018 13:32:51 +0100 Subject: [PATCH] Implement get namespaces inclusion to the salt-call script on the client machine --- salt/utils/thin.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/salt/utils/thin.py b/salt/utils/thin.py index 495fb85ec5..7aa5606189 100644 --- a/salt/utils/thin.py +++ b/salt/utils/thin.py @@ -192,6 +192,29 @@ def get_ext_tops(config): return alternatives +def _get_ext_namespaces(config): + ''' + Get namespaces from the existing configuration. + + :param config: + :return: + ''' + namespaces = {} + if not config: + return namespaces + + for ext_version in config: + for ns in ext_version: + constraint_version = tuple(ext_version[ns].get('py-version', [])) + if not constraint_version: + raise salt.exceptions.SaltSystemExit("An alternative version is configured, but not defined " + "to what Python's major/minor version it is constained.") + else: + namespaces[ns] = constraint_version + + return namespaces + + def get_tops(extra_mods='', so_mods=''): ''' Get top directories for the dependencies, based on Python interpreter.