Linux server.edchosting.com 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64
LiteSpeed
Server IP : 75.98.162.185 & Your IP : 216.73.216.163
Domains :
Cant Read [ /etc/named.conf ]
User : goons4good
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
lib /
python3.6 /
site-packages /
salt /
grains /
Delete
Unzip
Name
Size
Permission
Date
Action
__pycache__
[ DIR ]
drwxr-xr-x
2022-10-11 05:09
__init__.py
32
B
-rw-r--r--
2022-05-16 09:16
chronos.py
535
B
-rw-r--r--
2022-05-16 09:16
cimc.py
635
B
-rw-r--r--
2022-05-16 09:16
core.py
111.98
KB
-rw-r--r--
2022-05-16 09:16
disks.py
5.62
KB
-rw-r--r--
2022-05-16 09:16
esxi.py
2.52
KB
-rw-r--r--
2022-05-16 09:16
extra.py
2.77
KB
-rw-r--r--
2022-05-16 09:16
fibre_channel.py
1.76
KB
-rw-r--r--
2022-05-16 09:16
fx2.py
3.06
KB
-rw-r--r--
2022-05-16 09:16
iscsi.py
2.35
KB
-rw-r--r--
2022-05-16 09:16
junos.py
1.51
KB
-rw-r--r--
2022-05-16 09:16
lvm.py
1.43
KB
-rw-r--r--
2022-05-16 09:16
marathon.py
928
B
-rw-r--r--
2022-05-16 09:16
mdadm.py
800
B
-rw-r--r--
2022-05-16 09:16
mdata.py
4.09
KB
-rw-r--r--
2022-05-16 09:16
metadata.py
2.7
KB
-rw-r--r--
2022-05-16 09:16
minion_process.py
988
B
-rw-r--r--
2022-05-16 09:16
napalm.py
11.2
KB
-rw-r--r--
2022-05-16 09:16
nvme.py
1.16
KB
-rw-r--r--
2022-05-16 09:16
nxos.py
901
B
-rw-r--r--
2022-05-16 09:16
opts.py
353
B
-rw-r--r--
2022-05-16 09:16
panos.py
640
B
-rw-r--r--
2022-05-16 09:16
pending_reboot.py
650
B
-rw-r--r--
2022-05-16 09:16
philips_hue.py
1.03
KB
-rw-r--r--
2022-05-16 09:16
rest_sample.py
1.03
KB
-rw-r--r--
2022-05-16 09:16
smartos.py
6.32
KB
-rw-r--r--
2022-05-16 09:16
ssh_sample.py
927
B
-rw-r--r--
2022-05-16 09:16
zfs.py
2.13
KB
-rw-r--r--
2022-05-16 09:16
Save
Rename
""" Generate baseline proxy minion grains for Dell FX2 chassis. The challenge is that most of Salt isn't bootstrapped yet, so we need to repeat a bunch of things that would normally happen in proxy/fx2.py--just enough to get data from the chassis to include in grains. """ import logging import salt.modules.cmdmod import salt.modules.dracr import salt.proxy.fx2 import salt.utils.platform __proxyenabled__ = ["fx2"] __virtualname__ = "fx2" logger = logging.getLogger(__file__) GRAINS_CACHE = {} def __virtual__(): if ( salt.utils.platform.is_proxy() and "proxy" in __opts__ and __opts__["proxy"].get("proxytype") == "fx2" ): return __virtualname__ return False def _find_credentials(): """ Cycle through all the possible credentials and return the first one that works """ usernames = [] usernames.append(__pillar__["proxy"].get("admin_username", "root")) if "fallback_admin_username" in __pillar__.get("proxy"): usernames.append(__pillar__["proxy"].get("fallback_admin_username")) for user in usernames: for pwd in __pillar__["proxy"]["passwords"]: r = salt.modules.dracr.get_chassis_name( host=__pillar__["proxy"]["host"], admin_username=user, admin_password=pwd, ) # Retcode will be present if the chassis_name call failed try: if r.get("retcode", None) is None: __opts__["proxy"]["admin_username"] = user __opts__["proxy"]["admin_password"] = pwd return (user, pwd) except AttributeError: # Then the above was a string, and we can return the username # and password __opts__["proxy"]["admin_username"] = user __opts__["proxy"]["admin_password"] = pwd return (user, pwd) logger.debug( "grains fx2.find_credentials found no valid credentials, using Dell default" ) return ("root", "calvin") def _grains(): """ Get the grains from the proxied device """ (username, password) = _find_credentials() r = salt.modules.dracr.system_info( host=__pillar__["proxy"]["host"], admin_username=username, admin_password=password, ) if r.get("retcode", 0) == 0: GRAINS_CACHE = r else: GRAINS_CACHE = {} GRAINS_CACHE.update( salt.modules.dracr.inventory( host=__pillar__["proxy"]["host"], admin_username=username, admin_password=password, ) ) return GRAINS_CACHE def fx2(): return _grains() def kernel(): return {"kernel": "proxy"} def location(): if not GRAINS_CACHE: GRAINS_CACHE.update(_grains()) try: return { "location": GRAINS_CACHE.get("Chassis Information").get("Chassis Location") } except AttributeError: return {"location": "Unknown"} def os_family(): return {"os_family": "proxy"} def os_data(): return {"os_data": "Unknown"}