mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Adding __salt__ to utils/icinga so cmd.run_all is available.
This commit is contained in:
parent
1fa2072521
commit
233dbaf3c9
1 changed files with 6 additions and 1 deletions
|
@ -14,12 +14,17 @@ import re
|
|||
|
||||
# Import Salt libs
|
||||
import salt.utils.path
|
||||
import salt.modules.cmdmod
|
||||
|
||||
__salt__ = {
|
||||
'cmd.run_all': salt.modules.cmdmod.run_all
|
||||
}
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def get_certs_path():
|
||||
icinga2_output = __salt__['cmd.run_all']([salt.utils.path.which('icinga2'), "--version"], python_shell=False)
|
||||
icinga2_output = __salt__['cmd.run_all']([salt.utils.path.which('icinga2'),
|
||||
"--version"], python_shell=False)
|
||||
version = re.search(r'r\d+\.\d+', icinga2_output['stdout']).group(0)
|
||||
# Return new certs path for icinga2 >= 2.8
|
||||
if int(version.split('.')[1]) >= 8:
|
||||
|
|
Loading…
Add table
Reference in a new issue