mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
add utils/compat.py
This commit is contained in:
parent
53b0f0c93f
commit
8db0ccf529
22
salt/utils/compat.py
Normal file
22
salt/utils/compat.py
Normal file
@ -0,0 +1,22 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
'''
|
||||
Compatibility functions for utils
|
||||
'''
|
||||
|
||||
# Import python libs
|
||||
from __future__ import absolute_import
|
||||
import sys
|
||||
|
||||
# Import salt libs
|
||||
import salt.loader
|
||||
|
||||
|
||||
def pack_dunder(name):
|
||||
'''
|
||||
Compatibility helper function to make __utils__ available on demand.
|
||||
'''
|
||||
# TODO: Deprecate starting with Beryllium
|
||||
|
||||
mod = sys.modules[name]
|
||||
if not hasattr(mod, '__utils__'):
|
||||
setattr(mod, '__utils__', salt.loader.utils(mod.__opts__))
|
Loading…
Reference in New Issue
Block a user