-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
onyx.py
42 lines (32 loc) · 925 Bytes
/
onyx.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# -*- coding: utf-8 -*-
'''
Grains for Onyx OS Switches Proxy minions
.. versionadded: Neon
For documentation on setting up the onyx proxy minion look in the documentation
for :mod:`salt.proxy.onyx<salt.proxy.onyx>`.
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Libs
import logging
import salt.utils.platform
import salt.modules.onyx
log = logging.getLogger(__name__)
__proxyenabled__ = ['onyx']
__virtualname__ = 'onyx'
def __virtual__():
try:
if salt.utils.platform.is_proxy() and __opts__['proxy']['proxytype'] == 'onyx':
return __virtualname__
except KeyError:
pass
return False
def proxy_functions(proxy=None):
'''
Proxy Initialization
'''
if proxy is None:
return {}
if proxy['onyx.initialized']() is False:
return {}
return {'onyx': proxy['onyx.grains']()}