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 /
utils /
Delete
Unzip
Name
Size
Permission
Date
Action
__pycache__
[ DIR ]
drwxr-xr-x
2022-10-11 05:09
decorators
[ DIR ]
drwxr-xr-x
2022-10-11 05:09
dockermod
[ DIR ]
drwxr-xr-x
2022-10-11 05:09
openstack
[ DIR ]
drwxr-xr-x
2022-10-11 05:09
pkg
[ DIR ]
drwxr-xr-x
2022-10-11 05:09
validate
[ DIR ]
drwxr-xr-x
2022-10-11 05:09
__init__.py
237
B
-rw-r--r--
2022-05-16 09:16
aggregation.py
5.17
KB
-rw-r--r--
2022-05-16 09:16
args.py
19.86
KB
-rw-r--r--
2022-05-16 09:16
asynchronous.py
4.07
KB
-rw-r--r--
2022-05-16 09:16
atomicfile.py
5.33
KB
-rw-r--r--
2022-05-16 09:16
aws.py
19.38
KB
-rw-r--r--
2022-05-16 09:16
azurearm.py
11.38
KB
-rw-r--r--
2022-05-16 09:16
beacons.py
517
B
-rw-r--r--
2022-05-16 09:16
boto3_elasticsearch.py
3.73
KB
-rw-r--r--
2022-05-16 09:16
boto3mod.py
8.36
KB
-rw-r--r--
2022-05-16 09:16
boto_elb_tag.py
3.02
KB
-rw-r--r--
2022-05-16 09:16
botomod.py
7.98
KB
-rw-r--r--
2022-05-16 09:16
cache.py
9.81
KB
-rw-r--r--
2022-05-16 09:16
cloud.py
117.04
KB
-rw-r--r--
2022-05-16 09:16
color.py
2.72
KB
-rw-r--r--
2022-05-16 09:16
compat.py
1.81
KB
-rw-r--r--
2022-05-16 09:16
configcomparer.py
3.88
KB
-rw-r--r--
2022-05-16 09:16
configparser.py
10.82
KB
-rw-r--r--
2022-05-16 09:16
context.py
6.8
KB
-rw-r--r--
2022-05-16 09:16
crypt.py
4.71
KB
-rw-r--r--
2022-05-16 09:16
ctx.py
1.42
KB
-rw-r--r--
2022-05-16 09:16
data.py
49.28
KB
-rw-r--r--
2022-05-16 09:16
dateutils.py
2.31
KB
-rw-r--r--
2022-05-16 09:16
debug.py
4.19
KB
-rw-r--r--
2022-05-16 09:16
dictdiffer.py
14.16
KB
-rw-r--r--
2022-05-16 09:16
dicttrim.py
3.9
KB
-rw-r--r--
2022-05-16 09:16
dictupdate.py
11.33
KB
-rw-r--r--
2022-05-16 09:16
dns.py
35.17
KB
-rw-r--r--
2022-05-16 09:16
doc.py
2.25
KB
-rw-r--r--
2022-05-16 09:16
entrypoints.py
2.28
KB
-rw-r--r--
2022-05-16 09:16
environment.py
2.2
KB
-rw-r--r--
2022-05-16 09:16
error.py
1.18
KB
-rw-r--r--
2022-05-16 09:16
etcd_util.py
14.22
KB
-rw-r--r--
2022-05-16 09:16
event.py
52.3
KB
-rw-r--r--
2022-05-16 09:16
extend.py
8.87
KB
-rw-r--r--
2022-05-16 09:16
extmods.py
5.67
KB
-rw-r--r--
2022-05-16 09:16
filebuffer.py
3.15
KB
-rw-r--r--
2022-05-16 09:16
files.py
27.6
KB
-rw-r--r--
2022-05-16 09:16
find.py
22.09
KB
-rw-r--r--
2022-05-16 09:16
fsutils.py
3.29
KB
-rw-r--r--
2022-05-16 09:16
functools.py
5.02
KB
-rw-r--r--
2022-05-16 09:16
gitfs.py
124.49
KB
-rw-r--r--
2022-05-16 09:16
github.py
1.52
KB
-rw-r--r--
2022-05-16 09:16
gzip_util.py
2.86
KB
-rw-r--r--
2022-05-16 09:16
hashutils.py
5.91
KB
-rw-r--r--
2022-05-16 09:16
http.py
34.36
KB
-rw-r--r--
2022-05-16 09:16
iam.py
1.22
KB
-rw-r--r--
2022-05-16 09:16
icinga2.py
754
B
-rw-r--r--
2022-05-16 09:16
idem.py
1.22
KB
-rw-r--r--
2022-05-16 09:16
immutabletypes.py
2.46
KB
-rw-r--r--
2022-05-16 09:16
itertools.py
2.36
KB
-rw-r--r--
2022-05-16 09:16
jid.py
3
KB
-rw-r--r--
2022-05-16 09:16
jinja.py
31.54
KB
-rw-r--r--
2022-05-16 09:16
job.py
6.01
KB
-rw-r--r--
2022-05-16 09:16
json.py
3.78
KB
-rw-r--r--
2022-05-16 09:16
kickstart.py
41.04
KB
-rw-r--r--
2022-05-16 09:16
kinds.py
493
B
-rw-r--r--
2022-05-16 09:16
lazy.py
3.06
KB
-rw-r--r--
2022-05-16 09:16
listdiffer.py
10.9
KB
-rw-r--r--
2022-05-16 09:16
locales.py
2.06
KB
-rw-r--r--
2022-05-16 09:16
mac_utils.py
14.01
KB
-rw-r--r--
2022-05-16 09:16
mako.py
3.63
KB
-rw-r--r--
2022-05-16 09:16
master.py
29.57
KB
-rw-r--r--
2022-05-16 09:16
mattermost.py
1.77
KB
-rw-r--r--
2022-05-16 09:16
memcached.py
3.56
KB
-rw-r--r--
2022-05-16 09:16
migrations.py
1.46
KB
-rw-r--r--
2022-05-16 09:16
mine.py
3.68
KB
-rw-r--r--
2022-05-16 09:16
minion.py
4.13
KB
-rw-r--r--
2022-05-16 09:16
minions.py
43.4
KB
-rw-r--r--
2022-05-16 09:16
mount.py
1.15
KB
-rw-r--r--
2022-05-16 09:16
msazure.py
5.36
KB
-rw-r--r--
2022-05-16 09:16
msgpack.py
4.69
KB
-rw-r--r--
2022-05-16 09:16
nacl.py
13.58
KB
-rw-r--r--
2022-05-16 09:16
namecheap.py
4.32
KB
-rw-r--r--
2022-05-16 09:16
napalm.py
23.79
KB
-rw-r--r--
2022-05-16 09:16
nb_popen.py
7.24
KB
-rw-r--r--
2022-05-16 09:16
network.py
71.07
KB
-rw-r--r--
2022-05-16 09:16
nxos.py
12.94
KB
-rw-r--r--
2022-05-16 09:16
nxos_api.py
4
KB
-rw-r--r--
2022-05-16 09:16
odict.py
13.16
KB
-rw-r--r--
2022-05-16 09:16
oset.py
6.41
KB
-rw-r--r--
2022-05-16 09:16
pagerduty.py
3.03
KB
-rw-r--r--
2022-05-16 09:16
parsers.py
125.31
KB
-rw-r--r--
2022-05-16 09:16
path.py
10.78
KB
-rw-r--r--
2022-05-16 09:16
pbm.py
9.81
KB
-rw-r--r--
2022-05-16 09:16
platform.py
5.16
KB
-rw-r--r--
2022-05-16 09:16
powershell.py
4.15
KB
-rw-r--r--
2022-05-16 09:16
preseed.py
2.64
KB
-rw-r--r--
2022-05-16 09:16
process.py
43.34
KB
-rw-r--r--
2022-05-16 09:16
profile.py
3.21
KB
-rw-r--r--
2022-05-16 09:16
proxy.py
331
B
-rw-r--r--
2022-05-16 09:16
psutil_compat.py
3.65
KB
-rw-r--r--
2022-05-16 09:16
pushover.py
4.51
KB
-rw-r--r--
2022-05-16 09:16
pycrypto.py
5.39
KB
-rw-r--r--
2022-05-16 09:16
pydsl.py
13.74
KB
-rw-r--r--
2022-05-16 09:16
pyobjects.py
10.75
KB
-rw-r--r--
2022-05-16 09:16
reactor.py
19.09
KB
-rw-r--r--
2022-05-16 09:16
reclass.py
752
B
-rw-r--r--
2022-05-16 09:16
roster_matcher.py
3.55
KB
-rw-r--r--
2022-05-16 09:16
rsax931.py
8.07
KB
-rw-r--r--
2022-05-16 09:16
s3.py
8.78
KB
-rw-r--r--
2022-05-16 09:16
saltclass.py
14.27
KB
-rw-r--r--
2022-05-16 09:16
sanitizers.py
2.51
KB
-rw-r--r--
2022-05-16 09:16
schedule.py
70.67
KB
-rw-r--r--
2022-05-16 09:16
schema.py
54.26
KB
-rw-r--r--
2022-05-16 09:16
sdb.py
4.04
KB
-rw-r--r--
2022-05-16 09:16
slack.py
3.57
KB
-rw-r--r--
2022-05-16 09:16
smb.py
11.16
KB
-rw-r--r--
2022-05-16 09:16
smtp.py
3.27
KB
-rw-r--r--
2022-05-16 09:16
ssdp.py
14.75
KB
-rw-r--r--
2022-05-16 09:16
ssh.py
769
B
-rw-r--r--
2022-05-16 09:16
state.py
8.43
KB
-rw-r--r--
2022-05-16 09:16
stringio.py
355
B
-rw-r--r--
2022-05-16 09:16
stringutils.py
16.63
KB
-rw-r--r--
2022-05-16 09:16
systemd.py
5.51
KB
-rw-r--r--
2022-05-16 09:16
templates.py
23.92
KB
-rw-r--r--
2022-05-16 09:16
textformat.py
5.03
KB
-rw-r--r--
2022-05-16 09:16
thin.py
31.64
KB
-rw-r--r--
2022-05-16 09:16
timed_subprocess.py
4.06
KB
-rw-r--r--
2022-05-16 09:16
timeout.py
1.53
KB
-rw-r--r--
2022-05-16 09:16
timeutil.py
2.4
KB
-rw-r--r--
2022-05-16 09:16
url.py
4.96
KB
-rw-r--r--
2022-05-16 09:16
user.py
10.92
KB
-rw-r--r--
2022-05-16 09:16
value.py
247
B
-rw-r--r--
2022-05-16 09:16
vault.py
19.23
KB
-rw-r--r--
2022-05-16 09:16
verify.py
26.97
KB
-rw-r--r--
2022-05-16 09:16
versions.py
16.32
KB
-rw-r--r--
2022-05-16 09:16
virt.py
3.24
KB
-rw-r--r--
2022-05-16 09:16
virtualbox.py
22.43
KB
-rw-r--r--
2022-05-16 09:16
vmware.py
129.74
KB
-rw-r--r--
2022-05-16 09:16
vsan.py
17.18
KB
-rw-r--r--
2022-05-16 09:16
vt.py
30.25
KB
-rw-r--r--
2022-05-16 09:16
vt_helper.py
4.4
KB
-rw-r--r--
2022-05-16 09:16
win_chcp.py
3.7
KB
-rw-r--r--
2022-05-16 09:16
win_dacl.py
94.69
KB
-rw-r--r--
2022-05-16 09:16
win_dotnet.py
4.75
KB
-rw-r--r--
2022-05-16 09:16
win_functions.py
12.69
KB
-rw-r--r--
2022-05-16 09:16
win_lgpo_auditpol.py
8.48
KB
-rw-r--r--
2022-05-16 09:16
win_lgpo_netsh.py
17.87
KB
-rw-r--r--
2022-05-16 09:16
win_network.py
12.41
KB
-rw-r--r--
2022-05-16 09:16
win_osinfo.py
2.83
KB
-rw-r--r--
2022-05-16 09:16
win_pdh.py
13.85
KB
-rw-r--r--
2022-05-16 09:16
win_reg.py
30.05
KB
-rw-r--r--
2022-05-16 09:16
win_runas.py
10.55
KB
-rw-r--r--
2022-05-16 09:16
win_service.py
5.2
KB
-rw-r--r--
2022-05-16 09:16
win_system.py
14.47
KB
-rw-r--r--
2022-05-16 09:16
win_update.py
40.36
KB
-rw-r--r--
2022-05-16 09:16
winapi.py
818
B
-rw-r--r--
2022-05-16 09:16
xdg.py
316
B
-rw-r--r--
2022-05-16 09:16
xmlutil.py
13.91
KB
-rw-r--r--
2022-05-16 09:16
yaml.py
348
B
-rw-r--r--
2022-05-16 09:16
yamldumper.py
3.38
KB
-rw-r--r--
2022-05-16 09:16
yamlencoding.py
1.55
KB
-rw-r--r--
2022-05-16 09:16
yamlloader.py
6.21
KB
-rw-r--r--
2022-05-16 09:16
yamlloader_old.py
8.33
KB
-rw-r--r--
2022-05-16 09:16
yast.py
619
B
-rw-r--r--
2022-05-16 09:16
zeromq.py
1.65
KB
-rw-r--r--
2022-05-16 09:16
zfs.py
19.2
KB
-rw-r--r--
2022-05-16 09:16
Save
Rename
""" :maintainer: Jack Kuan <kjkuan@gmail.com> :maturity: new :platform: all A Python DSL for generating Salt's highstate data structure. This module is intended to be used with the `pydsl` renderer, but can also be used on its own. Here's what you can do with Salt PyDSL:: # Example translated from the online salt tutorial apache = state('apache') apache.pkg.installed() apache.service.running() \\ .watch(pkg='apache', file='/etc/httpd/conf/httpd.conf', user='apache') if __grains__['os'] == 'RedHat': apache.pkg.installed(name='httpd') apache.service.running(name='httpd') apache.group.present(gid=87).require(apache.pkg) apache.user.present(uid=87, gid=87, home='/var/www/html', shell='/bin/nologin') \\ .require(apache.group) state('/etc/httpd/conf/httpd.conf').file.managed( source='salt://apache/httpd.conf', user='root', group='root', mode=644) Example with ``include`` and ``extend``, translated from the online salt tutorial:: include('http', 'ssh') extend( state('apache').file( name='/etc/httpd/conf/httpd.conf', source='salt://http/httpd2.conf' ), state('ssh-server').service.watch(file='/etc/ssh/banner') ) state('/etc/ssh/banner').file.managed(source='salt://ssh/banner') Example of a ``cmd`` state calling a python function:: def hello(s): s = "hello world, %s" % s return dict(result=True, changes=dict(changed=True, output=s)) state('hello').cmd.call(hello, 'pydsl!') """ # Implementation note: # - There's a bit of terminology mix-up here: # - what I called a state or state declaration here is actually # an ID declaration. # - what I called a module or a state module actually corresponds # to a state declaration. # - and a state function is a function declaration. # TODOs: # # - support exclude declarations # # - allow this: # state('X').cmd.run.cwd = '/' # assert state('X').cmd.run.cwd == '/' # # - make it possible to remove: # - state declarations # - state module declarations # - state func and args # from uuid import uuid4 as _uuid from salt.state import HighState from salt.utils.odict import OrderedDict REQUISITES = set( "listen require watch prereq use listen_in require_in watch_in prereq_in use_in" " onchanges onfail".split() ) class PyDslError(Exception): pass class Options(dict): def __getattr__(self, name): return self.get(name) SLS_MATCHES = None class Sls: def __init__(self, sls, saltenv, rendered_sls): self.name = sls self.saltenv = saltenv self.includes = [] self.included_highstate = HighState.get_active().building_highstate self.extends = [] self.decls = [] self.options = Options() self.funcs = [] # track the ordering of state func declarations self.rendered_sls = rendered_sls # a set of names of rendered sls modules if not HighState.get_active(): raise PyDslError("PyDSL only works with a running high state!") @classmethod def get_all_decls(cls): return HighState.get_active()._pydsl_all_decls @classmethod def get_render_stack(cls): return HighState.get_active()._pydsl_render_stack def set(self, **options): self.options.update(options) def include(self, *sls_names, **kws): if "env" in kws: # "env" is not supported; Use "saltenv". kws.pop("env") saltenv = kws.get("saltenv", self.saltenv) if kws.get("delayed", False): for incl in sls_names: self.includes.append((saltenv, incl)) return HIGHSTATE = HighState.get_active() global SLS_MATCHES if SLS_MATCHES is None: SLS_MATCHES = HIGHSTATE.top_matches(HIGHSTATE.get_top()) highstate = self.included_highstate slsmods = [] # a list of pydsl sls modules rendered. for sls in sls_names: r_env = "{}:{}".format(saltenv, sls) if r_env not in self.rendered_sls: self.rendered_sls.add( sls ) # needed in case the starting sls uses the pydsl renderer. histates, errors = HIGHSTATE.render_state( sls, saltenv, self.rendered_sls, SLS_MATCHES ) HIGHSTATE.merge_included_states(highstate, histates, errors) if errors: raise PyDslError("\n".join(errors)) HIGHSTATE.clean_duplicate_extends(highstate) state_id = "_slsmod_{}".format(sls) if state_id not in highstate: slsmods.append(None) else: for arg in highstate[state_id]["stateconf"]: if isinstance(arg, dict) and next(iter(arg)) == "slsmod": slsmods.append(arg["slsmod"]) break if not slsmods: return None return slsmods[0] if len(slsmods) == 1 else slsmods def extend(self, *state_funcs): if self.options.ordered or self.last_func(): raise PyDslError("Cannot extend() after the ordered option was turned on!") for f in state_funcs: state_id = f.mod._state_id self.extends.append(self.get_all_decls().pop(state_id)) i = len(self.decls) for decl in reversed(self.decls): i -= 1 if decl._id == state_id: del self.decls[i] break def state(self, id=None): if not id: id = ".{}".format(_uuid()) # adds a leading dot to make use of stateconf's namespace feature. try: return self.get_all_decls()[id] except KeyError: self.get_all_decls()[id] = s = StateDeclaration(id) self.decls.append(s) return s def last_func(self): return self.funcs[-1] if self.funcs else None def track_func(self, statefunc): self.funcs.append(statefunc) def to_highstate(self, slsmod): # generate a state that uses the stateconf.set state, which # is a no-op state, to hold a reference to the sls module # containing the DSL statements. This is to prevent the module # from being GC'ed, so that objects defined in it will be # available while salt is executing the states. slsmod_id = "_slsmod_" + self.name self.state(slsmod_id).stateconf.set(slsmod=slsmod) del self.get_all_decls()[slsmod_id] highstate = OrderedDict() if self.includes: highstate["include"] = [{t[0]: t[1]} for t in self.includes] if self.extends: highstate["extend"] = extend = OrderedDict() for ext in self.extends: extend[ext._id] = ext._repr(context="extend") for decl in self.decls: highstate[decl._id] = decl._repr() if self.included_highstate: errors = [] HighState.get_active().merge_included_states( highstate, self.included_highstate, errors ) if errors: raise PyDslError("\n".join(errors)) return highstate def load_highstate(self, highstate): for sid, decl in highstate.items(): s = self.state(sid) for modname, args in decl.items(): if "." in modname: modname, funcname = modname.rsplit(".", 1) else: funcname = next(x for x in args if isinstance(x, str)) args.remove(funcname) mod = getattr(s, modname) named_args = {} for x in args: if isinstance(x, dict): k, v = next(iter(x.items())) named_args[k] = v mod(funcname, **named_args) class StateDeclaration: def __init__(self, id): self._id = id self._mods = [] def __getattr__(self, name): for m in self._mods: if m._name == name: return m m = StateModule(name, self._id) self._mods.append(m) return m __getitem__ = __getattr__ def __str__(self): return self._id def __iter__(self): return iter(self._mods) def _repr(self, context=None): return OrderedDict(m._repr(context) for m in self) def __call__(self, check=True): sls = Sls.get_render_stack()[-1] if self._id in sls.get_all_decls(): last_func = sls.last_func() if last_func and self._mods[-1]._func is not last_func: raise PyDslError( "Cannot run state({}: {}) that is required by a runtime " "state({}: {}), at compile time.".format( self._mods[-1]._name, self._id, last_func.mod, last_func.mod._state_id, ) ) sls.get_all_decls().pop(self._id) sls.decls.remove(self) self._mods[0]._func._remove_auto_require() for m in self._mods: try: sls.funcs.remove(m._func) except ValueError: pass result = HighState.get_active().state.functions["state.high"]( {self._id: self._repr()} ) if not isinstance(result, dict): # A list is an error raise PyDslError( "An error occurred while running highstate: {}".format( "; ".join(result) ) ) result = sorted(result.items(), key=lambda t: t[1]["__run_num__"]) if check: for k, v in result: if not v["result"]: import pprint raise PyDslError( "Failed executing low state at compile time:\n{}".format( pprint.pformat({k: v}) ) ) return result class StateModule: def __init__(self, name, parent_decl): self._state_id = parent_decl self._name = name self._func = None def __getattr__(self, name): if self._func: if name == self._func.name: return self._func else: if name not in REQUISITES: if self._func.name: raise PyDslError( "Multiple state functions({}) not allowed in a " "state module({})!".format(name, self._name) ) self._func.name = name return self._func return getattr(self._func, name) if name in REQUISITES: self._func = f = StateFunction(None, self) return getattr(f, name) else: self._func = f = StateFunction(name, self) return f def __call__(self, _fname, *args, **kws): return getattr(self, _fname).configure(args, kws) def __str__(self): return self._name def _repr(self, context=None): return (self._name, self._func._repr(context)) def _generate_requsite_method(t): def req(self, *args, **kws): for mod in args: self.reference(t, mod, None) for mod_ref in kws.items(): self.reference(t, *mod_ref) return self return req class StateFunction: def __init__(self, name, parent_mod): self.mod = parent_mod self.name = name self.args = [] # track the position of the auto-added require for easy # removal if run at compile time. self.require_index = None sls = Sls.get_render_stack()[-1] if sls.options.ordered: last_f = sls.last_func() if last_f: self.require(last_f.mod) self.require_index = len(self.args) - 1 sls.track_func(self) def _remove_auto_require(self): if self.require_index is not None: del self.args[self.require_index] self.require_index = None def __call__(self, *args, **kws): self.configure(args, kws) return self def _repr(self, context=None): if not self.name and context != "extend": raise PyDslError( "No state function specified for module: {}".format(self.mod._name) ) if not self.name and context == "extend": return self.args return [self.name] + self.args def configure(self, args, kws): args = list(args) if args: first = args[0] if ( self.mod._name == "cmd" and self.name in ("call", "wait_call") and callable(first) ): args[0] = first.__name__ kws = dict(func=first, args=args[1:], kws=kws) del args[1:] args[0] = dict(name=args[0]) for k, v in kws.items(): args.append({k: v}) self.args.extend(args) return self def reference(self, req_type, mod, ref): if isinstance(mod, StateModule): ref = mod._state_id elif not (mod and ref): raise PyDslError( "Invalid a requisite reference declaration! {}: {}".format(mod, ref) ) self.args.append({req_type: [{str(mod): str(ref)}]}) ns = locals() for req_type in REQUISITES: ns[req_type] = _generate_requsite_method(req_type) del ns del req_type