repo
stringlengths
7
54
path
stringlengths
4
223
func_name
stringlengths
1
134
original_string
stringlengths
75
104k
language
stringclasses
1 value
code
stringlengths
75
104k
code_tokens
listlengths
20
28.4k
docstring
stringlengths
1
46.3k
docstring_tokens
listlengths
1
1.66k
sha
stringlengths
40
40
url
stringlengths
87
315
partition
stringclasses
1 value
summary
stringlengths
4
350
obf_code
stringlengths
7.85k
764k
saltstack/salt
salt/utils/process.py
get_pidfile
def get_pidfile(pidfile): ''' Return the pid from a pidfile as an integer ''' try: with salt.utils.files.fopen(pidfile) as pdf: pid = pdf.read().strip() return int(pid) except (OSError, IOError, TypeError, ValueError): return -1
python
def get_pidfile(pidfile): ''' Return the pid from a pidfile as an integer ''' try: with salt.utils.files.fopen(pidfile) as pdf: pid = pdf.read().strip() return int(pid) except (OSError, IOError, TypeError, ValueError): return -1
[ "def", "get_pidfile", "(", "pidfile", ")", ":", "try", ":", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "pidfile", ")", "as", "pdf", ":", "pid", "=", "pdf", ".", "read", "(", ")", ".", "strip", "(", ")", "return", "int", "(", ...
Return the pid from a pidfile as an integer
[ "Return", "the", "pid", "from", "a", "pidfile", "as", "an", "integer" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/process.py#L225-L234
train
Return the pid from a pidfile as an integer
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/process.py
clean_proc
def clean_proc(proc, wait_for_kill=10): ''' Generic method for cleaning up multiprocessing procs ''' # NoneType and other fun stuff need not apply if not proc: return try: waited = 0 while proc.is_alive(): proc.terminate() waited += 1 t...
python
def clean_proc(proc, wait_for_kill=10): ''' Generic method for cleaning up multiprocessing procs ''' # NoneType and other fun stuff need not apply if not proc: return try: waited = 0 while proc.is_alive(): proc.terminate() waited += 1 t...
[ "def", "clean_proc", "(", "proc", ",", "wait_for_kill", "=", "10", ")", ":", "# NoneType and other fun stuff need not apply", "if", "not", "proc", ":", "return", "try", ":", "waited", "=", "0", "while", "proc", ".", "is_alive", "(", ")", ":", "proc", ".", ...
Generic method for cleaning up multiprocessing procs
[ "Generic", "method", "for", "cleaning", "up", "multiprocessing", "procs" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/process.py#L237-L257
train
Generic method for cleaning up multiprocessing processes
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/process.py
os_is_running
def os_is_running(pid): ''' Use OS facilities to determine if a process is running ''' if isinstance(pid, six.string_types): pid = int(pid) if HAS_PSUTIL: return psutil.pid_exists(pid) else: try: os.kill(pid, 0) # SIG 0 is the "are you alive?" signal ...
python
def os_is_running(pid): ''' Use OS facilities to determine if a process is running ''' if isinstance(pid, six.string_types): pid = int(pid) if HAS_PSUTIL: return psutil.pid_exists(pid) else: try: os.kill(pid, 0) # SIG 0 is the "are you alive?" signal ...
[ "def", "os_is_running", "(", "pid", ")", ":", "if", "isinstance", "(", "pid", ",", "six", ".", "string_types", ")", ":", "pid", "=", "int", "(", "pid", ")", "if", "HAS_PSUTIL", ":", "return", "psutil", ".", "pid_exists", "(", "pid", ")", "else", ":",...
Use OS facilities to determine if a process is running
[ "Use", "OS", "facilities", "to", "determine", "if", "a", "process", "is", "running" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/process.py#L260-L273
train
Check if a process is running.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/process.py
ProcessManager.add_process
def add_process(self, tgt, args=None, kwargs=None, name=None): ''' Create a processes and args + kwargs This will deterimine if it is a Process class, otherwise it assumes it is a function ''' if args is None: args = [] if kwargs is None: ...
python
def add_process(self, tgt, args=None, kwargs=None, name=None): ''' Create a processes and args + kwargs This will deterimine if it is a Process class, otherwise it assumes it is a function ''' if args is None: args = [] if kwargs is None: ...
[ "def", "add_process", "(", "self", ",", "tgt", ",", "args", "=", "None", ",", "kwargs", "=", "None", ",", "name", "=", "None", ")", ":", "if", "args", "is", "None", ":", "args", "=", "[", "]", "if", "kwargs", "is", "None", ":", "kwargs", "=", "...
Create a processes and args + kwargs This will deterimine if it is a Process class, otherwise it assumes it is a function
[ "Create", "a", "processes", "and", "args", "+", "kwargs", "This", "will", "deterimine", "if", "it", "is", "a", "Process", "class", "otherwise", "it", "assumes", "it", "is", "a", "function" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/process.py#L366-L433
train
Create a process and args + kwargs and name for the debug log.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/process.py
ProcessManager.restart_process
def restart_process(self, pid): ''' Create new process (assuming this one is dead), then remove the old one ''' if self._restart_processes is False: return log.info( 'Process %s (%s) died with exit status %s, restarting...', self._process_map[p...
python
def restart_process(self, pid): ''' Create new process (assuming this one is dead), then remove the old one ''' if self._restart_processes is False: return log.info( 'Process %s (%s) died with exit status %s, restarting...', self._process_map[p...
[ "def", "restart_process", "(", "self", ",", "pid", ")", ":", "if", "self", ".", "_restart_processes", "is", "False", ":", "return", "log", ".", "info", "(", "'Process %s (%s) died with exit status %s, restarting...'", ",", "self", ".", "_process_map", "[", "pid", ...
Create new process (assuming this one is dead), then remove the old one
[ "Create", "new", "process", "(", "assuming", "this", "one", "is", "dead", ")", "then", "remove", "the", "old", "one" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/process.py#L435-L454
train
Restarts a process.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/process.py
ProcessManager.run
def run(self, asynchronous=False): ''' Load and start all available api modules ''' log.debug('Process Manager starting!') appendproctitle(self.name) # make sure to kill the subprocesses if the parent is killed if signal.getsignal(signal.SIGTERM) is signal.SIG_DF...
python
def run(self, asynchronous=False): ''' Load and start all available api modules ''' log.debug('Process Manager starting!') appendproctitle(self.name) # make sure to kill the subprocesses if the parent is killed if signal.getsignal(signal.SIGTERM) is signal.SIG_DF...
[ "def", "run", "(", "self", ",", "asynchronous", "=", "False", ")", ":", "log", ".", "debug", "(", "'Process Manager starting!'", ")", "appendproctitle", "(", "self", ".", "name", ")", "# make sure to kill the subprocesses if the parent is killed", "if", "signal", "....
Load and start all available api modules
[ "Load", "and", "start", "all", "available", "api", "modules" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/process.py#L485-L522
train
Load and start all available api modules and process the process.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/process.py
ProcessManager.check_children
def check_children(self): ''' Check the children once ''' if self._restart_processes is True: for pid, mapping in six.iteritems(self._process_map): if not mapping['Process'].is_alive(): log.trace('Process restart of %s', pid) ...
python
def check_children(self): ''' Check the children once ''' if self._restart_processes is True: for pid, mapping in six.iteritems(self._process_map): if not mapping['Process'].is_alive(): log.trace('Process restart of %s', pid) ...
[ "def", "check_children", "(", "self", ")", ":", "if", "self", ".", "_restart_processes", "is", "True", ":", "for", "pid", ",", "mapping", "in", "six", ".", "iteritems", "(", "self", ".", "_process_map", ")", ":", "if", "not", "mapping", "[", "'Process'",...
Check the children once
[ "Check", "the", "children", "once" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/process.py#L524-L532
train
Check the children once
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/process.py
ProcessManager.kill_children
def kill_children(self, *args, **kwargs): ''' Kill all of the children ''' # first lets reset signal handlers to default one to prevent running this twice signal.signal(signal.SIGTERM, signal.SIG_IGN) signal.signal(signal.SIGINT, signal.SIG_IGN) # check that this...
python
def kill_children(self, *args, **kwargs): ''' Kill all of the children ''' # first lets reset signal handlers to default one to prevent running this twice signal.signal(signal.SIGTERM, signal.SIG_IGN) signal.signal(signal.SIGINT, signal.SIG_IGN) # check that this...
[ "def", "kill_children", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# first lets reset signal handlers to default one to prevent running this twice", "signal", ".", "signal", "(", "signal", ".", "SIGTERM", ",", "signal", ".", "SIG_IGN", ")", ...
Kill all of the children
[ "Kill", "all", "of", "the", "children" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/process.py#L534-L657
train
Kill all of the children of this process.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/victorops.py
_query
def _query(action=None, routing_key=None, args=None, method='GET', header_dict=None, data=None): ''' Make a web call to VictorOps ''' api_key = __salt__['config.get']('victorops.api_key') or \ __salt__['config.get']('victorops:api_key') ...
python
def _query(action=None, routing_key=None, args=None, method='GET', header_dict=None, data=None): ''' Make a web call to VictorOps ''' api_key = __salt__['config.get']('victorops.api_key') or \ __salt__['config.get']('victorops:api_key') ...
[ "def", "_query", "(", "action", "=", "None", ",", "routing_key", "=", "None", ",", "args", "=", "None", ",", "method", "=", "'GET'", ",", "header_dict", "=", "None", ",", "data", "=", "None", ")", ":", "api_key", "=", "__salt__", "[", "'config.get'", ...
Make a web call to VictorOps
[ "Make", "a", "web", "call", "to", "VictorOps" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/victorops.py#L41-L97
train
Query VictorOps for a single item
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/victorops.py
create_event
def create_event(message_type=None, routing_key='everybody', **kwargs): ''' Create an event in VictorOps. Designed for use in states. The following parameters are required: :param message_type: One of the following values: INFO, WARNING, ACKNOWLEDGEMENT, CRITICAL, RECOVERY. The followi...
python
def create_event(message_type=None, routing_key='everybody', **kwargs): ''' Create an event in VictorOps. Designed for use in states. The following parameters are required: :param message_type: One of the following values: INFO, WARNING, ACKNOWLEDGEMENT, CRITICAL, RECOVERY. The followi...
[ "def", "create_event", "(", "message_type", "=", "None", ",", "routing_key", "=", "'everybody'", ",", "*", "*", "kwargs", ")", ":", "keyword_args", "=", "{", "'entity_id'", ":", "str", ",", "'state_message'", ":", "str", ",", "'entity_is_host'", ":", "bool",...
Create an event in VictorOps. Designed for use in states. The following parameters are required: :param message_type: One of the following values: INFO, WARNING, ACKNOWLEDGEMENT, CRITICAL, RECOVERY. The following parameters are optional: :param routing_key: The key for where m...
[ "Create", "an", "event", "in", "VictorOps", ".", "Designed", "for", "use", "in", "states", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/victorops.py#L100-L211
train
Create an event in VictorOps.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/telemetry_alert.py
present
def present(name, deployment_id, metric_name, alert_config, api_key=None, profile='telemetry'): ''' Ensure the telemetry alert exists. name An optional description of the alarm (not currently supported by telemetry API) deployment_id Specifies the ID of the root deployment resource ...
python
def present(name, deployment_id, metric_name, alert_config, api_key=None, profile='telemetry'): ''' Ensure the telemetry alert exists. name An optional description of the alarm (not currently supported by telemetry API) deployment_id Specifies the ID of the root deployment resource ...
[ "def", "present", "(", "name", ",", "deployment_id", ",", "metric_name", ",", "alert_config", ",", "api_key", "=", "None", ",", "profile", "=", "'telemetry'", ")", ":", "ret", "=", "{", "'name'", ":", "metric_name", ",", "'result'", ":", "True", ",", "'c...
Ensure the telemetry alert exists. name An optional description of the alarm (not currently supported by telemetry API) deployment_id Specifies the ID of the root deployment resource (replica set cluster or sharded cluster) to which this alert definition is attached metric_name ...
[ "Ensure", "the", "telemetry", "alert", "exists", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/telemetry_alert.py#L40-L155
train
Ensure the telemetry alert exists for the given metric and resource.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/telemetry_alert.py
absent
def absent(name, deployment_id, metric_name, api_key=None, profile="telemetry"): ''' Ensure the telemetry alert config is deleted name An optional description of the alarms (not currently supported by telemetry API) deployment_id Specifies the ID of the root deployment resource ...
python
def absent(name, deployment_id, metric_name, api_key=None, profile="telemetry"): ''' Ensure the telemetry alert config is deleted name An optional description of the alarms (not currently supported by telemetry API) deployment_id Specifies the ID of the root deployment resource ...
[ "def", "absent", "(", "name", ",", "deployment_id", ",", "metric_name", ",", "api_key", "=", "None", ",", "profile", "=", "\"telemetry\"", ")", ":", "ret", "=", "{", "'name'", ":", "metric_name", ",", "'result'", ":", "True", ",", "'comment'", ":", "''",...
Ensure the telemetry alert config is deleted name An optional description of the alarms (not currently supported by telemetry API) deployment_id Specifies the ID of the root deployment resource (replica set cluster or sharded cluster) to which this alert definition is attached met...
[ "Ensure", "the", "telemetry", "alert", "config", "is", "deleted" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/telemetry_alert.py#L158-L201
train
Ensure the telemetry alert config is absent
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/mac_pkgutil.py
list_
def list_(): ''' List the installed packages. :return: A list of installed packages :rtype: list CLI Example: .. code-block:: bash salt '*' pkgutil.list ''' cmd = 'pkgutil --pkgs' ret = salt.utils.mac_utils.execute_return_result(cmd) return ret.splitlines()
python
def list_(): ''' List the installed packages. :return: A list of installed packages :rtype: list CLI Example: .. code-block:: bash salt '*' pkgutil.list ''' cmd = 'pkgutil --pkgs' ret = salt.utils.mac_utils.execute_return_result(cmd) return ret.splitlines()
[ "def", "list_", "(", ")", ":", "cmd", "=", "'pkgutil --pkgs'", "ret", "=", "salt", ".", "utils", ".", "mac_utils", ".", "execute_return_result", "(", "cmd", ")", "return", "ret", ".", "splitlines", "(", ")" ]
List the installed packages. :return: A list of installed packages :rtype: list CLI Example: .. code-block:: bash salt '*' pkgutil.list
[ "List", "the", "installed", "packages", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_pkgutil.py#L39-L54
train
List the installed packages.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/mac_pkgutil.py
_install_from_path
def _install_from_path(path): ''' Internal function to install a package from the given path ''' if not os.path.exists(path): msg = 'File not found: {0}'.format(path) raise SaltInvocationError(msg) cmd = 'installer -pkg "{0}" -target /'.format(path) return salt.utils.mac_utils.e...
python
def _install_from_path(path): ''' Internal function to install a package from the given path ''' if not os.path.exists(path): msg = 'File not found: {0}'.format(path) raise SaltInvocationError(msg) cmd = 'installer -pkg "{0}" -target /'.format(path) return salt.utils.mac_utils.e...
[ "def", "_install_from_path", "(", "path", ")", ":", "if", "not", "os", ".", "path", ".", "exists", "(", "path", ")", ":", "msg", "=", "'File not found: {0}'", ".", "format", "(", "path", ")", "raise", "SaltInvocationError", "(", "msg", ")", "cmd", "=", ...
Internal function to install a package from the given path
[ "Internal", "function", "to", "install", "a", "package", "from", "the", "given", "path" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_pkgutil.py#L73-L82
train
Internal function to install a package from the given path
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/mac_pkgutil.py
install
def install(source, package_id): ''' Install a .pkg from an URI or an absolute path. :param str source: The path to a package. :param str package_id: The package ID :return: True if successful, otherwise False :rtype: bool CLI Example: .. code-block:: bash salt '*' pkgutil....
python
def install(source, package_id): ''' Install a .pkg from an URI or an absolute path. :param str source: The path to a package. :param str package_id: The package ID :return: True if successful, otherwise False :rtype: bool CLI Example: .. code-block:: bash salt '*' pkgutil....
[ "def", "install", "(", "source", ",", "package_id", ")", ":", "if", "is_installed", "(", "package_id", ")", ":", "return", "True", "uri", "=", "urllib", ".", "parse", ".", "urlparse", "(", "source", ")", "if", "not", "uri", ".", "scheme", "==", "''", ...
Install a .pkg from an URI or an absolute path. :param str source: The path to a package. :param str package_id: The package ID :return: True if successful, otherwise False :rtype: bool CLI Example: .. code-block:: bash salt '*' pkgutil.install source=/vagrant/build_essentials.pkg ...
[ "Install", "a", ".", "pkg", "from", "an", "URI", "or", "an", "absolute", "path", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_pkgutil.py#L85-L112
train
Install a. pkg from an URI or absolute path.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/mac_pkgutil.py
forget
def forget(package_id): ''' .. versionadded:: 2016.3.0 Remove the receipt data about the specified package. Does not remove files. .. warning:: DO NOT use this command to fix broken package design :param str package_id: The name of the package to forget :return: True if successful, o...
python
def forget(package_id): ''' .. versionadded:: 2016.3.0 Remove the receipt data about the specified package. Does not remove files. .. warning:: DO NOT use this command to fix broken package design :param str package_id: The name of the package to forget :return: True if successful, o...
[ "def", "forget", "(", "package_id", ")", ":", "cmd", "=", "'pkgutil --forget {0}'", ".", "format", "(", "package_id", ")", "salt", ".", "utils", ".", "mac_utils", ".", "execute_return_success", "(", "cmd", ")", "return", "not", "is_installed", "(", "package_id...
.. versionadded:: 2016.3.0 Remove the receipt data about the specified package. Does not remove files. .. warning:: DO NOT use this command to fix broken package design :param str package_id: The name of the package to forget :return: True if successful, otherwise False :rtype: bool ...
[ "..", "versionadded", "::", "2016", ".", "3", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_pkgutil.py#L115-L137
train
Forgets the receipt data about the specified package.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/marathon.py
apps
def apps(): ''' Return a list of the currently installed app ids. CLI Example: .. code-block:: bash salt marathon-minion-id marathon.apps ''' response = salt.utils.http.query( "{0}/v2/apps".format(_base_url()), decode_type='json', decode=True, ) return ...
python
def apps(): ''' Return a list of the currently installed app ids. CLI Example: .. code-block:: bash salt marathon-minion-id marathon.apps ''' response = salt.utils.http.query( "{0}/v2/apps".format(_base_url()), decode_type='json', decode=True, ) return ...
[ "def", "apps", "(", ")", ":", "response", "=", "salt", ".", "utils", ".", "http", ".", "query", "(", "\"{0}/v2/apps\"", ".", "format", "(", "_base_url", "(", ")", ")", ",", "decode_type", "=", "'json'", ",", "decode", "=", "True", ",", ")", "return",...
Return a list of the currently installed app ids. CLI Example: .. code-block:: bash salt marathon-minion-id marathon.apps
[ "Return", "a", "list", "of", "the", "currently", "installed", "app", "ids", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/marathon.py#L55-L70
train
Return a list of currently installed app ids.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/marathon.py
update_app
def update_app(id, config): ''' Update the specified app with the given configuration. CLI Example: .. code-block:: bash salt marathon-minion-id marathon.update_app my-app '<config yaml>' ''' if 'id' not in config: config['id'] = id config.pop('version', None) # mirror...
python
def update_app(id, config): ''' Update the specified app with the given configuration. CLI Example: .. code-block:: bash salt marathon-minion-id marathon.update_app my-app '<config yaml>' ''' if 'id' not in config: config['id'] = id config.pop('version', None) # mirror...
[ "def", "update_app", "(", "id", ",", "config", ")", ":", "if", "'id'", "not", "in", "config", ":", "config", "[", "'id'", "]", "=", "id", "config", ".", "pop", "(", "'version'", ",", "None", ")", "# mirror marathon-ui handling for uris deprecation (see", "# ...
Update the specified app with the given configuration. CLI Example: .. code-block:: bash salt marathon-minion-id marathon.update_app my-app '<config yaml>'
[ "Update", "the", "specified", "app", "with", "the", "given", "configuration", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/marathon.py#L104-L141
train
Update an app with the given configuration.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/marathon.py
rm_app
def rm_app(id): ''' Remove the specified app from the server. CLI Example: .. code-block:: bash salt marathon-minion-id marathon.rm_app my-app ''' response = salt.utils.http.query( "{0}/v2/apps/{1}".format(_base_url(), id), method='DELETE', decode_type='json', ...
python
def rm_app(id): ''' Remove the specified app from the server. CLI Example: .. code-block:: bash salt marathon-minion-id marathon.rm_app my-app ''' response = salt.utils.http.query( "{0}/v2/apps/{1}".format(_base_url(), id), method='DELETE', decode_type='json', ...
[ "def", "rm_app", "(", "id", ")", ":", "response", "=", "salt", ".", "utils", ".", "http", ".", "query", "(", "\"{0}/v2/apps/{1}\"", ".", "format", "(", "_base_url", "(", ")", ",", "id", ")", ",", "method", "=", "'DELETE'", ",", "decode_type", "=", "'...
Remove the specified app from the server. CLI Example: .. code-block:: bash salt marathon-minion-id marathon.rm_app my-app
[ "Remove", "the", "specified", "app", "from", "the", "server", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/marathon.py#L144-L160
train
Remove the specified app from the server.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/marathon.py
info
def info(): ''' Return configuration and status information about the marathon instance. CLI Example: .. code-block:: bash salt marathon-minion-id marathon.info ''' response = salt.utils.http.query( "{0}/v2/info".format(_base_url()), decode_type='json', decode=...
python
def info(): ''' Return configuration and status information about the marathon instance. CLI Example: .. code-block:: bash salt marathon-minion-id marathon.info ''' response = salt.utils.http.query( "{0}/v2/info".format(_base_url()), decode_type='json', decode=...
[ "def", "info", "(", ")", ":", "response", "=", "salt", ".", "utils", ".", "http", ".", "query", "(", "\"{0}/v2/info\"", ".", "format", "(", "_base_url", "(", ")", ")", ",", "decode_type", "=", "'json'", ",", "decode", "=", "True", ",", ")", "return",...
Return configuration and status information about the marathon instance. CLI Example: .. code-block:: bash salt marathon-minion-id marathon.info
[ "Return", "configuration", "and", "status", "information", "about", "the", "marathon", "instance", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/marathon.py#L163-L178
train
Return configuration and status information about the marathon instance.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/marathon.py
restart_app
def restart_app(id, restart=False, force=True): ''' Restart the current server configuration for the specified app. :param restart: Restart the app :param force: Override the current deployment CLI Example: .. code-block:: bash salt marathon-minion-id marathon.restart_app my-app ...
python
def restart_app(id, restart=False, force=True): ''' Restart the current server configuration for the specified app. :param restart: Restart the app :param force: Override the current deployment CLI Example: .. code-block:: bash salt marathon-minion-id marathon.restart_app my-app ...
[ "def", "restart_app", "(", "id", ",", "restart", "=", "False", ",", "force", "=", "True", ")", ":", "ret", "=", "{", "'restarted'", ":", "None", "}", "if", "not", "restart", ":", "ret", "[", "'restarted'", "]", "=", "False", "return", "ret", "try", ...
Restart the current server configuration for the specified app. :param restart: Restart the app :param force: Override the current deployment CLI Example: .. code-block:: bash salt marathon-minion-id marathon.restart_app my-app By default, this will only check if the app exists in marat...
[ "Restart", "the", "current", "server", "configuration", "for", "the", "specified", "app", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/marathon.py#L181-L233
train
Restart the specified app.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_dns_client.py
get_dns_servers
def get_dns_servers(interface='Local Area Connection'): ''' Return a list of the configured DNS servers of the specified interface CLI Example: .. code-block:: bash salt '*' win_dns_client.get_dns_servers 'Local Area Connection' ''' # remove any escape characters interface = inter...
python
def get_dns_servers(interface='Local Area Connection'): ''' Return a list of the configured DNS servers of the specified interface CLI Example: .. code-block:: bash salt '*' win_dns_client.get_dns_servers 'Local Area Connection' ''' # remove any escape characters interface = inter...
[ "def", "get_dns_servers", "(", "interface", "=", "'Local Area Connection'", ")", ":", "# remove any escape characters", "interface", "=", "interface", ".", "split", "(", "'\\\\'", ")", "interface", "=", "''", ".", "join", "(", "interface", ")", "with", "salt", "...
Return a list of the configured DNS servers of the specified interface CLI Example: .. code-block:: bash salt '*' win_dns_client.get_dns_servers 'Local Area Connection'
[ "Return", "a", "list", "of", "the", "configured", "DNS", "servers", "of", "the", "specified", "interface" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dns_client.py#L30-L54
train
Return a list of the configured DNS servers of the specified interface
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_dns_client.py
rm_dns
def rm_dns(ip, interface='Local Area Connection'): ''' Remove the DNS server from the network interface CLI Example: .. code-block:: bash salt '*' win_dns_client.rm_dns <ip> <interface> ''' cmd = ['netsh', 'interface', 'ip', 'delete', 'dns', interface, ip, 'validate=no'] return __...
python
def rm_dns(ip, interface='Local Area Connection'): ''' Remove the DNS server from the network interface CLI Example: .. code-block:: bash salt '*' win_dns_client.rm_dns <ip> <interface> ''' cmd = ['netsh', 'interface', 'ip', 'delete', 'dns', interface, ip, 'validate=no'] return __...
[ "def", "rm_dns", "(", "ip", ",", "interface", "=", "'Local Area Connection'", ")", ":", "cmd", "=", "[", "'netsh'", ",", "'interface'", ",", "'ip'", ",", "'delete'", ",", "'dns'", ",", "interface", ",", "ip", ",", "'validate=no'", "]", "return", "__salt__"...
Remove the DNS server from the network interface CLI Example: .. code-block:: bash salt '*' win_dns_client.rm_dns <ip> <interface>
[ "Remove", "the", "DNS", "server", "from", "the", "network", "interface" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dns_client.py#L57-L68
train
Remove the DNS server from the network interface
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_dns_client.py
add_dns
def add_dns(ip, interface='Local Area Connection', index=1): ''' Add the DNS server to the network interface (index starts from 1) Note: if the interface DNS is configured by DHCP, all the DNS servers will be removed from the interface and the requested DNS will be the only one CLI Example: ...
python
def add_dns(ip, interface='Local Area Connection', index=1): ''' Add the DNS server to the network interface (index starts from 1) Note: if the interface DNS is configured by DHCP, all the DNS servers will be removed from the interface and the requested DNS will be the only one CLI Example: ...
[ "def", "add_dns", "(", "ip", ",", "interface", "=", "'Local Area Connection'", ",", "index", "=", "1", ")", ":", "servers", "=", "get_dns_servers", "(", "interface", ")", "# Return False if could not find the interface", "if", "servers", "is", "False", ":", "retur...
Add the DNS server to the network interface (index starts from 1) Note: if the interface DNS is configured by DHCP, all the DNS servers will be removed from the interface and the requested DNS will be the only one CLI Example: .. code-block:: bash salt '*' win_dns_client.add_dns <ip> <in...
[ "Add", "the", "DNS", "server", "to", "the", "network", "interface", "(", "index", "starts", "from", "1", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dns_client.py#L71-L105
train
Add DNS servers to the network interface
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/win_dns_client.py
get_dns_config
def get_dns_config(interface='Local Area Connection'): ''' Get the type of DNS configuration (dhcp / static) CLI Example: .. code-block:: bash salt '*' win_dns_client.get_dns_config 'Local Area Connection' ''' # remove any escape characters interface = interface.split('\\') in...
python
def get_dns_config(interface='Local Area Connection'): ''' Get the type of DNS configuration (dhcp / static) CLI Example: .. code-block:: bash salt '*' win_dns_client.get_dns_config 'Local Area Connection' ''' # remove any escape characters interface = interface.split('\\') in...
[ "def", "get_dns_config", "(", "interface", "=", "'Local Area Connection'", ")", ":", "# remove any escape characters", "interface", "=", "interface", ".", "split", "(", "'\\\\'", ")", "interface", "=", "''", ".", "join", "(", "interface", ")", "with", "salt", "....
Get the type of DNS configuration (dhcp / static) CLI Example: .. code-block:: bash salt '*' win_dns_client.get_dns_config 'Local Area Connection'
[ "Get", "the", "type", "of", "DNS", "configuration", "(", "dhcp", "/", "static", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_dns_client.py#L122-L140
train
Get the type of DNS configuration for the specified interface
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/bower.py
installed
def installed(name, dir, pkgs=None, user=None, env=None): ''' Verify that the given package is installed and is at the correct version (if specified). .. code-block:: yaml underscore: bower.installed: - dir: /path/to...
python
def installed(name, dir, pkgs=None, user=None, env=None): ''' Verify that the given package is installed and is at the correct version (if specified). .. code-block:: yaml underscore: bower.installed: - dir: /path/to...
[ "def", "installed", "(", "name", ",", "dir", ",", "pkgs", "=", "None", ",", "user", "=", "None", ",", "env", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "None", ",", "'comment'", ":", "''", ",", "'changes'...
Verify that the given package is installed and is at the correct version (if specified). .. code-block:: yaml underscore: bower.installed: - dir: /path/to/project - user: someuser jquery#2.0: bower.installed: - dir: /path/to/project ...
[ "Verify", "that", "the", "given", "package", "is", "installed", "and", "is", "at", "the", "correct", "version", "(", "if", "specified", ")", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/bower.py#L49-L190
train
Verify that the given package is installed at the correct version.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/bower.py
bootstrap
def bootstrap(name, user=None): ''' Bootstraps a frontend distribution. Will execute 'bower install' on the specified directory. user The user to run Bower with ''' ret = {'name': name, 'result': None, 'comment': '', 'changes': {}} if __opts__['test']: ret['result'] = Non...
python
def bootstrap(name, user=None): ''' Bootstraps a frontend distribution. Will execute 'bower install' on the specified directory. user The user to run Bower with ''' ret = {'name': name, 'result': None, 'comment': '', 'changes': {}} if __opts__['test']: ret['result'] = Non...
[ "def", "bootstrap", "(", "name", ",", "user", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "None", ",", "'comment'", ":", "''", ",", "'changes'", ":", "{", "}", "}", "if", "__opts__", "[", "'test'", "]", ":...
Bootstraps a frontend distribution. Will execute 'bower install' on the specified directory. user The user to run Bower with
[ "Bootstraps", "a", "frontend", "distribution", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/bower.py#L239-L273
train
Bootstraps a frontend distribution.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/bower.py
pruned
def pruned(name, user=None, env=None): ''' .. versionadded:: 2017.7.0 Cleans up local bower_components directory. Will execute 'bower prune' on the specified directory (param: name) user The user to run Bower with ''' ret = {'name': name, 'result': None, 'comment': '', 'changes':...
python
def pruned(name, user=None, env=None): ''' .. versionadded:: 2017.7.0 Cleans up local bower_components directory. Will execute 'bower prune' on the specified directory (param: name) user The user to run Bower with ''' ret = {'name': name, 'result': None, 'comment': '', 'changes':...
[ "def", "pruned", "(", "name", ",", "user", "=", "None", ",", "env", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "None", ",", "'comment'", ":", "''", ",", "'changes'", ":", "{", "}", "}", "if", "__opts__", ...
.. versionadded:: 2017.7.0 Cleans up local bower_components directory. Will execute 'bower prune' on the specified directory (param: name) user The user to run Bower with
[ "..", "versionadded", "::", "2017", ".", "7", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/bower.py#L276-L310
train
Remove all packages from a directory
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/nfs_export.py
present
def present(name, clients=None, hosts=None, options=None, exports='/etc/exports'): ''' Ensure that the named export is present with the given options name The export path to configure clients A list of hosts and the options applied to the...
python
def present(name, clients=None, hosts=None, options=None, exports='/etc/exports'): ''' Ensure that the named export is present with the given options name The export path to configure clients A list of hosts and the options applied to the...
[ "def", "present", "(", "name", ",", "clients", "=", "None", ",", "hosts", "=", "None", ",", "options", "=", "None", ",", "exports", "=", "'/etc/exports'", ")", ":", "path", "=", "name", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", ...
Ensure that the named export is present with the given options name The export path to configure clients A list of hosts and the options applied to them. This option may not be used in combination with the 'hosts' or 'options' shortcuts. .. code-block:: yaml - cli...
[ "Ensure", "that", "the", "named", "export", "is", "present", "with", "the", "given", "options" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/nfs_export.py#L79-L180
train
Ensure that the named export is present with the given options.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/nfs_export.py
absent
def absent(name, exports='/etc/exports'): ''' Ensure that the named path is not exported name The export path to remove ''' path = name ret = {'name': name, 'changes': {}, 'result': None, 'comment': ''} old = __salt__['nfs3.list_exports'](exports) ...
python
def absent(name, exports='/etc/exports'): ''' Ensure that the named path is not exported name The export path to remove ''' path = name ret = {'name': name, 'changes': {}, 'result': None, 'comment': ''} old = __salt__['nfs3.list_exports'](exports) ...
[ "def", "absent", "(", "name", ",", "exports", "=", "'/etc/exports'", ")", ":", "path", "=", "name", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "None", ",", "'comment'", ":", "''", "}", "old", "=",...
Ensure that the named path is not exported name The export path to remove
[ "Ensure", "that", "the", "named", "path", "is", "not", "exported" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/nfs_export.py#L183-L218
train
Ensure that the named path is not exported by the named export
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/slack.py
query
def query(function, api_key=None, args=None, method='GET', header_dict=None, data=None, opts=None): ''' Slack object method function to construct and execute on the API URL. :param api_key: The Slack api key. :param function: The Slack ...
python
def query(function, api_key=None, args=None, method='GET', header_dict=None, data=None, opts=None): ''' Slack object method function to construct and execute on the API URL. :param api_key: The Slack api key. :param function: The Slack ...
[ "def", "query", "(", "function", ",", "api_key", "=", "None", ",", "args", "=", "None", ",", "method", "=", "'GET'", ",", "header_dict", "=", "None", ",", "data", "=", "None", ",", "opts", "=", "None", ")", ":", "ret", "=", "{", "'message'", ":", ...
Slack object method function to construct and execute on the API URL. :param api_key: The Slack api key. :param function: The Slack api function to perform. :param method: The HTTP method, e.g. GET or POST. :param data: The data to be sent for POST method. :return: The...
[ "Slack", "object", "method", "function", "to", "construct", "and", "execute", "on", "the", "API", "URL", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/slack.py#L32-L131
train
Query the Slack API for a single object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/beacons/pkg.py
validate
def validate(config): ''' Validate the beacon configuration ''' # Configuration for pkg beacon should be a list if not isinstance(config, list): return False, ('Configuration for pkg beacon must be a list.') # Configuration for pkg beacon should contain pkgs pkgs_found = False p...
python
def validate(config): ''' Validate the beacon configuration ''' # Configuration for pkg beacon should be a list if not isinstance(config, list): return False, ('Configuration for pkg beacon must be a list.') # Configuration for pkg beacon should contain pkgs pkgs_found = False p...
[ "def", "validate", "(", "config", ")", ":", "# Configuration for pkg beacon should be a list", "if", "not", "isinstance", "(", "config", ",", "list", ")", ":", "return", "False", ",", "(", "'Configuration for pkg beacon must be a list.'", ")", "# Configuration for pkg bea...
Validate the beacon configuration
[ "Validate", "the", "beacon", "configuration" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/pkg.py#L25-L44
train
Validate the beacon configuration for the current package
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/beacons/pkg.py
beacon
def beacon(config): ''' Check if installed packages are the latest versions and fire an event for those that have upgrades. .. code-block:: yaml beacons: pkg: - pkgs: - zsh - apache2 - refresh: True ''' ret = [] _re...
python
def beacon(config): ''' Check if installed packages are the latest versions and fire an event for those that have upgrades. .. code-block:: yaml beacons: pkg: - pkgs: - zsh - apache2 - refresh: True ''' ret = [] _re...
[ "def", "beacon", "(", "config", ")", ":", "ret", "=", "[", "]", "_refresh", "=", "False", "pkgs", "=", "[", "]", "for", "config_item", "in", "config", ":", "if", "'pkgs'", "in", "config_item", ":", "pkgs", "+=", "config_item", "[", "'pkgs'", "]", "if...
Check if installed packages are the latest versions and fire an event for those that have upgrades. .. code-block:: yaml beacons: pkg: - pkgs: - zsh - apache2 - refresh: True
[ "Check", "if", "installed", "packages", "are", "the", "latest", "versions", "and", "fire", "an", "event", "for", "those", "that", "have", "upgrades", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/pkg.py#L47-L79
train
Check if installed packages are the latest versions Formula and fire an event for those that have upgrades.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/logrotate.py
set_
def set_(name, key, value, setting=None, conf_file=_DEFAULT_CONF): ''' Set a new value for a specific configuration line. :param str key: The command or block to configure. :param str value: The command value or command of the block specified by the key parameter. :param str setting: The command va...
python
def set_(name, key, value, setting=None, conf_file=_DEFAULT_CONF): ''' Set a new value for a specific configuration line. :param str key: The command or block to configure. :param str value: The command value or command of the block specified by the key parameter. :param str setting: The command va...
[ "def", "set_", "(", "name", ",", "key", ",", "value", ",", "setting", "=", "None", ",", "conf_file", "=", "_DEFAULT_CONF", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "dict", "(", ")", ",", "'comment'", ":", "six", ".",...
Set a new value for a specific configuration line. :param str key: The command or block to configure. :param str value: The command value or command of the block specified by the key parameter. :param str setting: The command value for the command specified by the value parameter. :param str conf_file:...
[ "Set", "a", "new", "value", "for", "a", "specific", "configuration", "line", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/logrotate.py#L51-L131
train
Set a specific configuration line for a specific command or block.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileserver/__init__.py
_unlock_cache
def _unlock_cache(w_lock): ''' Unlock a FS file/dir based lock ''' if not os.path.exists(w_lock): return try: if os.path.isdir(w_lock): os.rmdir(w_lock) elif os.path.isfile(w_lock): os.unlink(w_lock) except (OSError, IOError) as exc: log.tr...
python
def _unlock_cache(w_lock): ''' Unlock a FS file/dir based lock ''' if not os.path.exists(w_lock): return try: if os.path.isdir(w_lock): os.rmdir(w_lock) elif os.path.isfile(w_lock): os.unlink(w_lock) except (OSError, IOError) as exc: log.tr...
[ "def", "_unlock_cache", "(", "w_lock", ")", ":", "if", "not", "os", ".", "path", ".", "exists", "(", "w_lock", ")", ":", "return", "try", ":", "if", "os", ".", "path", ".", "isdir", "(", "w_lock", ")", ":", "os", ".", "rmdir", "(", "w_lock", ")",...
Unlock a FS file/dir based lock
[ "Unlock", "a", "FS", "file", "/", "dir", "based", "lock" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/__init__.py#L39-L51
train
Unlock a FS file or dir based lock
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileserver/__init__.py
wait_lock
def wait_lock(lk_fn, dest, wait_timeout=0): ''' If the write lock is there, check to see if the file is actually being written. If there is no change in the file size after a short sleep, remove the lock and move forward. ''' if not os.path.exists(lk_fn): return False if not os.path....
python
def wait_lock(lk_fn, dest, wait_timeout=0): ''' If the write lock is there, check to see if the file is actually being written. If there is no change in the file size after a short sleep, remove the lock and move forward. ''' if not os.path.exists(lk_fn): return False if not os.path....
[ "def", "wait_lock", "(", "lk_fn", ",", "dest", ",", "wait_timeout", "=", "0", ")", ":", "if", "not", "os", ".", "path", ".", "exists", "(", "lk_fn", ")", ":", "return", "False", "if", "not", "os", ".", "path", ".", "exists", "(", "dest", ")", ":"...
If the write lock is there, check to see if the file is actually being written. If there is no change in the file size after a short sleep, remove the lock and move forward.
[ "If", "the", "write", "lock", "is", "there", "check", "to", "see", "if", "the", "file", "is", "actually", "being", "written", ".", "If", "there", "is", "no", "change", "in", "the", "file", "size", "after", "a", "short", "sleep", "remove", "the", "lock"...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/__init__.py#L66-L109
train
Wait until the lock file is written to dest.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileserver/__init__.py
check_file_list_cache
def check_file_list_cache(opts, form, list_cache, w_lock): ''' Checks the cache file to see if there is a new enough file list cache, and returns the match (if found, along with booleans used by the fileserver backend to determine if the cache needs to be refreshed/written). ''' refresh_cache = ...
python
def check_file_list_cache(opts, form, list_cache, w_lock): ''' Checks the cache file to see if there is a new enough file list cache, and returns the match (if found, along with booleans used by the fileserver backend to determine if the cache needs to be refreshed/written). ''' refresh_cache = ...
[ "def", "check_file_list_cache", "(", "opts", ",", "form", ",", "list_cache", ",", "w_lock", ")", ":", "refresh_cache", "=", "False", "save_cache", "=", "True", "serial", "=", "salt", ".", "payload", ".", "Serial", "(", "opts", ")", "wait_lock", "(", "w_loc...
Checks the cache file to see if there is a new enough file list cache, and returns the match (if found, along with booleans used by the fileserver backend to determine if the cache needs to be refreshed/written).
[ "Checks", "the", "cache", "file", "to", "see", "if", "there", "is", "a", "new", "enough", "file", "list", "cache", "and", "returns", "the", "match", "(", "if", "found", "along", "with", "booleans", "used", "by", "the", "fileserver", "backend", "to", "det...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/__init__.py#L112-L173
train
Checks the file list cache to see if there is a new enough file list cache and returns the match.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileserver/__init__.py
write_file_list_cache
def write_file_list_cache(opts, data, list_cache, w_lock): ''' Checks the cache file to see if there is a new enough file list cache, and returns the match (if found, along with booleans used by the fileserver backend to determine if the cache needs to be refreshed/written). ''' serial = salt.pa...
python
def write_file_list_cache(opts, data, list_cache, w_lock): ''' Checks the cache file to see if there is a new enough file list cache, and returns the match (if found, along with booleans used by the fileserver backend to determine if the cache needs to be refreshed/written). ''' serial = salt.pa...
[ "def", "write_file_list_cache", "(", "opts", ",", "data", ",", "list_cache", ",", "w_lock", ")", ":", "serial", "=", "salt", ".", "payload", ".", "Serial", "(", "opts", ")", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "list_cache", "...
Checks the cache file to see if there is a new enough file list cache, and returns the match (if found, along with booleans used by the fileserver backend to determine if the cache needs to be refreshed/written).
[ "Checks", "the", "cache", "file", "to", "see", "if", "there", "is", "a", "new", "enough", "file", "list", "cache", "and", "returns", "the", "match", "(", "if", "found", "along", "with", "booleans", "used", "by", "the", "fileserver", "backend", "to", "det...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/__init__.py#L176-L186
train
Write the file list cache to the file system
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileserver/__init__.py
check_env_cache
def check_env_cache(opts, env_cache): ''' Returns cached env names, if present. Otherwise returns None. ''' if not os.path.isfile(env_cache): return None try: with salt.utils.files.fopen(env_cache, 'rb') as fp_: log.trace('Returning env cache data from %s', env_cache) ...
python
def check_env_cache(opts, env_cache): ''' Returns cached env names, if present. Otherwise returns None. ''' if not os.path.isfile(env_cache): return None try: with salt.utils.files.fopen(env_cache, 'rb') as fp_: log.trace('Returning env cache data from %s', env_cache) ...
[ "def", "check_env_cache", "(", "opts", ",", "env_cache", ")", ":", "if", "not", "os", ".", "path", ".", "isfile", "(", "env_cache", ")", ":", "return", "None", "try", ":", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "env_cache", ",...
Returns cached env names, if present. Otherwise returns None.
[ "Returns", "cached", "env", "names", "if", "present", ".", "Otherwise", "returns", "None", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/__init__.py#L189-L202
train
Returns cached env names if present. Otherwise returns None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileserver/__init__.py
generate_mtime_map
def generate_mtime_map(opts, path_map): ''' Generate a dict of filename -> mtime ''' file_map = {} for saltenv, path_list in six.iteritems(path_map): for path in path_list: for directory, _, filenames in salt.utils.path.os_walk(path): for item in filenames: ...
python
def generate_mtime_map(opts, path_map): ''' Generate a dict of filename -> mtime ''' file_map = {} for saltenv, path_list in six.iteritems(path_map): for path in path_list: for directory, _, filenames in salt.utils.path.os_walk(path): for item in filenames: ...
[ "def", "generate_mtime_map", "(", "opts", ",", "path_map", ")", ":", "file_map", "=", "{", "}", "for", "saltenv", ",", "path_list", "in", "six", ".", "iteritems", "(", "path_map", ")", ":", "for", "path", "in", "path_list", ":", "for", "directory", ",", ...
Generate a dict of filename -> mtime
[ "Generate", "a", "dict", "of", "filename", "-", ">", "mtime" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/__init__.py#L205-L228
train
Generate a dict of filename - > mtime
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileserver/__init__.py
diff_mtime_map
def diff_mtime_map(map1, map2): ''' Is there a change to the mtime map? return a boolean ''' # check if the mtimes are the same if sorted(map1) != sorted(map2): return True # map1 and map2 are guaranteed to have same keys, # so compare mtimes for filename, mtime in six.iteritems...
python
def diff_mtime_map(map1, map2): ''' Is there a change to the mtime map? return a boolean ''' # check if the mtimes are the same if sorted(map1) != sorted(map2): return True # map1 and map2 are guaranteed to have same keys, # so compare mtimes for filename, mtime in six.iteritems...
[ "def", "diff_mtime_map", "(", "map1", ",", "map2", ")", ":", "# check if the mtimes are the same", "if", "sorted", "(", "map1", ")", "!=", "sorted", "(", "map2", ")", ":", "return", "True", "# map1 and map2 are guaranteed to have same keys,", "# so compare mtimes", "f...
Is there a change to the mtime map? return a boolean
[ "Is", "there", "a", "change", "to", "the", "mtime", "map?", "return", "a", "boolean" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/__init__.py#L231-L246
train
Compare mtime map and return a boolean
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileserver/__init__.py
reap_fileserver_cache_dir
def reap_fileserver_cache_dir(cache_base, find_func): ''' Remove unused cache items assuming the cache directory follows a directory convention: cache_base -> saltenv -> relpath ''' for saltenv in os.listdir(cache_base): env_base = os.path.join(cache_base, saltenv) for root, dir...
python
def reap_fileserver_cache_dir(cache_base, find_func): ''' Remove unused cache items assuming the cache directory follows a directory convention: cache_base -> saltenv -> relpath ''' for saltenv in os.listdir(cache_base): env_base = os.path.join(cache_base, saltenv) for root, dir...
[ "def", "reap_fileserver_cache_dir", "(", "cache_base", ",", "find_func", ")", ":", "for", "saltenv", "in", "os", ".", "listdir", "(", "cache_base", ")", ":", "env_base", "=", "os", ".", "path", ".", "join", "(", "cache_base", ",", "saltenv", ")", "for", ...
Remove unused cache items assuming the cache directory follows a directory convention: cache_base -> saltenv -> relpath
[ "Remove", "unused", "cache", "items", "assuming", "the", "cache", "directory", "follows", "a", "directory", "convention", ":" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/__init__.py#L249-L284
train
Reap the fileserver cache directory
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileserver/__init__.py
is_file_ignored
def is_file_ignored(opts, fname): ''' If file_ignore_regex or file_ignore_glob were given in config, compare the given file path against all of them and return True on the first match. ''' if opts['file_ignore_regex']: for regex in opts['file_ignore_regex']: if re.search(rege...
python
def is_file_ignored(opts, fname): ''' If file_ignore_regex or file_ignore_glob were given in config, compare the given file path against all of them and return True on the first match. ''' if opts['file_ignore_regex']: for regex in opts['file_ignore_regex']: if re.search(rege...
[ "def", "is_file_ignored", "(", "opts", ",", "fname", ")", ":", "if", "opts", "[", "'file_ignore_regex'", "]", ":", "for", "regex", "in", "opts", "[", "'file_ignore_regex'", "]", ":", "if", "re", ".", "search", "(", "regex", ",", "fname", ")", ":", "log...
If file_ignore_regex or file_ignore_glob were given in config, compare the given file path against all of them and return True on the first match.
[ "If", "file_ignore_regex", "or", "file_ignore_glob", "were", "given", "in", "config", "compare", "the", "given", "file", "path", "against", "all", "of", "them", "and", "return", "True", "on", "the", "first", "match", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/__init__.py#L287-L310
train
Check if file is ignored.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileserver/__init__.py
clear_lock
def clear_lock(clear_func, role, remote=None, lock_type='update'): ''' Function to allow non-fileserver functions to clear update locks clear_func A function reference. This function will be run (with the ``remote`` param as an argument) to clear the lock, and must return a 2-tuple of ...
python
def clear_lock(clear_func, role, remote=None, lock_type='update'): ''' Function to allow non-fileserver functions to clear update locks clear_func A function reference. This function will be run (with the ``remote`` param as an argument) to clear the lock, and must return a 2-tuple of ...
[ "def", "clear_lock", "(", "clear_func", ",", "role", ",", "remote", "=", "None", ",", "lock_type", "=", "'update'", ")", ":", "msg", "=", "'Clearing {0} lock for {1} remotes'", ".", "format", "(", "lock_type", ",", "role", ")", "if", "remote", ":", "msg", ...
Function to allow non-fileserver functions to clear update locks clear_func A function reference. This function will be run (with the ``remote`` param as an argument) to clear the lock, and must return a 2-tuple of lists, one containing messages describing successfully cleared locks, ...
[ "Function", "to", "allow", "non", "-", "fileserver", "functions", "to", "clear", "update", "locks" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/__init__.py#L313-L340
train
A function that can be used to clear a lock for a remote.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileserver/__init__.py
Fileserver.backends
def backends(self, back=None): ''' Return the backend list ''' if not back: back = self.opts['fileserver_backend'] else: if not isinstance(back, list): try: back = back.split(',') except AttributeError: ...
python
def backends(self, back=None): ''' Return the backend list ''' if not back: back = self.opts['fileserver_backend'] else: if not isinstance(back, list): try: back = back.split(',') except AttributeError: ...
[ "def", "backends", "(", "self", ",", "back", "=", "None", ")", ":", "if", "not", "back", ":", "back", "=", "self", ".", "opts", "[", "'fileserver_backend'", "]", "else", ":", "if", "not", "isinstance", "(", "back", ",", "list", ")", ":", "try", ":"...
Return the backend list
[ "Return", "the", "backend", "list" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/__init__.py#L353-L401
train
Return the backend list of the current state of the file system.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileserver/__init__.py
Fileserver.clear_cache
def clear_cache(self, back=None): ''' Clear the cache of all of the fileserver backends that support the clear_cache function or the named backend(s) only. ''' back = self.backends(back) cleared = [] errors = [] for fsb in back: fstr = '{0}.cle...
python
def clear_cache(self, back=None): ''' Clear the cache of all of the fileserver backends that support the clear_cache function or the named backend(s) only. ''' back = self.backends(back) cleared = [] errors = [] for fsb in back: fstr = '{0}.cle...
[ "def", "clear_cache", "(", "self", ",", "back", "=", "None", ")", ":", "back", "=", "self", ".", "backends", "(", "back", ")", "cleared", "=", "[", "]", "errors", "=", "[", "]", "for", "fsb", "in", "back", ":", "fstr", "=", "'{0}.clear_cache'", "."...
Clear the cache of all of the fileserver backends that support the clear_cache function or the named backend(s) only.
[ "Clear", "the", "cache", "of", "all", "of", "the", "fileserver", "backends", "that", "support", "the", "clear_cache", "function", "or", "the", "named", "backend", "(", "s", ")", "only", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/__init__.py#L418-L438
train
Clear the cache of all of the fileserver backends that support the clear_cache function or the named backend only.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileserver/__init__.py
Fileserver.lock
def lock(self, back=None, remote=None): ''' ``remote`` can either be a dictionary containing repo configuration information, or a pattern. If the latter, then remotes for which the URL matches the pattern will be locked. ''' back = self.backends(back) locked = [] ...
python
def lock(self, back=None, remote=None): ''' ``remote`` can either be a dictionary containing repo configuration information, or a pattern. If the latter, then remotes for which the URL matches the pattern will be locked. ''' back = self.backends(back) locked = [] ...
[ "def", "lock", "(", "self", ",", "back", "=", "None", ",", "remote", "=", "None", ")", ":", "back", "=", "self", ".", "backends", "(", "back", ")", "locked", "=", "[", "]", "errors", "=", "[", "]", "for", "fsb", "in", "back", ":", "fstr", "=", ...
``remote`` can either be a dictionary containing repo configuration information, or a pattern. If the latter, then remotes for which the URL matches the pattern will be locked.
[ "remote", "can", "either", "be", "a", "dictionary", "containing", "repo", "configuration", "information", "or", "a", "pattern", ".", "If", "the", "latter", "then", "remotes", "for", "which", "the", "URL", "matches", "the", "pattern", "will", "be", "locked", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/__init__.py#L440-L466
train
Lock all of the remotes in the backend.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileserver/__init__.py
Fileserver.clear_lock
def clear_lock(self, back=None, remote=None): ''' Clear the update lock for the enabled fileserver backends back Only clear the update lock for the specified backend(s). The default is to clear the lock for all enabled backends remote If specified, t...
python
def clear_lock(self, back=None, remote=None): ''' Clear the update lock for the enabled fileserver backends back Only clear the update lock for the specified backend(s). The default is to clear the lock for all enabled backends remote If specified, t...
[ "def", "clear_lock", "(", "self", ",", "back", "=", "None", ",", "remote", "=", "None", ")", ":", "back", "=", "self", ".", "backends", "(", "back", ")", "cleared", "=", "[", "]", "errors", "=", "[", "]", "for", "fsb", "in", "back", ":", "fstr", ...
Clear the update lock for the enabled fileserver backends back Only clear the update lock for the specified backend(s). The default is to clear the lock for all enabled backends remote If specified, then any remotes which contain the passed string will h...
[ "Clear", "the", "update", "lock", "for", "the", "enabled", "fileserver", "backends" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/__init__.py#L468-L491
train
Clear the update lock for the specified backend and remote.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileserver/__init__.py
Fileserver.update
def update(self, back=None): ''' Update all of the enabled fileserver backends which support the update function, or ''' back = self.backends(back) for fsb in back: fstr = '{0}.update'.format(fsb) if fstr in self.servers: log.debug(...
python
def update(self, back=None): ''' Update all of the enabled fileserver backends which support the update function, or ''' back = self.backends(back) for fsb in back: fstr = '{0}.update'.format(fsb) if fstr in self.servers: log.debug(...
[ "def", "update", "(", "self", ",", "back", "=", "None", ")", ":", "back", "=", "self", ".", "backends", "(", "back", ")", "for", "fsb", "in", "back", ":", "fstr", "=", "'{0}.update'", ".", "format", "(", "fsb", ")", "if", "fstr", "in", "self", "....
Update all of the enabled fileserver backends which support the update function, or
[ "Update", "all", "of", "the", "enabled", "fileserver", "backends", "which", "support", "the", "update", "function", "or" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/__init__.py#L493-L503
train
Update all of the enabled fileserver backends which support the update function.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileserver/__init__.py
Fileserver.update_intervals
def update_intervals(self, back=None): ''' Return the update intervals for all of the enabled fileserver backends which support variable update intervals. ''' back = self.backends(back) ret = {} for fsb in back: fstr = '{0}.update_intervals'.format(fsb...
python
def update_intervals(self, back=None): ''' Return the update intervals for all of the enabled fileserver backends which support variable update intervals. ''' back = self.backends(back) ret = {} for fsb in back: fstr = '{0}.update_intervals'.format(fsb...
[ "def", "update_intervals", "(", "self", ",", "back", "=", "None", ")", ":", "back", "=", "self", ".", "backends", "(", "back", ")", "ret", "=", "{", "}", "for", "fsb", "in", "back", ":", "fstr", "=", "'{0}.update_intervals'", ".", "format", "(", "fsb...
Return the update intervals for all of the enabled fileserver backends which support variable update intervals.
[ "Return", "the", "update", "intervals", "for", "all", "of", "the", "enabled", "fileserver", "backends", "which", "support", "variable", "update", "intervals", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/__init__.py#L505-L516
train
Return the update intervals for all of the enabled fileserver backends which support variable update intervals.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileserver/__init__.py
Fileserver.envs
def envs(self, back=None, sources=False): ''' Return the environments for the named backend or all backends ''' back = self.backends(back) ret = set() if sources: ret = {} for fsb in back: fstr = '{0}.envs'.format(fsb) kwargs = ...
python
def envs(self, back=None, sources=False): ''' Return the environments for the named backend or all backends ''' back = self.backends(back) ret = set() if sources: ret = {} for fsb in back: fstr = '{0}.envs'.format(fsb) kwargs = ...
[ "def", "envs", "(", "self", ",", "back", "=", "None", ",", "sources", "=", "False", ")", ":", "back", "=", "self", ".", "backends", "(", "back", ")", "ret", "=", "set", "(", ")", "if", "sources", ":", "ret", "=", "{", "}", "for", "fsb", "in", ...
Return the environments for the named backend or all backends
[ "Return", "the", "environments", "for", "the", "named", "backend", "or", "all", "backends" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/__init__.py#L518-L538
train
Return the environments for the named backend or all backends
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileserver/__init__.py
Fileserver.file_envs
def file_envs(self, load=None): ''' Return environments for all backends for requests from fileclient ''' if load is None: load = {} load.pop('cmd', None) return self.envs(**load)
python
def file_envs(self, load=None): ''' Return environments for all backends for requests from fileclient ''' if load is None: load = {} load.pop('cmd', None) return self.envs(**load)
[ "def", "file_envs", "(", "self", ",", "load", "=", "None", ")", ":", "if", "load", "is", "None", ":", "load", "=", "{", "}", "load", ".", "pop", "(", "'cmd'", ",", "None", ")", "return", "self", ".", "envs", "(", "*", "*", "load", ")" ]
Return environments for all backends for requests from fileclient
[ "Return", "environments", "for", "all", "backends", "for", "requests", "from", "fileclient" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/__init__.py#L540-L547
train
Return environments for all backends for requests from fileclient Load can be a dict or a dict with cmd = None
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileserver/__init__.py
Fileserver.init
def init(self, back=None): ''' Initialize the backend, only do so if the fs supports an init function ''' back = self.backends(back) for fsb in back: fstr = '{0}.init'.format(fsb) if fstr in self.servers: self.servers[fstr]()
python
def init(self, back=None): ''' Initialize the backend, only do so if the fs supports an init function ''' back = self.backends(back) for fsb in back: fstr = '{0}.init'.format(fsb) if fstr in self.servers: self.servers[fstr]()
[ "def", "init", "(", "self", ",", "back", "=", "None", ")", ":", "back", "=", "self", ".", "backends", "(", "back", ")", "for", "fsb", "in", "back", ":", "fstr", "=", "'{0}.init'", ".", "format", "(", "fsb", ")", "if", "fstr", "in", "self", ".", ...
Initialize the backend, only do so if the fs supports an init function
[ "Initialize", "the", "backend", "only", "do", "so", "if", "the", "fs", "supports", "an", "init", "function" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/__init__.py#L549-L557
train
Initialize the backend only do so if the fs supports an init function
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileserver/__init__.py
Fileserver._find_file
def _find_file(self, load): ''' Convenience function for calls made using the RemoteClient ''' path = load.get('path') if not path: return {'path': '', 'rel': ''} tgt_env = load.get('saltenv', 'base') return self.find_file(path, tgt...
python
def _find_file(self, load): ''' Convenience function for calls made using the RemoteClient ''' path = load.get('path') if not path: return {'path': '', 'rel': ''} tgt_env = load.get('saltenv', 'base') return self.find_file(path, tgt...
[ "def", "_find_file", "(", "self", ",", "load", ")", ":", "path", "=", "load", ".", "get", "(", "'path'", ")", "if", "not", "path", ":", "return", "{", "'path'", ":", "''", ",", "'rel'", ":", "''", "}", "tgt_env", "=", "load", ".", "get", "(", "...
Convenience function for calls made using the RemoteClient
[ "Convenience", "function", "for", "calls", "made", "using", "the", "RemoteClient" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/__init__.py#L559-L568
train
Internal method to find the file in the cache
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileserver/__init__.py
Fileserver.file_find
def file_find(self, load): ''' Convenience function for calls made using the LocalClient ''' path = load.get('path') if not path: return {'path': '', 'rel': ''} tgt_env = load.get('saltenv', 'base') return self.find_file(path, tgt_e...
python
def file_find(self, load): ''' Convenience function for calls made using the LocalClient ''' path = load.get('path') if not path: return {'path': '', 'rel': ''} tgt_env = load.get('saltenv', 'base') return self.find_file(path, tgt_e...
[ "def", "file_find", "(", "self", ",", "load", ")", ":", "path", "=", "load", ".", "get", "(", "'path'", ")", "if", "not", "path", ":", "return", "{", "'path'", ":", "''", ",", "'rel'", ":", "''", "}", "tgt_env", "=", "load", ".", "get", "(", "'...
Convenience function for calls made using the LocalClient
[ "Convenience", "function", "for", "calls", "made", "using", "the", "LocalClient" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/__init__.py#L570-L579
train
Convenience function for calling the find_file method of the LocalClient
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileserver/__init__.py
Fileserver.find_file
def find_file(self, path, saltenv, back=None): ''' Find the path and return the fnd structure, this structure is passed to other backend interfaces. ''' path = salt.utils.stringutils.to_unicode(path) saltenv = salt.utils.stringutils.to_unicode(saltenv) back = self...
python
def find_file(self, path, saltenv, back=None): ''' Find the path and return the fnd structure, this structure is passed to other backend interfaces. ''' path = salt.utils.stringutils.to_unicode(path) saltenv = salt.utils.stringutils.to_unicode(saltenv) back = self...
[ "def", "find_file", "(", "self", ",", "path", ",", "saltenv", ",", "back", "=", "None", ")", ":", "path", "=", "salt", ".", "utils", ".", "stringutils", ".", "to_unicode", "(", "path", ")", "saltenv", "=", "salt", ".", "utils", ".", "stringutils", "....
Find the path and return the fnd structure, this structure is passed to other backend interfaces.
[ "Find", "the", "path", "and", "return", "the", "fnd", "structure", "this", "structure", "is", "passed", "to", "other", "backend", "interfaces", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/__init__.py#L581-L627
train
Find the path and return the fnd structure
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileserver/__init__.py
Fileserver.serve_file
def serve_file(self, load): ''' Serve up a chunk of a file ''' ret = {'data': '', 'dest': ''} if 'env' in load: # "env" is not supported; Use "saltenv". load.pop('env') if 'path' not in load or 'loc' not in load or 'saltenv' not in...
python
def serve_file(self, load): ''' Serve up a chunk of a file ''' ret = {'data': '', 'dest': ''} if 'env' in load: # "env" is not supported; Use "saltenv". load.pop('env') if 'path' not in load or 'loc' not in load or 'saltenv' not in...
[ "def", "serve_file", "(", "self", ",", "load", ")", ":", "ret", "=", "{", "'data'", ":", "''", ",", "'dest'", ":", "''", "}", "if", "'env'", "in", "load", ":", "# \"env\" is not supported; Use \"saltenv\".", "load", ".", "pop", "(", "'env'", ")", "if", ...
Serve up a chunk of a file
[ "Serve", "up", "a", "chunk", "of", "a", "file" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/__init__.py#L629-L651
train
Serve up a chunk of a file
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileserver/__init__.py
Fileserver.__file_hash_and_stat
def __file_hash_and_stat(self, load): ''' Common code for hashing and stating files ''' if 'env' in load: # "env" is not supported; Use "saltenv". load.pop('env') if 'path' not in load or 'saltenv' not in load: return '', None if not i...
python
def __file_hash_and_stat(self, load): ''' Common code for hashing and stating files ''' if 'env' in load: # "env" is not supported; Use "saltenv". load.pop('env') if 'path' not in load or 'saltenv' not in load: return '', None if not i...
[ "def", "__file_hash_and_stat", "(", "self", ",", "load", ")", ":", "if", "'env'", "in", "load", ":", "# \"env\" is not supported; Use \"saltenv\".", "load", ".", "pop", "(", "'env'", ")", "if", "'path'", "not", "in", "load", "or", "'saltenv'", "not", "in", "...
Common code for hashing and stating files
[ "Common", "code", "for", "hashing", "and", "stating", "files" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/__init__.py#L653-L674
train
Common code for hashing and stating files
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileserver/__init__.py
Fileserver.clear_file_list_cache
def clear_file_list_cache(self, load): ''' Deletes the file_lists cache files ''' if 'env' in load: # "env" is not supported; Use "saltenv". load.pop('env') saltenv = load.get('saltenv', []) if saltenv is not None: if not isinstance(sa...
python
def clear_file_list_cache(self, load): ''' Deletes the file_lists cache files ''' if 'env' in load: # "env" is not supported; Use "saltenv". load.pop('env') saltenv = load.get('saltenv', []) if saltenv is not None: if not isinstance(sa...
[ "def", "clear_file_list_cache", "(", "self", ",", "load", ")", ":", "if", "'env'", "in", "load", ":", "# \"env\" is not supported; Use \"saltenv\".", "load", ".", "pop", "(", "'env'", ")", "saltenv", "=", "load", ".", "get", "(", "'saltenv'", ",", "[", "]", ...
Deletes the file_lists cache files
[ "Deletes", "the", "file_lists", "cache", "files" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/__init__.py#L694-L769
train
Delete the file_lists cache files for the specified environment
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileserver/__init__.py
Fileserver.file_list
def file_list(self, load): ''' Return a list of files from the dominant environment ''' if 'env' in load: # "env" is not supported; Use "saltenv". load.pop('env') ret = set() if 'saltenv' not in load: return [] if not isinstanc...
python
def file_list(self, load): ''' Return a list of files from the dominant environment ''' if 'env' in load: # "env" is not supported; Use "saltenv". load.pop('env') ret = set() if 'saltenv' not in load: return [] if not isinstanc...
[ "def", "file_list", "(", "self", ",", "load", ")", ":", "if", "'env'", "in", "load", ":", "# \"env\" is not supported; Use \"saltenv\".", "load", ".", "pop", "(", "'env'", ")", "ret", "=", "set", "(", ")", "if", "'saltenv'", "not", "in", "load", ":", "re...
Return a list of files from the dominant environment
[ "Return", "a", "list", "of", "files", "from", "the", "dominant", "environment" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/__init__.py#L772-L794
train
Return a list of files from the dominant environment
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileserver/__init__.py
Fileserver.symlink_list
def symlink_list(self, load): ''' Return a list of symlinked files and dirs ''' if 'env' in load: # "env" is not supported; Use "saltenv". load.pop('env') ret = {} if 'saltenv' not in load: return {} if not isinstance(load['sal...
python
def symlink_list(self, load): ''' Return a list of symlinked files and dirs ''' if 'env' in load: # "env" is not supported; Use "saltenv". load.pop('env') ret = {} if 'saltenv' not in load: return {} if not isinstance(load['sal...
[ "def", "symlink_list", "(", "self", ",", "load", ")", ":", "if", "'env'", "in", "load", ":", "# \"env\" is not supported; Use \"saltenv\".", "load", ".", "pop", "(", "'env'", ")", "ret", "=", "{", "}", "if", "'saltenv'", "not", "in", "load", ":", "return",...
Return a list of symlinked files and dirs
[ "Return", "a", "list", "of", "symlinked", "files", "and", "dirs" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/__init__.py#L847-L871
train
Return a list of symlinked files and directories and directories.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/fileserver/__init__.py
FSChan.send
def send(self, load, tries=None, timeout=None, raw=False): # pylint: disable=unused-argument ''' Emulate the channel send method, the tries and timeout are not used ''' if 'cmd' not in load: log.error('Malformed request, no cmd: %s', load) return {} cmd =...
python
def send(self, load, tries=None, timeout=None, raw=False): # pylint: disable=unused-argument ''' Emulate the channel send method, the tries and timeout are not used ''' if 'cmd' not in load: log.error('Malformed request, no cmd: %s', load) return {} cmd =...
[ "def", "send", "(", "self", ",", "load", ",", "tries", "=", "None", ",", "timeout", "=", "None", ",", "raw", "=", "False", ")", ":", "# pylint: disable=unused-argument", "if", "'cmd'", "not", "in", "load", ":", "log", ".", "error", "(", "'Malformed reque...
Emulate the channel send method, the tries and timeout are not used
[ "Emulate", "the", "channel", "send", "method", "the", "tries", "and", "timeout", "are", "not", "used" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/__init__.py#L893-L906
train
Emulate the channel send method.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/renderers/dson.py
render
def render(dson_input, saltenv='base', sls='', **kwargs): ''' Accepts DSON data as a string or as a file object and runs it through the JSON parser. :rtype: A Python data structure ''' if not isinstance(dson_input, six.string_types): dson_input = dson_input.read() log.debug('DSON i...
python
def render(dson_input, saltenv='base', sls='', **kwargs): ''' Accepts DSON data as a string or as a file object and runs it through the JSON parser. :rtype: A Python data structure ''' if not isinstance(dson_input, six.string_types): dson_input = dson_input.read() log.debug('DSON i...
[ "def", "render", "(", "dson_input", ",", "saltenv", "=", "'base'", ",", "sls", "=", "''", ",", "*", "*", "kwargs", ")", ":", "if", "not", "isinstance", "(", "dson_input", ",", "six", ".", "string_types", ")", ":", "dson_input", "=", "dson_input", ".", ...
Accepts DSON data as a string or as a file object and runs it through the JSON parser. :rtype: A Python data structure
[ "Accepts", "DSON", "data", "as", "a", "string", "or", "as", "a", "file", "object", "and", "runs", "it", "through", "the", "JSON", "parser", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/renderers/dson.py#L37-L53
train
Takes DSON data as a string or as a file object and runs it through the JSON parser.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/roster/scan.py
targets
def targets(tgt, tgt_type='glob', **kwargs): ''' Return the targets from the flat yaml file, checks opts for location but defaults to /etc/salt/roster ''' rmatcher = RosterMatcher(tgt, tgt_type) return rmatcher.targets()
python
def targets(tgt, tgt_type='glob', **kwargs): ''' Return the targets from the flat yaml file, checks opts for location but defaults to /etc/salt/roster ''' rmatcher = RosterMatcher(tgt, tgt_type) return rmatcher.targets()
[ "def", "targets", "(", "tgt", ",", "tgt_type", "=", "'glob'", ",", "*", "*", "kwargs", ")", ":", "rmatcher", "=", "RosterMatcher", "(", "tgt", ",", "tgt_type", ")", "return", "rmatcher", ".", "targets", "(", ")" ]
Return the targets from the flat yaml file, checks opts for location but defaults to /etc/salt/roster
[ "Return", "the", "targets", "from", "the", "flat", "yaml", "file", "checks", "opts", "for", "location", "but", "defaults", "to", "/", "etc", "/", "salt", "/", "roster" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/roster/scan.py#L23-L29
train
Return the targets from the flat yaml file
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/roster/scan.py
RosterMatcher.targets
def targets(self): ''' Return ip addrs based on netmask, sitting in the "glob" spot because it is the default ''' addrs = () ret = {} ports = __opts__['ssh_scan_ports'] if not isinstance(ports, list): # Comma-separate list of integers ...
python
def targets(self): ''' Return ip addrs based on netmask, sitting in the "glob" spot because it is the default ''' addrs = () ret = {} ports = __opts__['ssh_scan_ports'] if not isinstance(ports, list): # Comma-separate list of integers ...
[ "def", "targets", "(", "self", ")", ":", "addrs", "=", "(", ")", "ret", "=", "{", "}", "ports", "=", "__opts__", "[", "'ssh_scan_ports'", "]", "if", "not", "isinstance", "(", "ports", ",", "list", ")", ":", "# Comma-separate list of integers", "ports", "...
Return ip addrs based on netmask, sitting in the "glob" spot because it is the default
[ "Return", "ip", "addrs", "based", "on", "netmask", "sitting", "in", "the", "glob", "spot", "because", "it", "is", "the", "default" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/roster/scan.py#L40-L73
train
Return ip addrs based on netmask sitting in the glob spot because it is the default
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/jsonnet.py
evaluate
def evaluate(contents, jsonnet_library_paths=None): ''' Evaluate a jsonnet input string. contents Raw jsonnet string to evaluate. jsonnet_library_paths List of jsonnet library paths. ''' if not jsonnet_library_paths: jsonnet_library_paths = __salt__['config.option']( ...
python
def evaluate(contents, jsonnet_library_paths=None): ''' Evaluate a jsonnet input string. contents Raw jsonnet string to evaluate. jsonnet_library_paths List of jsonnet library paths. ''' if not jsonnet_library_paths: jsonnet_library_paths = __salt__['config.option']( ...
[ "def", "evaluate", "(", "contents", ",", "jsonnet_library_paths", "=", "None", ")", ":", "if", "not", "jsonnet_library_paths", ":", "jsonnet_library_paths", "=", "__salt__", "[", "'config.option'", "]", "(", "'jsonnet.library_paths'", ",", "[", "'.'", "]", ")", ...
Evaluate a jsonnet input string. contents Raw jsonnet string to evaluate. jsonnet_library_paths List of jsonnet library paths.
[ "Evaluate", "a", "jsonnet", "input", "string", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/jsonnet.py#L71-L90
train
Evaluate a jsonnet input string.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/solaris_fmadm.py
_parse_fmdump
def _parse_fmdump(output): ''' Parses fmdump output ''' result = [] output = output.split("\n") # extract header header = [field for field in output[0].lower().split(" ") if field] del output[0] # parse entries for entry in output: entry = [item for item in entry.split(...
python
def _parse_fmdump(output): ''' Parses fmdump output ''' result = [] output = output.split("\n") # extract header header = [field for field in output[0].lower().split(" ") if field] del output[0] # parse entries for entry in output: entry = [item for item in entry.split(...
[ "def", "_parse_fmdump", "(", "output", ")", ":", "result", "=", "[", "]", "output", "=", "output", ".", "split", "(", "\"\\n\"", ")", "# extract header", "header", "=", "[", "field", "for", "field", "in", "output", "[", "0", "]", ".", "lower", "(", "...
Parses fmdump output
[ "Parses", "fmdump", "output" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_fmadm.py#L63-L86
train
Parses fmdump output into a list of dicts
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/solaris_fmadm.py
_parse_fmdump_verbose
def _parse_fmdump_verbose(output): ''' Parses fmdump verbose output ''' result = [] output = output.split("\n") fault = [] verbose_fault = {} for line in output: if line.startswith('TIME'): fault.append(line) if verbose_fault: result.appen...
python
def _parse_fmdump_verbose(output): ''' Parses fmdump verbose output ''' result = [] output = output.split("\n") fault = [] verbose_fault = {} for line in output: if line.startswith('TIME'): fault.append(line) if verbose_fault: result.appen...
[ "def", "_parse_fmdump_verbose", "(", "output", ")", ":", "result", "=", "[", "]", "output", "=", "output", ".", "split", "(", "\"\\n\"", ")", "fault", "=", "[", "]", "verbose_fault", "=", "{", "}", "for", "line", "in", "output", ":", "if", "line", "....
Parses fmdump verbose output
[ "Parses", "fmdump", "verbose", "output" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_fmadm.py#L89-L120
train
Parses fmdump verbose output into a list of dicts.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/solaris_fmadm.py
_parse_fmadm_config
def _parse_fmadm_config(output): ''' Parsbb fmdump/fmadm output ''' result = [] output = output.split("\n") # extract header header = [field for field in output[0].lower().split(" ") if field] del output[0] # parse entries for entry in output: entry = [item for item in ...
python
def _parse_fmadm_config(output): ''' Parsbb fmdump/fmadm output ''' result = [] output = output.split("\n") # extract header header = [field for field in output[0].lower().split(" ") if field] del output[0] # parse entries for entry in output: entry = [item for item in ...
[ "def", "_parse_fmadm_config", "(", "output", ")", ":", "result", "=", "[", "]", "output", "=", "output", ".", "split", "(", "\"\\n\"", ")", "# extract header", "header", "=", "[", "field", "for", "field", "in", "output", "[", "0", "]", ".", "lower", "(...
Parsbb fmdump/fmadm output
[ "Parsbb", "fmdump", "/", "fmadm", "output" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_fmadm.py#L123-L154
train
Parses the output of fmadm config and returns a list of dictionaries
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/solaris_fmadm.py
_fmadm_action_fmri
def _fmadm_action_fmri(action, fmri): ''' Internal function for fmadm.repqired, fmadm.replaced, fmadm.flush ''' ret = {} fmadm = _check_fmadm() cmd = '{cmd} {action} {fmri}'.format( cmd=fmadm, action=action, fmri=fmri ) res = __salt__['cmd.run_all'](cmd) retco...
python
def _fmadm_action_fmri(action, fmri): ''' Internal function for fmadm.repqired, fmadm.replaced, fmadm.flush ''' ret = {} fmadm = _check_fmadm() cmd = '{cmd} {action} {fmri}'.format( cmd=fmadm, action=action, fmri=fmri ) res = __salt__['cmd.run_all'](cmd) retco...
[ "def", "_fmadm_action_fmri", "(", "action", ",", "fmri", ")", ":", "ret", "=", "{", "}", "fmadm", "=", "_check_fmadm", "(", ")", "cmd", "=", "'{cmd} {action} {fmri}'", ".", "format", "(", "cmd", "=", "fmadm", ",", "action", "=", "action", ",", "fmri", ...
Internal function for fmadm.repqired, fmadm.replaced, fmadm.flush
[ "Internal", "function", "for", "fmadm", ".", "repqired", "fmadm", ".", "replaced", "fmadm", ".", "flush" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_fmadm.py#L157-L176
train
Internal function for fmadm. repqired fmadm. replaced fmadm. flush Internal function for fmadm. replaced fmadm. flush
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/solaris_fmadm.py
_parse_fmadm_faulty
def _parse_fmadm_faulty(output): ''' Parse fmadm faulty output ''' def _merge_data(summary, fault): result = {} uuid = summary['event-id'] del summary['event-id'] result[uuid] = OrderedDict() result[uuid]['summary'] = summary result[uuid]['fault'] = fault...
python
def _parse_fmadm_faulty(output): ''' Parse fmadm faulty output ''' def _merge_data(summary, fault): result = {} uuid = summary['event-id'] del summary['event-id'] result[uuid] = OrderedDict() result[uuid]['summary'] = summary result[uuid]['fault'] = fault...
[ "def", "_parse_fmadm_faulty", "(", "output", ")", ":", "def", "_merge_data", "(", "summary", ",", "fault", ")", ":", "result", "=", "{", "}", "uuid", "=", "summary", "[", "'event-id'", "]", "del", "summary", "[", "'event-id'", "]", "result", "[", "uuid",...
Parse fmadm faulty output
[ "Parse", "fmadm", "faulty", "output" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_fmadm.py#L179-L246
train
Parse fmadm faulty output
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/solaris_fmadm.py
list_records
def list_records(after=None, before=None): ''' Display fault management logs after : string filter events after time, see man fmdump for format before : string filter events before time, see man fmdump for format CLI Example: .. code-block:: bash salt '*' fmadm.list ...
python
def list_records(after=None, before=None): ''' Display fault management logs after : string filter events after time, see man fmdump for format before : string filter events before time, see man fmdump for format CLI Example: .. code-block:: bash salt '*' fmadm.list ...
[ "def", "list_records", "(", "after", "=", "None", ",", "before", "=", "None", ")", ":", "ret", "=", "{", "}", "fmdump", "=", "_check_fmdump", "(", ")", "cmd", "=", "'{cmd}{after}{before}'", ".", "format", "(", "cmd", "=", "fmdump", ",", "after", "=", ...
Display fault management logs after : string filter events after time, see man fmdump for format before : string filter events before time, see man fmdump for format CLI Example: .. code-block:: bash salt '*' fmadm.list
[ "Display", "fault", "management", "logs" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_fmadm.py#L249-L280
train
Display fault management logs for a set of events.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/solaris_fmadm.py
show
def show(uuid): ''' Display log details uuid: string uuid of fault CLI Example: .. code-block:: bash salt '*' fmadm.show 11b4070f-4358-62fa-9e1e-998f485977e1 ''' ret = {} fmdump = _check_fmdump() cmd = '{cmd} -u {uuid} -V'.format( cmd=fmdump, uuid=...
python
def show(uuid): ''' Display log details uuid: string uuid of fault CLI Example: .. code-block:: bash salt '*' fmadm.show 11b4070f-4358-62fa-9e1e-998f485977e1 ''' ret = {} fmdump = _check_fmdump() cmd = '{cmd} -u {uuid} -V'.format( cmd=fmdump, uuid=...
[ "def", "show", "(", "uuid", ")", ":", "ret", "=", "{", "}", "fmdump", "=", "_check_fmdump", "(", ")", "cmd", "=", "'{cmd} -u {uuid} -V'", ".", "format", "(", "cmd", "=", "fmdump", ",", "uuid", "=", "uuid", ")", "res", "=", "__salt__", "[", "'cmd.run_...
Display log details uuid: string uuid of fault CLI Example: .. code-block:: bash salt '*' fmadm.show 11b4070f-4358-62fa-9e1e-998f485977e1
[ "Display", "log", "details" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_fmadm.py#L283-L310
train
Display log details of fault
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/solaris_fmadm.py
config
def config(): ''' Display fault manager configuration CLI Example: .. code-block:: bash salt '*' fmadm.config ''' ret = {} fmadm = _check_fmadm() cmd = '{cmd} config'.format( cmd=fmadm ) res = __salt__['cmd.run_all'](cmd) retcode = res['retcode'] result...
python
def config(): ''' Display fault manager configuration CLI Example: .. code-block:: bash salt '*' fmadm.config ''' ret = {} fmadm = _check_fmadm() cmd = '{cmd} config'.format( cmd=fmadm ) res = __salt__['cmd.run_all'](cmd) retcode = res['retcode'] result...
[ "def", "config", "(", ")", ":", "ret", "=", "{", "}", "fmadm", "=", "_check_fmadm", "(", ")", "cmd", "=", "'{cmd} config'", ".", "format", "(", "cmd", "=", "fmadm", ")", "res", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "cmd", ")", "retcode", ...
Display fault manager configuration CLI Example: .. code-block:: bash salt '*' fmadm.config
[ "Display", "fault", "manager", "configuration" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_fmadm.py#L313-L336
train
Display fault manager configuration
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/solaris_fmadm.py
load
def load(path): ''' Load specified fault manager module path: string path of fault manager module CLI Example: .. code-block:: bash salt '*' fmadm.load /module/path ''' ret = {} fmadm = _check_fmadm() cmd = '{cmd} load {path}'.format( cmd=fmadm, pa...
python
def load(path): ''' Load specified fault manager module path: string path of fault manager module CLI Example: .. code-block:: bash salt '*' fmadm.load /module/path ''' ret = {} fmadm = _check_fmadm() cmd = '{cmd} load {path}'.format( cmd=fmadm, pa...
[ "def", "load", "(", "path", ")", ":", "ret", "=", "{", "}", "fmadm", "=", "_check_fmadm", "(", ")", "cmd", "=", "'{cmd} load {path}'", ".", "format", "(", "cmd", "=", "fmadm", ",", "path", "=", "path", ")", "res", "=", "__salt__", "[", "'cmd.run_all'...
Load specified fault manager module path: string path of fault manager module CLI Example: .. code-block:: bash salt '*' fmadm.load /module/path
[ "Load", "specified", "fault", "manager", "module" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_fmadm.py#L339-L366
train
Load specified fault manager module
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/solaris_fmadm.py
unload
def unload(module): ''' Unload specified fault manager module module: string module to unload CLI Example: .. code-block:: bash salt '*' fmadm.unload software-response ''' ret = {} fmadm = _check_fmadm() cmd = '{cmd} unload {module}'.format( cmd=fmadm, ...
python
def unload(module): ''' Unload specified fault manager module module: string module to unload CLI Example: .. code-block:: bash salt '*' fmadm.unload software-response ''' ret = {} fmadm = _check_fmadm() cmd = '{cmd} unload {module}'.format( cmd=fmadm, ...
[ "def", "unload", "(", "module", ")", ":", "ret", "=", "{", "}", "fmadm", "=", "_check_fmadm", "(", ")", "cmd", "=", "'{cmd} unload {module}'", ".", "format", "(", "cmd", "=", "fmadm", ",", "module", "=", "module", ")", "res", "=", "__salt__", "[", "'...
Unload specified fault manager module module: string module to unload CLI Example: .. code-block:: bash salt '*' fmadm.unload software-response
[ "Unload", "specified", "fault", "manager", "module" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_fmadm.py#L369-L396
train
Unload specified fault manager module
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/solaris_fmadm.py
reset
def reset(module, serd=None): ''' Reset module or sub-component module: string module to unload serd : string serd sub module CLI Example: .. code-block:: bash salt '*' fmadm.reset software-response ''' ret = {} fmadm = _check_fmadm() cmd = '{cmd} rese...
python
def reset(module, serd=None): ''' Reset module or sub-component module: string module to unload serd : string serd sub module CLI Example: .. code-block:: bash salt '*' fmadm.reset software-response ''' ret = {} fmadm = _check_fmadm() cmd = '{cmd} rese...
[ "def", "reset", "(", "module", ",", "serd", "=", "None", ")", ":", "ret", "=", "{", "}", "fmadm", "=", "_check_fmadm", "(", ")", "cmd", "=", "'{cmd} reset {serd}{module}'", ".", "format", "(", "cmd", "=", "fmadm", ",", "serd", "=", "'-s {0} '", ".", ...
Reset module or sub-component module: string module to unload serd : string serd sub module CLI Example: .. code-block:: bash salt '*' fmadm.reset software-response
[ "Reset", "module", "or", "sub", "-", "component" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_fmadm.py#L399-L429
train
Reset the specified module or sub - component of the specified module
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/solaris_fmadm.py
faulty
def faulty(): ''' Display list of faulty resources CLI Example: .. code-block:: bash salt '*' fmadm.faulty ''' fmadm = _check_fmadm() cmd = '{cmd} faulty'.format( cmd=fmadm, ) res = __salt__['cmd.run_all'](cmd) result = {} if res['stdout'] == '': re...
python
def faulty(): ''' Display list of faulty resources CLI Example: .. code-block:: bash salt '*' fmadm.faulty ''' fmadm = _check_fmadm() cmd = '{cmd} faulty'.format( cmd=fmadm, ) res = __salt__['cmd.run_all'](cmd) result = {} if res['stdout'] == '': re...
[ "def", "faulty", "(", ")", ":", "fmadm", "=", "_check_fmadm", "(", ")", "cmd", "=", "'{cmd} faulty'", ".", "format", "(", "cmd", "=", "fmadm", ",", ")", "res", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "cmd", ")", "result", "=", "{", "}", "i...
Display list of faulty resources CLI Example: .. code-block:: bash salt '*' fmadm.faulty
[ "Display", "list", "of", "faulty", "resources" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_fmadm.py#L496-L517
train
Display list of faulty resources
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/parted_partition.py
_validate_device
def _validate_device(device): ''' Ensure the device name supplied is valid in a manner similar to the `exists` function, but raise errors on invalid input rather than return False. This function only validates a block device, it does not check if the block device is a drive or a partition or a ...
python
def _validate_device(device): ''' Ensure the device name supplied is valid in a manner similar to the `exists` function, but raise errors on invalid input rather than return False. This function only validates a block device, it does not check if the block device is a drive or a partition or a ...
[ "def", "_validate_device", "(", "device", ")", ":", "if", "os", ".", "path", ".", "exists", "(", "device", ")", ":", "dev", "=", "os", ".", "stat", "(", "device", ")", ".", "st_mode", "if", "stat", ".", "S_ISBLK", "(", "dev", ")", ":", "return", ...
Ensure the device name supplied is valid in a manner similar to the `exists` function, but raise errors on invalid input rather than return False. This function only validates a block device, it does not check if the block device is a drive or a partition or a filesystem, etc.
[ "Ensure", "the", "device", "name", "supplied", "is", "valid", "in", "a", "manner", "similar", "to", "the", "exists", "function", "but", "raise", "errors", "on", "invalid", "input", "rather", "than", "return", "False", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parted_partition.py#L80-L97
train
Validate the device name supplied to the block device module.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/parted_partition.py
_validate_partition_boundary
def _validate_partition_boundary(boundary): ''' Ensure valid partition boundaries are supplied. ''' boundary = six.text_type(boundary) match = re.search(r'^([\d.]+)(\D*)$', boundary) if match: unit = match.group(2) if not unit or unit in VALID_UNITS: return raise ...
python
def _validate_partition_boundary(boundary): ''' Ensure valid partition boundaries are supplied. ''' boundary = six.text_type(boundary) match = re.search(r'^([\d.]+)(\D*)$', boundary) if match: unit = match.group(2) if not unit or unit in VALID_UNITS: return raise ...
[ "def", "_validate_partition_boundary", "(", "boundary", ")", ":", "boundary", "=", "six", ".", "text_type", "(", "boundary", ")", "match", "=", "re", ".", "search", "(", "r'^([\\d.]+)(\\D*)$'", ",", "boundary", ")", "if", "match", ":", "unit", "=", "match", ...
Ensure valid partition boundaries are supplied.
[ "Ensure", "valid", "partition", "boundaries", "are", "supplied", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parted_partition.py#L100-L112
train
Ensure valid partition boundaries are supplied.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/parted_partition.py
probe
def probe(*devices): ''' Ask the kernel to update its local partition data. When no args are specified all block devices are tried. Caution: Generally only works on devices with no mounted partitions and may take a long time to return if specified devices are in use. CLI Examples: .. code...
python
def probe(*devices): ''' Ask the kernel to update its local partition data. When no args are specified all block devices are tried. Caution: Generally only works on devices with no mounted partitions and may take a long time to return if specified devices are in use. CLI Examples: .. code...
[ "def", "probe", "(", "*", "devices", ")", ":", "for", "device", "in", "devices", ":", "_validate_device", "(", "device", ")", "cmd", "=", "'partprobe -- {0}'", ".", "format", "(", "\" \"", ".", "join", "(", "devices", ")", ")", "out", "=", "__salt__", ...
Ask the kernel to update its local partition data. When no args are specified all block devices are tried. Caution: Generally only works on devices with no mounted partitions and may take a long time to return if specified devices are in use. CLI Examples: .. code-block:: bash salt '*' p...
[ "Ask", "the", "kernel", "to", "update", "its", "local", "partition", "data", ".", "When", "no", "args", "are", "specified", "all", "block", "devices", "are", "tried", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parted_partition.py#L115-L136
train
Ask the kernel to update its local partition data.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/parted_partition.py
list_
def list_(device, unit=None): ''' Prints partition information of given <device> CLI Examples: .. code-block:: bash salt '*' partition.list /dev/sda salt '*' partition.list /dev/sda unit=s salt '*' partition.list /dev/sda unit=kB ''' _validate_device(device) if un...
python
def list_(device, unit=None): ''' Prints partition information of given <device> CLI Examples: .. code-block:: bash salt '*' partition.list /dev/sda salt '*' partition.list /dev/sda unit=s salt '*' partition.list /dev/sda unit=kB ''' _validate_device(device) if un...
[ "def", "list_", "(", "device", ",", "unit", "=", "None", ")", ":", "_validate_device", "(", "device", ")", "if", "unit", ":", "if", "unit", "not", "in", "VALID_UNITS", ":", "raise", "CommandExecutionError", "(", "'Invalid unit passed to partition.part_list'", ")...
Prints partition information of given <device> CLI Examples: .. code-block:: bash salt '*' partition.list /dev/sda salt '*' partition.list /dev/sda unit=s salt '*' partition.list /dev/sda unit=kB
[ "Prints", "partition", "information", "of", "given", "<device", ">" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parted_partition.py#L139-L213
train
Lists the partition information of a given device.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/parted_partition.py
align_check
def align_check(device, part_type, partition): ''' Check if partition satisfies the alignment constraint of part_type. Type must be "minimal" or "optimal". CLI Example: .. code-block:: bash salt '*' partition.align_check /dev/sda minimal 1 ''' _validate_device(device) if part...
python
def align_check(device, part_type, partition): ''' Check if partition satisfies the alignment constraint of part_type. Type must be "minimal" or "optimal". CLI Example: .. code-block:: bash salt '*' partition.align_check /dev/sda minimal 1 ''' _validate_device(device) if part...
[ "def", "align_check", "(", "device", ",", "part_type", ",", "partition", ")", ":", "_validate_device", "(", "device", ")", "if", "part_type", "not", "in", "set", "(", "[", "'minimal'", ",", "'optimal'", "]", ")", ":", "raise", "CommandExecutionError", "(", ...
Check if partition satisfies the alignment constraint of part_type. Type must be "minimal" or "optimal". CLI Example: .. code-block:: bash salt '*' partition.align_check /dev/sda minimal 1
[ "Check", "if", "partition", "satisfies", "the", "alignment", "constraint", "of", "part_type", ".", "Type", "must", "be", "minimal", "or", "optimal", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parted_partition.py#L216-L245
train
Check if the given device satisfies the alignment constraint of part_type.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/parted_partition.py
cp
def cp(device, from_minor, to_minor): # pylint: disable=C0103 ''' Copies the file system on the partition <from-minor> to partition <to-minor>, deleting the original contents of the destination partition. CLI Example: .. code-block:: bash salt '*' partition.cp /dev/sda 2 3 ''' ...
python
def cp(device, from_minor, to_minor): # pylint: disable=C0103 ''' Copies the file system on the partition <from-minor> to partition <to-minor>, deleting the original contents of the destination partition. CLI Example: .. code-block:: bash salt '*' partition.cp /dev/sda 2 3 ''' ...
[ "def", "cp", "(", "device", ",", "from_minor", ",", "to_minor", ")", ":", "# pylint: disable=C0103", "_validate_device", "(", "device", ")", "try", ":", "int", "(", "from_minor", ")", "int", "(", "to_minor", ")", "except", "Exception", ":", "raise", "Command...
Copies the file system on the partition <from-minor> to partition <to-minor>, deleting the original contents of the destination partition. CLI Example: .. code-block:: bash salt '*' partition.cp /dev/sda 2 3
[ "Copies", "the", "file", "system", "on", "the", "partition", "<from", "-", "minor", ">", "to", "partition", "<to", "-", "minor", ">", "deleting", "the", "original", "contents", "of", "the", "destination", "partition", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parted_partition.py#L272-L296
train
Copy the file system on the partition from_minor to to_minor.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/parted_partition.py
set_id
def set_id(device, minor, system_id): ''' Sets the system ID for the partition. Some typical values are:: b: FAT32 (vfat) 7: HPFS/NTFS 82: Linux Swap 83: Linux 8e: Linux LVM fd: Linux RAID Auto CLI Example: .. code-block:: bash salt '*' parti...
python
def set_id(device, minor, system_id): ''' Sets the system ID for the partition. Some typical values are:: b: FAT32 (vfat) 7: HPFS/NTFS 82: Linux Swap 83: Linux 8e: Linux LVM fd: Linux RAID Auto CLI Example: .. code-block:: bash salt '*' parti...
[ "def", "set_id", "(", "device", ",", "minor", ",", "system_id", ")", ":", "_validate_device", "(", "device", ")", "try", ":", "int", "(", "minor", ")", "except", "Exception", ":", "raise", "CommandExecutionError", "(", "'Invalid minor number passed to partition.se...
Sets the system ID for the partition. Some typical values are:: b: FAT32 (vfat) 7: HPFS/NTFS 82: Linux Swap 83: Linux 8e: Linux LVM fd: Linux RAID Auto CLI Example: .. code-block:: bash salt '*' partition.set_id /dev/sda 1 83
[ "Sets", "the", "system", "ID", "for", "the", "partition", ".", "Some", "typical", "values", "are", "::" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parted_partition.py#L330-L363
train
Sets the system ID for the current node.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/parted_partition.py
system_types
def system_types(): ''' List the system types that are supported by the installed version of sfdisk CLI Example: .. code-block:: bash salt '*' partition.system_types ''' ret = {} for line in __salt__['cmd.run']('sfdisk -T').splitlines(): if not line: continue ...
python
def system_types(): ''' List the system types that are supported by the installed version of sfdisk CLI Example: .. code-block:: bash salt '*' partition.system_types ''' ret = {} for line in __salt__['cmd.run']('sfdisk -T').splitlines(): if not line: continue ...
[ "def", "system_types", "(", ")", ":", "ret", "=", "{", "}", "for", "line", "in", "__salt__", "[", "'cmd.run'", "]", "(", "'sfdisk -T'", ")", ".", "splitlines", "(", ")", ":", "if", "not", "line", ":", "continue", "if", "line", ".", "startswith", "(",...
List the system types that are supported by the installed version of sfdisk CLI Example: .. code-block:: bash salt '*' partition.system_types
[ "List", "the", "system", "types", "that", "are", "supported", "by", "the", "installed", "version", "of", "sfdisk" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parted_partition.py#L366-L384
train
Return a list of system types that are supported by the installed version of sfdisk ridge CLI Example : bash ridge - T salt '*' partition. system_types
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/parted_partition.py
mkfs
def mkfs(device, fs_type): ''' Makes a file system <fs_type> on partition <device>, destroying all data that resides on that partition. <fs_type> must be one of "ext2", "fat32", "fat16", "linux-swap" or "reiserfs" (if libreiserfs is installed) CLI Example: .. code-block:: bash salt '*...
python
def mkfs(device, fs_type): ''' Makes a file system <fs_type> on partition <device>, destroying all data that resides on that partition. <fs_type> must be one of "ext2", "fat32", "fat16", "linux-swap" or "reiserfs" (if libreiserfs is installed) CLI Example: .. code-block:: bash salt '*...
[ "def", "mkfs", "(", "device", ",", "fs_type", ")", ":", "_validate_device", "(", "device", ")", "if", "not", "_is_fstype", "(", "fs_type", ")", ":", "raise", "CommandExecutionError", "(", "'Invalid fs_type passed to partition.mkfs'", ")", "if", "fs_type", "==", ...
Makes a file system <fs_type> on partition <device>, destroying all data that resides on that partition. <fs_type> must be one of "ext2", "fat32", "fat16", "linux-swap" or "reiserfs" (if libreiserfs is installed) CLI Example: .. code-block:: bash salt '*' partition.mkfs /dev/sda2 fat32
[ "Makes", "a", "file", "system", "<fs_type", ">", "on", "partition", "<device", ">", "destroying", "all", "data", "that", "resides", "on", "that", "partition", ".", "<fs_type", ">", "must", "be", "one", "of", "ext2", "fat32", "fat16", "linux", "-", "swap", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parted_partition.py#L397-L426
train
Makes a file system on a device destroying all data that resides on that partition.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/parted_partition.py
mklabel
def mklabel(device, label_type): ''' Create a new disklabel (partition table) of label_type. Type should be one of "aix", "amiga", "bsd", "dvh", "gpt", "loop", "mac", "msdos", "pc98", or "sun". CLI Example: .. code-block:: bash salt '*' partition.mklabel /dev/sda msdos ''' if...
python
def mklabel(device, label_type): ''' Create a new disklabel (partition table) of label_type. Type should be one of "aix", "amiga", "bsd", "dvh", "gpt", "loop", "mac", "msdos", "pc98", or "sun". CLI Example: .. code-block:: bash salt '*' partition.mklabel /dev/sda msdos ''' if...
[ "def", "mklabel", "(", "device", ",", "label_type", ")", ":", "if", "label_type", "not", "in", "set", "(", "[", "'aix'", ",", "'amiga'", ",", "'bsd'", ",", "'dvh'", ",", "'gpt'", ",", "'loop'", ",", "'mac'", ",", "'msdos'", ",", "'pc98'", ",", "'sun'...
Create a new disklabel (partition table) of label_type. Type should be one of "aix", "amiga", "bsd", "dvh", "gpt", "loop", "mac", "msdos", "pc98", or "sun". CLI Example: .. code-block:: bash salt '*' partition.mklabel /dev/sda msdos
[ "Create", "a", "new", "disklabel", "(", "partition", "table", ")", "of", "label_type", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parted_partition.py#L429-L451
train
Create a new disklabel for the specified label type on the specified device.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/parted_partition.py
mkpart
def mkpart(device, part_type, fs_type=None, start=None, end=None): ''' Make a part_type partition for filesystem fs_type, beginning at start and ending at end (by default in megabytes). part_type should be one of "primary", "logical", or "extended". CLI Examples: .. code-block:: bash ...
python
def mkpart(device, part_type, fs_type=None, start=None, end=None): ''' Make a part_type partition for filesystem fs_type, beginning at start and ending at end (by default in megabytes). part_type should be one of "primary", "logical", or "extended". CLI Examples: .. code-block:: bash ...
[ "def", "mkpart", "(", "device", ",", "part_type", ",", "fs_type", "=", "None", ",", "start", "=", "None", ",", "end", "=", "None", ")", ":", "if", "part_type", "not", "in", "set", "(", "[", "'primary'", ",", "'logical'", ",", "'extended'", "]", ")", ...
Make a part_type partition for filesystem fs_type, beginning at start and ending at end (by default in megabytes). part_type should be one of "primary", "logical", or "extended". CLI Examples: .. code-block:: bash salt '*' partition.mkpart /dev/sda primary fs_type=fat32 start=0 end=639 ...
[ "Make", "a", "part_type", "partition", "for", "filesystem", "fs_type", "beginning", "at", "start", "and", "ending", "at", "end", "(", "by", "default", "in", "megabytes", ")", ".", "part_type", "should", "be", "one", "of", "primary", "logical", "or", "extende...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parted_partition.py#L454-L493
train
Make a part_type partition for the specified device and filesystem fs_type beginning at start and ending at end.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/parted_partition.py
mkpartfs
def mkpartfs(device, part_type, fs_type, start, end): ''' Make a <part_type> partition with a new filesystem of <fs_type>, beginning at <start> and ending at <end> (by default in megabytes). <part_type> should be one of "primary", "logical", or "extended". <fs_type> must be one of "ext2", "fat32", ...
python
def mkpartfs(device, part_type, fs_type, start, end): ''' Make a <part_type> partition with a new filesystem of <fs_type>, beginning at <start> and ending at <end> (by default in megabytes). <part_type> should be one of "primary", "logical", or "extended". <fs_type> must be one of "ext2", "fat32", ...
[ "def", "mkpartfs", "(", "device", ",", "part_type", ",", "fs_type", ",", "start", ",", "end", ")", ":", "_validate_device", "(", "device", ")", "if", "part_type", "not", "in", "set", "(", "[", "'primary'", ",", "'logical'", ",", "'extended'", "]", ")", ...
Make a <part_type> partition with a new filesystem of <fs_type>, beginning at <start> and ending at <end> (by default in megabytes). <part_type> should be one of "primary", "logical", or "extended". <fs_type> must be one of "ext2", "fat32", "fat16", "linux-swap" or "reiserfs" (if libreiserfs is install...
[ "Make", "a", "<part_type", ">", "partition", "with", "a", "new", "filesystem", "of", "<fs_type", ">", "beginning", "at", "<start", ">", "and", "ending", "at", "<end", ">", "(", "by", "default", "in", "megabytes", ")", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parted_partition.py#L496-L530
train
Create a new partition with a new filesystem of type part_type starting at start and ending at end.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/parted_partition.py
name
def name(device, partition, name): ''' Set the name of partition to name. This option works only on Mac, PC98, and GPT disklabels. The name can be placed in quotes, if necessary. CLI Example: .. code-block:: bash salt '*' partition.name /dev/sda 1 'My Documents' ''' _validate_devi...
python
def name(device, partition, name): ''' Set the name of partition to name. This option works only on Mac, PC98, and GPT disklabels. The name can be placed in quotes, if necessary. CLI Example: .. code-block:: bash salt '*' partition.name /dev/sda 1 'My Documents' ''' _validate_devi...
[ "def", "name", "(", "device", ",", "partition", ",", "name", ")", ":", "_validate_device", "(", "device", ")", "try", ":", "int", "(", "partition", ")", "except", "Exception", ":", "raise", "CommandExecutionError", "(", "'Invalid partition passed to partition.name...
Set the name of partition to name. This option works only on Mac, PC98, and GPT disklabels. The name can be placed in quotes, if necessary. CLI Example: .. code-block:: bash salt '*' partition.name /dev/sda 1 'My Documents'
[ "Set", "the", "name", "of", "partition", "to", "name", ".", "This", "option", "works", "only", "on", "Mac", "PC98", "and", "GPT", "disklabels", ".", "The", "name", "can", "be", "placed", "in", "quotes", "if", "necessary", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parted_partition.py#L533-L562
train
Set the name of the given partition.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/parted_partition.py
rescue
def rescue(device, start, end): ''' Rescue a lost partition that was located somewhere between start and end. If a partition is found, parted will ask if you want to create an entry for it in the partition table. CLI Example: .. code-block:: bash salt '*' partition.rescue /dev/sda 0 8...
python
def rescue(device, start, end): ''' Rescue a lost partition that was located somewhere between start and end. If a partition is found, parted will ask if you want to create an entry for it in the partition table. CLI Example: .. code-block:: bash salt '*' partition.rescue /dev/sda 0 8...
[ "def", "rescue", "(", "device", ",", "start", ",", "end", ")", ":", "_validate_device", "(", "device", ")", "_validate_partition_boundary", "(", "start", ")", "_validate_partition_boundary", "(", "end", ")", "cmd", "=", "'parted -m -s {0} rescue {1} {2}'", ".", "f...
Rescue a lost partition that was located somewhere between start and end. If a partition is found, parted will ask if you want to create an entry for it in the partition table. CLI Example: .. code-block:: bash salt '*' partition.rescue /dev/sda 0 8056
[ "Rescue", "a", "lost", "partition", "that", "was", "located", "somewhere", "between", "start", "and", "end", ".", "If", "a", "partition", "is", "found", "parted", "will", "ask", "if", "you", "want", "to", "create", "an", "entry", "for", "it", "in", "the"...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parted_partition.py#L565-L583
train
Rescue a lost partition that was located somewhere between start and end.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/parted_partition.py
resize
def resize(device, minor, start, end): ''' Resizes the partition with number <minor>. The partition will start <start> from the beginning of the disk, and end <end> from the beginning of the disk. resize never changes the minor number. Extended partitions can be resized, so long as the new extended...
python
def resize(device, minor, start, end): ''' Resizes the partition with number <minor>. The partition will start <start> from the beginning of the disk, and end <end> from the beginning of the disk. resize never changes the minor number. Extended partitions can be resized, so long as the new extended...
[ "def", "resize", "(", "device", ",", "minor", ",", "start", ",", "end", ")", ":", "_validate_device", "(", "device", ")", "try", ":", "int", "(", "minor", ")", "except", "Exception", ":", "raise", "CommandExecutionError", "(", "'Invalid minor number passed to ...
Resizes the partition with number <minor>. The partition will start <start> from the beginning of the disk, and end <end> from the beginning of the disk. resize never changes the minor number. Extended partitions can be resized, so long as the new extended partition completely contains all logical part...
[ "Resizes", "the", "partition", "with", "number", "<minor", ">", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parted_partition.py#L586-L618
train
Resizes the partition with number <minor.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/parted_partition.py
rm
def rm(device, minor): # pylint: disable=C0103 ''' Removes the partition with number <minor>. CLI Example: .. code-block:: bash salt '*' partition.rm /dev/sda 5 ''' _validate_device(device) try: int(minor) except Exception: raise CommandExecutionError( ...
python
def rm(device, minor): # pylint: disable=C0103 ''' Removes the partition with number <minor>. CLI Example: .. code-block:: bash salt '*' partition.rm /dev/sda 5 ''' _validate_device(device) try: int(minor) except Exception: raise CommandExecutionError( ...
[ "def", "rm", "(", "device", ",", "minor", ")", ":", "# pylint: disable=C0103", "_validate_device", "(", "device", ")", "try", ":", "int", "(", "minor", ")", "except", "Exception", ":", "raise", "CommandExecutionError", "(", "'Invalid minor number passed to partition...
Removes the partition with number <minor>. CLI Example: .. code-block:: bash salt '*' partition.rm /dev/sda 5
[ "Removes", "the", "partition", "with", "number", "<minor", ">", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parted_partition.py#L621-L642
train
Removes the partition with number <minor.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/parted_partition.py
set_
def set_(device, minor, flag, state): ''' Changes a flag on the partition with number <minor>. A flag can be either "on" or "off" (make sure to use proper quoting, see :ref:`YAML Idiosyncrasies <yaml-idiosyncrasies>`). Some or all of these flags will be available, depending on what disk label you a...
python
def set_(device, minor, flag, state): ''' Changes a flag on the partition with number <minor>. A flag can be either "on" or "off" (make sure to use proper quoting, see :ref:`YAML Idiosyncrasies <yaml-idiosyncrasies>`). Some or all of these flags will be available, depending on what disk label you a...
[ "def", "set_", "(", "device", ",", "minor", ",", "flag", ",", "state", ")", ":", "_validate_device", "(", "device", ")", "try", ":", "int", "(", "minor", ")", "except", "Exception", ":", "raise", "CommandExecutionError", "(", "'Invalid minor number passed to p...
Changes a flag on the partition with number <minor>. A flag can be either "on" or "off" (make sure to use proper quoting, see :ref:`YAML Idiosyncrasies <yaml-idiosyncrasies>`). Some or all of these flags will be available, depending on what disk label you are using. Valid flags are: * boot ...
[ "Changes", "a", "flag", "on", "the", "partition", "with", "number", "<minor", ">", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parted_partition.py#L645-L697
train
Sets a flag on the partition with number <minor.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/parted_partition.py
toggle
def toggle(device, partition, flag): ''' Toggle the state of <flag> on <partition>. Valid flags are the same as the set command. CLI Example: .. code-block:: bash salt '*' partition.toggle /dev/sda 1 boot ''' _validate_device(device) try: int(partition) except...
python
def toggle(device, partition, flag): ''' Toggle the state of <flag> on <partition>. Valid flags are the same as the set command. CLI Example: .. code-block:: bash salt '*' partition.toggle /dev/sda 1 boot ''' _validate_device(device) try: int(partition) except...
[ "def", "toggle", "(", "device", ",", "partition", ",", "flag", ")", ":", "_validate_device", "(", "device", ")", "try", ":", "int", "(", "partition", ")", "except", "Exception", ":", "raise", "CommandExecutionError", "(", "'Invalid partition number passed to parti...
Toggle the state of <flag> on <partition>. Valid flags are the same as the set command. CLI Example: .. code-block:: bash salt '*' partition.toggle /dev/sda 1 boot
[ "Toggle", "the", "state", "of", "<flag", ">", "on", "<partition", ">", ".", "Valid", "flags", "are", "the", "same", "as", "the", "set", "command", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parted_partition.py#L700-L725
train
Toggle the state of flag on a specific device on a specific partition.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/parted_partition.py
disk_set
def disk_set(device, flag, state): ''' Changes a flag on selected device. A flag can be either "on" or "off" (make sure to use proper quoting, see :ref:`YAML Idiosyncrasies <yaml-idiosyncrasies>`). Some or all of these flags will be available, depending on what disk label you are using. Va...
python
def disk_set(device, flag, state): ''' Changes a flag on selected device. A flag can be either "on" or "off" (make sure to use proper quoting, see :ref:`YAML Idiosyncrasies <yaml-idiosyncrasies>`). Some or all of these flags will be available, depending on what disk label you are using. Va...
[ "def", "disk_set", "(", "device", ",", "flag", ",", "state", ")", ":", "_validate_device", "(", "device", ")", "if", "flag", "not", "in", "VALID_DISK_FLAGS", ":", "raise", "CommandExecutionError", "(", "'Invalid flag passed to partition.disk_set'", ")", "if", "sta...
Changes a flag on selected device. A flag can be either "on" or "off" (make sure to use proper quoting, see :ref:`YAML Idiosyncrasies <yaml-idiosyncrasies>`). Some or all of these flags will be available, depending on what disk label you are using. Valid flags are: * cylinder_alignment ...
[ "Changes", "a", "flag", "on", "selected", "device", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parted_partition.py#L728-L758
train
Changes a flag on selected device.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/parted_partition.py
disk_toggle
def disk_toggle(device, flag): ''' Toggle the state of <flag> on <device>. Valid flags are the same as the disk_set command. CLI Example: .. code-block:: bash salt '*' partition.disk_toggle /dev/sda pmbr_boot ''' _validate_device(device) if flag not in VALID_DISK_FLAGS: ...
python
def disk_toggle(device, flag): ''' Toggle the state of <flag> on <device>. Valid flags are the same as the disk_set command. CLI Example: .. code-block:: bash salt '*' partition.disk_toggle /dev/sda pmbr_boot ''' _validate_device(device) if flag not in VALID_DISK_FLAGS: ...
[ "def", "disk_toggle", "(", "device", ",", "flag", ")", ":", "_validate_device", "(", "device", ")", "if", "flag", "not", "in", "VALID_DISK_FLAGS", ":", "raise", "CommandExecutionError", "(", "'Invalid flag passed to partition.disk_toggle'", ")", "cmd", "=", "[", "...
Toggle the state of <flag> on <device>. Valid flags are the same as the disk_set command. CLI Example: .. code-block:: bash salt '*' partition.disk_toggle /dev/sda pmbr_boot
[ "Toggle", "the", "state", "of", "<flag", ">", "on", "<device", ">", ".", "Valid", "flags", "are", "the", "same", "as", "the", "disk_set", "command", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parted_partition.py#L761-L779
train
Toggle the state of flag on device. Valid flags are the same as the disk_set command.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/parted_partition.py
exists
def exists(device=''): ''' Check to see if the partition exists CLI Example: .. code-block:: bash salt '*' partition.exists /dev/sdb1 ''' if os.path.exists(device): dev = os.stat(device).st_mode if stat.S_ISBLK(dev): return True return False
python
def exists(device=''): ''' Check to see if the partition exists CLI Example: .. code-block:: bash salt '*' partition.exists /dev/sdb1 ''' if os.path.exists(device): dev = os.stat(device).st_mode if stat.S_ISBLK(dev): return True return False
[ "def", "exists", "(", "device", "=", "''", ")", ":", "if", "os", ".", "path", ".", "exists", "(", "device", ")", ":", "dev", "=", "os", ".", "stat", "(", "device", ")", ".", "st_mode", "if", "stat", ".", "S_ISBLK", "(", "dev", ")", ":", "return...
Check to see if the partition exists CLI Example: .. code-block:: bash salt '*' partition.exists /dev/sdb1
[ "Check", "to", "see", "if", "the", "partition", "exists" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/parted_partition.py#L782-L798
train
Check to see if the partition exists
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/freezer.py
_paths
def _paths(name=None): ''' Return the full path for the packages and repository freezer files. ''' name = 'freezer' if not name else name states_path = _states_path() return ( os.path.join(states_path, '{}-pkgs.yml'.format(name)), os.path.join(states_path, '{}-reps.yml'.form...
python
def _paths(name=None): ''' Return the full path for the packages and repository freezer files. ''' name = 'freezer' if not name else name states_path = _states_path() return ( os.path.join(states_path, '{}-pkgs.yml'.format(name)), os.path.join(states_path, '{}-reps.yml'.form...
[ "def", "_paths", "(", "name", "=", "None", ")", ":", "name", "=", "'freezer'", "if", "not", "name", "else", "name", "states_path", "=", "_states_path", "(", ")", "return", "(", "os", ".", "path", ".", "join", "(", "states_path", ",", "'{}-pkgs.yml'", "...
Return the full path for the packages and repository freezer files.
[ "Return", "the", "full", "path", "for", "the", "packages", "and", "repository", "freezer", "files", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freezer.py#L65-L76
train
Return the full path for the packages and repository freezer files.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...