003 File Manager
Current Path:
/usr/local/lib/python3.8/site-packages/salt/grains
usr
/
local
/
lib
/
python3.8
/
site-packages
/
salt
/
grains
/
📁
..
📄
__init__.py
(32 B)
📁
__pycache__
📄
chronos.py
(535 B)
📄
cimc.py
(635 B)
📄
core.py
(111.98 KB)
📄
disks.py
(5.62 KB)
📄
esxi.py
(2.52 KB)
📄
extra.py
(2.77 KB)
📄
fibre_channel.py
(1.76 KB)
📄
fx2.py
(3.06 KB)
📄
iscsi.py
(2.35 KB)
📄
junos.py
(1.51 KB)
📄
lvm.py
(1.43 KB)
📄
marathon.py
(928 B)
📄
mdadm.py
(800 B)
📄
mdata.py
(4.09 KB)
📄
metadata.py
(2.7 KB)
📄
minion_process.py
(988 B)
📄
napalm.py
(11.2 KB)
📄
nvme.py
(1.16 KB)
📄
nxos.py
(901 B)
📄
opts.py
(353 B)
📄
panos.py
(640 B)
📄
pending_reboot.py
(650 B)
📄
philips_hue.py
(1.03 KB)
📄
rest_sample.py
(1.03 KB)
📄
smartos.py
(6.32 KB)
📄
ssh_sample.py
(927 B)
📄
zfs.py
(2.13 KB)
Editing: junos.py
""" Grains for junos. NOTE this is a little complicated--junos can only be accessed via salt-proxy-minion. Thus, some grains make sense to get them from the minion (PYTHONPATH), but others don't (ip_interfaces) """ import logging import salt.utils.platform __proxyenabled__ = ["junos"] __virtualname__ = "junos" # Get looging started log = logging.getLogger(__name__) def __virtual__(): if "proxy" not in __opts__: return False else: return __virtualname__ def _remove_complex_types(dictionary): """ junos-eznc is now returning some complex types that are not serializable by msgpack. Kill those. """ for k, v in dictionary.items(): if isinstance(v, dict): dictionary[k] = _remove_complex_types(v) elif hasattr(v, "to_eng_string"): dictionary[k] = v.to_eng_string() return dictionary def defaults(): if salt.utils.platform.is_proxy(): return {"os": "proxy", "kernel": "unknown", "osrelease": "proxy"} else: return { "os": "junos", "kernel": "junos", "osrelease": "junos FIXME", } def facts(proxy=None): if proxy is None or proxy["junos.initialized"]() is False: return {} ret_value = proxy["junos.get_serialized_facts"]() if salt.utils.platform.is_proxy(): ret = {"junos_facts": ret_value} else: ret = {"junos_facts": ret_value, "osrelease": ret_value["version"]} return ret def os_family(): return {"os_family": "junos"}
Upload File
Create Folder