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/crypt.py
MasterKeys.get_pub_str
def get_pub_str(self, name='master'): ''' Return the string representation of a public key in the pki-directory ''' path = os.path.join(self.opts['pki_dir'], name + '.pub') if not os.path.isfile(path): key = self.__get_keys() ...
python
def get_pub_str(self, name='master'): ''' Return the string representation of a public key in the pki-directory ''' path = os.path.join(self.opts['pki_dir'], name + '.pub') if not os.path.isfile(path): key = self.__get_keys() ...
[ "def", "get_pub_str", "(", "self", ",", "name", "=", "'master'", ")", ":", "path", "=", "os", ".", "path", ".", "join", "(", "self", ".", "opts", "[", "'pki_dir'", "]", ",", "name", "+", "'.pub'", ")", "if", "not", "os", ".", "path", ".", "isfile...
Return the string representation of a public key in the pki-directory
[ "Return", "the", "string", "representation", "of", "a", "public", "key", "in", "the", "pki", "-", "directory" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/crypt.py#L409-L424
train
Return the string representation of a public key in the pki - 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/crypt.py
AsyncAuth.authenticate
def authenticate(self, callback=None): ''' Ask for this client to reconnect to the origin This function will de-dupe all calls here and return a *single* future for the sign-in-- whis way callers can all assume there aren't others ''' # if an auth is in flight-- and not ...
python
def authenticate(self, callback=None): ''' Ask for this client to reconnect to the origin This function will de-dupe all calls here and return a *single* future for the sign-in-- whis way callers can all assume there aren't others ''' # if an auth is in flight-- and not ...
[ "def", "authenticate", "(", "self", ",", "callback", "=", "None", ")", ":", "# if an auth is in flight-- and not done-- just pass that back as the future to wait on", "if", "hasattr", "(", "self", ",", "'_authenticate_future'", ")", "and", "not", "self", ".", "_authentica...
Ask for this client to reconnect to the origin This function will de-dupe all calls here and return a *single* future for the sign-in-- whis way callers can all assume there aren't others
[ "Ask", "for", "this", "client", "to", "reconnect", "to", "the", "origin" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/crypt.py#L558-L579
train
Ask for this client to reconnect to the origin
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/crypt.py
AsyncAuth._authenticate
def _authenticate(self): ''' Authenticate with the master, this method breaks the functional paradigm, it will update the master information from a fresh sign in, signing in can occur as often as needed to keep up with the revolving master AES key. :rtype: Crypticle ...
python
def _authenticate(self): ''' Authenticate with the master, this method breaks the functional paradigm, it will update the master information from a fresh sign in, signing in can occur as often as needed to keep up with the revolving master AES key. :rtype: Crypticle ...
[ "def", "_authenticate", "(", "self", ")", ":", "acceptance_wait_time", "=", "self", ".", "opts", "[", "'acceptance_wait_time'", "]", "acceptance_wait_time_max", "=", "self", ".", "opts", "[", "'acceptance_wait_time_max'", "]", "if", "not", "acceptance_wait_time_max", ...
Authenticate with the master, this method breaks the functional paradigm, it will update the master information from a fresh sign in, signing in can occur as often as needed to keep up with the revolving master AES key. :rtype: Crypticle :returns: A crypticle used for encryption...
[ "Authenticate", "with", "the", "master", "this", "method", "breaks", "the", "functional", "paradigm", "it", "will", "update", "the", "master", "information", "from", "a", "fresh", "sign", "in", "signing", "in", "can", "occur", "as", "often", "as", "needed", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/crypt.py#L582-L661
train
Authenticate with the master and return a crypticle used for encryption operations.
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/crypt.py
AsyncAuth.sign_in
def sign_in(self, timeout=60, safe=True, tries=1, channel=None): ''' Send a sign in request to the master, sets the key information and returns a dict containing the master publish interface to bind to and the decrypted aes key for transport decryption. :param int timeout: Numbe...
python
def sign_in(self, timeout=60, safe=True, tries=1, channel=None): ''' Send a sign in request to the master, sets the key information and returns a dict containing the master publish interface to bind to and the decrypted aes key for transport decryption. :param int timeout: Numbe...
[ "def", "sign_in", "(", "self", ",", "timeout", "=", "60", ",", "safe", "=", "True", ",", "tries", "=", "1", ",", "channel", "=", "None", ")", ":", "auth", "=", "{", "}", "auth_timeout", "=", "self", ".", "opts", ".", "get", "(", "'auth_timeout'", ...
Send a sign in request to the master, sets the key information and returns a dict containing the master publish interface to bind to and the decrypted aes key for transport decryption. :param int timeout: Number of seconds to wait before timing out the sign-in request :param bool safe: ...
[ "Send", "a", "sign", "in", "request", "to", "the", "master", "sets", "the", "key", "information", "and", "returns", "a", "dict", "containing", "the", "master", "publish", "interface", "to", "bind", "to", "and", "the", "decrypted", "aes", "key", "for", "tra...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/crypt.py#L664-L782
train
Send a sign - in request to the master and return the response.
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/crypt.py
AsyncAuth.get_keys
def get_keys(self): ''' Return keypair object for the minion. :rtype: Crypto.PublicKey.RSA._RSAobj :return: The RSA keypair ''' # Make sure all key parent directories are accessible user = self.opts.get('user', 'root') salt.utils.verify.check_path_travers...
python
def get_keys(self): ''' Return keypair object for the minion. :rtype: Crypto.PublicKey.RSA._RSAobj :return: The RSA keypair ''' # Make sure all key parent directories are accessible user = self.opts.get('user', 'root') salt.utils.verify.check_path_travers...
[ "def", "get_keys", "(", "self", ")", ":", "# Make sure all key parent directories are accessible", "user", "=", "self", ".", "opts", ".", "get", "(", "'user'", ",", "'root'", ")", "salt", ".", "utils", ".", "verify", ".", "check_path_traversal", "(", "self", "...
Return keypair object for the minion. :rtype: Crypto.PublicKey.RSA._RSAobj :return: The RSA keypair
[ "Return", "keypair", "object", "for", "the", "minion", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/crypt.py#L784-L803
train
Return the RSA keypair object for the minion.
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/crypt.py
AsyncAuth.minion_sign_in_payload
def minion_sign_in_payload(self): ''' Generates the payload used to authenticate with the master server. This payload consists of the passed in id_ and the ssh public key to encrypt the AES key sent back from the master. :return: Payload dictionary :rtype: dict '...
python
def minion_sign_in_payload(self): ''' Generates the payload used to authenticate with the master server. This payload consists of the passed in id_ and the ssh public key to encrypt the AES key sent back from the master. :return: Payload dictionary :rtype: dict '...
[ "def", "minion_sign_in_payload", "(", "self", ")", ":", "payload", "=", "{", "}", "payload", "[", "'cmd'", "]", "=", "'_auth'", "payload", "[", "'id'", "]", "=", "self", ".", "opts", "[", "'id'", "]", "if", "'autosign_grains'", "in", "self", ".", "opts...
Generates the payload used to authenticate with the master server. This payload consists of the passed in id_ and the ssh public key to encrypt the AES key sent back from the master. :return: Payload dictionary :rtype: dict
[ "Generates", "the", "payload", "used", "to", "authenticate", "with", "the", "master", "server", ".", "This", "payload", "consists", "of", "the", "passed", "in", "id_", "and", "the", "ssh", "public", "key", "to", "encrypt", "the", "AES", "key", "sent", "bac...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/crypt.py#L816-L845
train
Generates the payload used to authenticate with the master master.
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/crypt.py
AsyncAuth.verify_pubkey_sig
def verify_pubkey_sig(self, message, sig): ''' Wraps the verify_signature method so we have additional checks. :rtype: bool :return: Success or failure of public key verification ''' if self.opts['master_sign_key_name']: path = os.path.join(self.opts[...
python
def verify_pubkey_sig(self, message, sig): ''' Wraps the verify_signature method so we have additional checks. :rtype: bool :return: Success or failure of public key verification ''' if self.opts['master_sign_key_name']: path = os.path.join(self.opts[...
[ "def", "verify_pubkey_sig", "(", "self", ",", "message", ",", "sig", ")", ":", "if", "self", ".", "opts", "[", "'master_sign_key_name'", "]", ":", "path", "=", "os", ".", "path", ".", "join", "(", "self", ".", "opts", "[", "'pki_dir'", "]", ",", "sel...
Wraps the verify_signature method so we have additional checks. :rtype: bool :return: Success or failure of public key verification
[ "Wraps", "the", "verify_signature", "method", "so", "we", "have", "additional", "checks", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/crypt.py#L917-L956
train
This method verifies the signature of a message with the master public key.
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/crypt.py
AsyncAuth.check_auth_deps
def check_auth_deps(self, payload): ''' Checks if both master and minion either sign (master) and verify (minion). If one side does not, it should fail. :param dict payload: The incoming payload. This is a dictionary which may have the following keys: 'aes': The shared AES k...
python
def check_auth_deps(self, payload): ''' Checks if both master and minion either sign (master) and verify (minion). If one side does not, it should fail. :param dict payload: The incoming payload. This is a dictionary which may have the following keys: 'aes': The shared AES k...
[ "def", "check_auth_deps", "(", "self", ",", "payload", ")", ":", "# master and minion sign and verify", "if", "'pub_sig'", "in", "payload", "and", "self", ".", "opts", "[", "'verify_master_pubkey_sign'", "]", ":", "return", "True", "# master and minion do NOT sign and d...
Checks if both master and minion either sign (master) and verify (minion). If one side does not, it should fail. :param dict payload: The incoming payload. This is a dictionary which may have the following keys: 'aes': The shared AES key 'enc': The format of the message. ('clear...
[ "Checks", "if", "both", "master", "and", "minion", "either", "sign", "(", "master", ")", "and", "verify", "(", "minion", ")", ".", "If", "one", "side", "does", "not", "it", "should", "fail", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/crypt.py#L984-L1016
train
Checks if both master and minion sign and verify are needed.
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/crypt.py
AsyncAuth.extract_aes
def extract_aes(self, payload, master_pub=True): ''' Return the AES key received from the master after the minion has been successfully authenticated. :param dict payload: The incoming payload. This is a dictionary which may have the following keys: 'aes': The shared AES key...
python
def extract_aes(self, payload, master_pub=True): ''' Return the AES key received from the master after the minion has been successfully authenticated. :param dict payload: The incoming payload. This is a dictionary which may have the following keys: 'aes': The shared AES key...
[ "def", "extract_aes", "(", "self", ",", "payload", ",", "master_pub", "=", "True", ")", ":", "if", "master_pub", ":", "try", ":", "aes", ",", "token", "=", "self", ".", "decrypt_aes", "(", "payload", ",", "master_pub", ")", "if", "token", "!=", "self",...
Return the AES key received from the master after the minion has been successfully authenticated. :param dict payload: The incoming payload. This is a dictionary which may have the following keys: 'aes': The shared AES key 'enc': The format of the message. ('clear', 'pub', etc) ...
[ "Return", "the", "AES", "key", "received", "from", "the", "master", "after", "the", "minion", "has", "been", "successfully", "authenticated", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/crypt.py#L1018-L1049
train
Extract the AES key from the master after the minion has been successfully authenticated.
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/crypt.py
AsyncAuth.verify_master
def verify_master(self, payload, master_pub=True): ''' Verify that the master is the same one that was previously accepted. :param dict payload: The incoming payload. This is a dictionary which may have the following keys: 'aes': The shared AES key 'enc': The format of t...
python
def verify_master(self, payload, master_pub=True): ''' Verify that the master is the same one that was previously accepted. :param dict payload: The incoming payload. This is a dictionary which may have the following keys: 'aes': The shared AES key 'enc': The format of t...
[ "def", "verify_master", "(", "self", ",", "payload", ",", "master_pub", "=", "True", ")", ":", "m_pub_fn", "=", "os", ".", "path", ".", "join", "(", "self", ".", "opts", "[", "'pki_dir'", "]", ",", "self", ".", "mpub", ")", "m_pub_exists", "=", "os",...
Verify that the master is the same one that was previously accepted. :param dict payload: The incoming payload. This is a dictionary which may have the following keys: 'aes': The shared AES key 'enc': The format of the message. ('clear', 'pub', etc) 'publish_port': The TCP p...
[ "Verify", "that", "the", "master", "is", "the", "same", "one", "that", "was", "previously", "accepted", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/crypt.py#L1051-L1127
train
Verify that the master is the same one that was previously accepted.
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/crypt.py
SAuth.authenticate
def authenticate(self, _=None): # TODO: remove unused var ''' Authenticate with the master, this method breaks the functional paradigm, it will update the master information from a fresh sign in, signing in can occur as often as needed to keep up with the revolving master AES ke...
python
def authenticate(self, _=None): # TODO: remove unused var ''' Authenticate with the master, this method breaks the functional paradigm, it will update the master information from a fresh sign in, signing in can occur as often as needed to keep up with the revolving master AES ke...
[ "def", "authenticate", "(", "self", ",", "_", "=", "None", ")", ":", "# TODO: remove unused var", "acceptance_wait_time", "=", "self", ".", "opts", "[", "'acceptance_wait_time'", "]", "acceptance_wait_time_max", "=", "self", ".", "opts", "[", "'acceptance_wait_time_...
Authenticate with the master, this method breaks the functional paradigm, it will update the master information from a fresh sign in, signing in can occur as often as needed to keep up with the revolving master AES key. :rtype: Crypticle :returns: A crypticle used for encryption...
[ "Authenticate", "with", "the", "master", "this", "method", "breaks", "the", "functional", "paradigm", "it", "will", "update", "the", "master", "information", "from", "a", "fresh", "sign", "in", "signing", "in", "can", "occur", "as", "often", "as", "needed", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/crypt.py#L1214-L1256
train
Authenticate with the master
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/crypt.py
Crypticle.encrypt
def encrypt(self, data): ''' encrypt data with AES-CBC and sign it with HMAC-SHA256 ''' aes_key, hmac_key = self.keys pad = self.AES_BLOCK_SIZE - len(data) % self.AES_BLOCK_SIZE if six.PY2: data = data + pad * chr(pad) else: data = data + s...
python
def encrypt(self, data): ''' encrypt data with AES-CBC and sign it with HMAC-SHA256 ''' aes_key, hmac_key = self.keys pad = self.AES_BLOCK_SIZE - len(data) % self.AES_BLOCK_SIZE if six.PY2: data = data + pad * chr(pad) else: data = data + s...
[ "def", "encrypt", "(", "self", ",", "data", ")", ":", "aes_key", ",", "hmac_key", "=", "self", ".", "keys", "pad", "=", "self", ".", "AES_BLOCK_SIZE", "-", "len", "(", "data", ")", "%", "self", ".", "AES_BLOCK_SIZE", "if", "six", ".", "PY2", ":", "...
encrypt data with AES-CBC and sign it with HMAC-SHA256
[ "encrypt", "data", "with", "AES", "-", "CBC", "and", "sign", "it", "with", "HMAC", "-", "SHA256" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/crypt.py#L1406-L1426
train
encrypt data with AES - CBC and sign it with HMAC - SHA256
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/crypt.py
Crypticle.decrypt
def decrypt(self, data): ''' verify HMAC-SHA256 signature and decrypt data with AES-CBC ''' aes_key, hmac_key = self.keys sig = data[-self.SIG_SIZE:] data = data[:-self.SIG_SIZE] if six.PY3 and not isinstance(data, bytes): data = salt.utils.stringutils...
python
def decrypt(self, data): ''' verify HMAC-SHA256 signature and decrypt data with AES-CBC ''' aes_key, hmac_key = self.keys sig = data[-self.SIG_SIZE:] data = data[:-self.SIG_SIZE] if six.PY3 and not isinstance(data, bytes): data = salt.utils.stringutils...
[ "def", "decrypt", "(", "self", ",", "data", ")", ":", "aes_key", ",", "hmac_key", "=", "self", ".", "keys", "sig", "=", "data", "[", "-", "self", ".", "SIG_SIZE", ":", "]", "data", "=", "data", "[", ":", "-", "self", ".", "SIG_SIZE", "]", "if", ...
verify HMAC-SHA256 signature and decrypt data with AES-CBC
[ "verify", "HMAC", "-", "SHA256", "signature", "and", "decrypt", "data", "with", "AES", "-", "CBC" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/crypt.py#L1428-L1464
train
verify HMAC - SHA256 signature and decrypt data with AES - CBC
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/crypt.py
Crypticle.dumps
def dumps(self, obj): ''' Serialize and encrypt a python object ''' return self.encrypt(self.PICKLE_PAD + self.serial.dumps(obj))
python
def dumps(self, obj): ''' Serialize and encrypt a python object ''' return self.encrypt(self.PICKLE_PAD + self.serial.dumps(obj))
[ "def", "dumps", "(", "self", ",", "obj", ")", ":", "return", "self", ".", "encrypt", "(", "self", ".", "PICKLE_PAD", "+", "self", ".", "serial", ".", "dumps", "(", "obj", ")", ")" ]
Serialize and encrypt a python object
[ "Serialize", "and", "encrypt", "a", "python", "object" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/crypt.py#L1466-L1470
train
Serialize and encrypt a python 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/crypt.py
Crypticle.loads
def loads(self, data, raw=False): ''' Decrypt and un-serialize a python object ''' data = self.decrypt(data) # simple integrity check to verify that we got meaningful data if not data.startswith(self.PICKLE_PAD): return {} load = self.serial.loads(data...
python
def loads(self, data, raw=False): ''' Decrypt and un-serialize a python object ''' data = self.decrypt(data) # simple integrity check to verify that we got meaningful data if not data.startswith(self.PICKLE_PAD): return {} load = self.serial.loads(data...
[ "def", "loads", "(", "self", ",", "data", ",", "raw", "=", "False", ")", ":", "data", "=", "self", ".", "decrypt", "(", "data", ")", "# simple integrity check to verify that we got meaningful data", "if", "not", "data", ".", "startswith", "(", "self", ".", "...
Decrypt and un-serialize a python object
[ "Decrypt", "and", "un", "-", "serialize", "a", "python", "object" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/crypt.py#L1472-L1481
train
Decrypt and un - serialize a python 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/pillar/hiera.py
ext_pillar
def ext_pillar(minion_id, # pylint: disable=W0613 pillar, # pylint: disable=W0613 conf): ''' Execute hiera and return the data ''' cmd = 'hiera -c {0}'.format(conf) for key, val in six.iteritems(__grains__): if isinstance(val, six.string_types): cm...
python
def ext_pillar(minion_id, # pylint: disable=W0613 pillar, # pylint: disable=W0613 conf): ''' Execute hiera and return the data ''' cmd = 'hiera -c {0}'.format(conf) for key, val in six.iteritems(__grains__): if isinstance(val, six.string_types): cm...
[ "def", "ext_pillar", "(", "minion_id", ",", "# pylint: disable=W0613", "pillar", ",", "# pylint: disable=W0613", "conf", ")", ":", "cmd", "=", "'hiera -c {0}'", ".", "format", "(", "conf", ")", "for", "key", ",", "val", "in", "six", ".", "iteritems", "(", "_...
Execute hiera and return the data
[ "Execute", "hiera", "and", "return", "the", "data" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/hiera.py#L29-L44
train
Execute hiera and return the 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/glusterfs.py
_gluster_output_cleanup
def _gluster_output_cleanup(result): ''' Gluster versions prior to 6 have a bug that requires tricking isatty. This adds "gluster> " to the output. Strip it off and produce clean xml for ElementTree. ''' ret = '' for line in result.splitlines(): if line.startswith('gluster>'): ...
python
def _gluster_output_cleanup(result): ''' Gluster versions prior to 6 have a bug that requires tricking isatty. This adds "gluster> " to the output. Strip it off and produce clean xml for ElementTree. ''' ret = '' for line in result.splitlines(): if line.startswith('gluster>'): ...
[ "def", "_gluster_output_cleanup", "(", "result", ")", ":", "ret", "=", "''", "for", "line", "in", "result", ".", "splitlines", "(", ")", ":", "if", "line", ".", "startswith", "(", "'gluster>'", ")", ":", "ret", "+=", "line", "[", "9", ":", "]", ".", ...
Gluster versions prior to 6 have a bug that requires tricking isatty. This adds "gluster> " to the output. Strip it off and produce clean xml for ElementTree.
[ "Gluster", "versions", "prior", "to", "6", "have", "a", "bug", "that", "requires", "tricking", "isatty", ".", "This", "adds", "gluster", ">", "to", "the", "output", ".", "Strip", "it", "off", "and", "produce", "clean", "xml", "for", "ElementTree", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/glusterfs.py#L51-L66
train
Clean up the output of Gluster 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/glusterfs.py
_gluster_xml
def _gluster_xml(cmd): ''' Perform a gluster --xml command and log result. ''' # We will pass the command string as stdin to allow for much longer # command strings. This is especially useful for creating large volumes # where the list of bricks exceeds 128 characters. if _get_version() < (3...
python
def _gluster_xml(cmd): ''' Perform a gluster --xml command and log result. ''' # We will pass the command string as stdin to allow for much longer # command strings. This is especially useful for creating large volumes # where the list of bricks exceeds 128 characters. if _get_version() < (3...
[ "def", "_gluster_xml", "(", "cmd", ")", ":", "# We will pass the command string as stdin to allow for much longer", "# command strings. This is especially useful for creating large volumes", "# where the list of bricks exceeds 128 characters.", "if", "_get_version", "(", ")", "<", "(", ...
Perform a gluster --xml command and log result.
[ "Perform", "a", "gluster", "--", "xml", "command", "and", "log", "result", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/glusterfs.py#L69-L103
train
Perform a gluster - xml command and log result.
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/glusterfs.py
_iter
def _iter(root, term): ''' Checks for python2.6 or python2.7 ''' if sys.version_info < (2, 7): return root.getiterator(term) else: return root.iter(term)
python
def _iter(root, term): ''' Checks for python2.6 or python2.7 ''' if sys.version_info < (2, 7): return root.getiterator(term) else: return root.iter(term)
[ "def", "_iter", "(", "root", ",", "term", ")", ":", "if", "sys", ".", "version_info", "<", "(", "2", ",", "7", ")", ":", "return", "root", ".", "getiterator", "(", "term", ")", "else", ":", "return", "root", ".", "iter", "(", "term", ")" ]
Checks for python2.6 or python2.7
[ "Checks", "for", "python2", ".", "6", "or", "python2", ".", "7" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/glusterfs.py#L120-L127
train
Returns an iterator over the root element of the given term.
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/glusterfs.py
peer_status
def peer_status(): ''' Return peer status information The return value is a dictionary with peer UUIDs as keys and dicts of peer information as values. Hostnames are listed in one list. GlusterFS separates one of the hostnames but the only reason for this seems to be which hostname happens to b...
python
def peer_status(): ''' Return peer status information The return value is a dictionary with peer UUIDs as keys and dicts of peer information as values. Hostnames are listed in one list. GlusterFS separates one of the hostnames but the only reason for this seems to be which hostname happens to b...
[ "def", "peer_status", "(", ")", ":", "root", "=", "_gluster_xml", "(", "'peer status'", ")", "if", "not", "_gluster_ok", "(", "root", ")", ":", "return", "None", "result", "=", "{", "}", "for", "peer", "in", "_iter", "(", "root", ",", "'peer'", ")", ...
Return peer status information The return value is a dictionary with peer UUIDs as keys and dicts of peer information as values. Hostnames are listed in one list. GlusterFS separates one of the hostnames but the only reason for this seems to be which hostname happens to be used first in peering. C...
[ "Return", "peer", "status", "information" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/glusterfs.py#L130-L181
train
Return the peer status information as a dictionary.
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/glusterfs.py
peer
def peer(name): ''' Add another node into the peer list. name The remote host to probe. CLI Example: .. code-block:: bash salt 'one.gluster.*' glusterfs.peer two GLUSTER direct CLI example (to show what salt is sending to gluster): $ gluster peer probe ftp2 GLU...
python
def peer(name): ''' Add another node into the peer list. name The remote host to probe. CLI Example: .. code-block:: bash salt 'one.gluster.*' glusterfs.peer two GLUSTER direct CLI example (to show what salt is sending to gluster): $ gluster peer probe ftp2 GLU...
[ "def", "peer", "(", "name", ")", ":", "if", "salt", ".", "utils", ".", "cloud", ".", "check_name", "(", "name", ",", "'a-zA-Z0-9._-'", ")", ":", "raise", "SaltInvocationError", "(", "'Invalid characters in peer name \"{0}\"'", ".", "format", "(", "name", ")", ...
Add another node into the peer list. name The remote host to probe. CLI Example: .. code-block:: bash salt 'one.gluster.*' glusterfs.peer two GLUSTER direct CLI example (to show what salt is sending to gluster): $ gluster peer probe ftp2 GLUSTER CLI 3.4.4 return exampl...
[ "Add", "another", "node", "into", "the", "peer", "list", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/glusterfs.py#L184-L219
train
Add another node into the peer list.
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/glusterfs.py
create_volume
def create_volume(name, bricks, stripe=False, replica=False, device_vg=False, transport='tcp', start=False, force=False, arbiter=False): ''' Create a glusterfs volume name Name of the gluster volume bricks Bricks to create volume from, in <peer>:<brick path> format. F...
python
def create_volume(name, bricks, stripe=False, replica=False, device_vg=False, transport='tcp', start=False, force=False, arbiter=False): ''' Create a glusterfs volume name Name of the gluster volume bricks Bricks to create volume from, in <peer>:<brick path> format. F...
[ "def", "create_volume", "(", "name", ",", "bricks", ",", "stripe", "=", "False", ",", "replica", "=", "False", ",", "device_vg", "=", "False", ",", "transport", "=", "'tcp'", ",", "start", "=", "False", ",", "force", "=", "False", ",", "arbiter", "=", ...
Create a glusterfs volume name Name of the gluster volume bricks Bricks to create volume from, in <peer>:<brick path> format. For \ multiple bricks use list format: '["<peer1>:<brick1>", \ "<peer2>:<brick2>"]' stripe Stripe count, the number of bricks should be a m...
[ "Create", "a", "glusterfs", "volume" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/glusterfs.py#L222-L320
train
Create a glusterfs volume from a list of bricks.
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/glusterfs.py
list_volumes
def list_volumes(): ''' List configured volumes CLI Example: .. code-block:: bash salt '*' glusterfs.list_volumes ''' root = _gluster_xml('volume list') if not _gluster_ok(root): return None results = [x.text for x in _iter(root, 'volume')] return results
python
def list_volumes(): ''' List configured volumes CLI Example: .. code-block:: bash salt '*' glusterfs.list_volumes ''' root = _gluster_xml('volume list') if not _gluster_ok(root): return None results = [x.text for x in _iter(root, 'volume')] return results
[ "def", "list_volumes", "(", ")", ":", "root", "=", "_gluster_xml", "(", "'volume list'", ")", "if", "not", "_gluster_ok", "(", "root", ")", ":", "return", "None", "results", "=", "[", "x", ".", "text", "for", "x", "in", "_iter", "(", "root", ",", "'v...
List configured volumes CLI Example: .. code-block:: bash salt '*' glusterfs.list_volumes
[ "List", "configured", "volumes" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/glusterfs.py#L323-L338
train
List configured volumes CLI Example : List configured volumes salt '*' glusterfs. list_volumes
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/glusterfs.py
status
def status(name): ''' Check the status of a gluster volume. name Volume name CLI Example: .. code-block:: bash salt '*' glusterfs.status myvolume ''' # Get volume status root = _gluster_xml('volume status {0}'.format(name)) if not _gluster_ok(root): # Most...
python
def status(name): ''' Check the status of a gluster volume. name Volume name CLI Example: .. code-block:: bash salt '*' glusterfs.status myvolume ''' # Get volume status root = _gluster_xml('volume status {0}'.format(name)) if not _gluster_ok(root): # Most...
[ "def", "status", "(", "name", ")", ":", "# Get volume status", "root", "=", "_gluster_xml", "(", "'volume status {0}'", ".", "format", "(", "name", ")", ")", "if", "not", "_gluster_ok", "(", "root", ")", ":", "# Most probably non-existing volume, the error output is...
Check the status of a gluster volume. name Volume name CLI Example: .. code-block:: bash salt '*' glusterfs.status myvolume
[ "Check", "the", "status", "of", "a", "gluster", "volume", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/glusterfs.py#L341-L392
train
Check the status of a gluster volume.
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/glusterfs.py
info
def info(name=None): ''' .. versionadded:: 2015.8.4 Return gluster volume info. name Optional name to retrieve only information of one volume CLI Example: .. code-block:: bash salt '*' glusterfs.info ''' cmd = 'volume info' if name is not None: cmd += ' '...
python
def info(name=None): ''' .. versionadded:: 2015.8.4 Return gluster volume info. name Optional name to retrieve only information of one volume CLI Example: .. code-block:: bash salt '*' glusterfs.info ''' cmd = 'volume info' if name is not None: cmd += ' '...
[ "def", "info", "(", "name", "=", "None", ")", ":", "cmd", "=", "'volume info'", "if", "name", "is", "not", "None", ":", "cmd", "+=", "' '", "+", "name", "root", "=", "_gluster_xml", "(", "cmd", ")", "if", "not", "_gluster_ok", "(", "root", ")", ":"...
.. versionadded:: 2015.8.4 Return gluster volume info. name Optional name to retrieve only information of one volume CLI Example: .. code-block:: bash salt '*' glusterfs.info
[ "..", "versionadded", "::", "2015", ".", "8", ".", "4" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/glusterfs.py#L395-L439
train
Return gluster volume info.
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/glusterfs.py
start_volume
def start_volume(name, force=False): ''' Start a gluster volume name Volume name force Force the volume start even if the volume is started .. versionadded:: 2015.8.4 CLI Example: .. code-block:: bash salt '*' glusterfs.start mycluster ''' cmd = 'volu...
python
def start_volume(name, force=False): ''' Start a gluster volume name Volume name force Force the volume start even if the volume is started .. versionadded:: 2015.8.4 CLI Example: .. code-block:: bash salt '*' glusterfs.start mycluster ''' cmd = 'volu...
[ "def", "start_volume", "(", "name", ",", "force", "=", "False", ")", ":", "cmd", "=", "'volume start {0}'", ".", "format", "(", "name", ")", "if", "force", ":", "cmd", "=", "'{0} force'", ".", "format", "(", "cmd", ")", "volinfo", "=", "info", "(", "...
Start a gluster volume name Volume name force Force the volume start even if the volume is started .. versionadded:: 2015.8.4 CLI Example: .. code-block:: bash salt '*' glusterfs.start mycluster
[ "Start", "a", "gluster", "volume" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/glusterfs.py#L442-L472
train
Start a gluster volume
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/glusterfs.py
stop_volume
def stop_volume(name, force=False): ''' Stop a gluster volume name Volume name force Force stop the volume .. versionadded:: 2015.8.4 CLI Example: .. code-block:: bash salt '*' glusterfs.stop_volume mycluster ''' volinfo = info() if name not in v...
python
def stop_volume(name, force=False): ''' Stop a gluster volume name Volume name force Force stop the volume .. versionadded:: 2015.8.4 CLI Example: .. code-block:: bash salt '*' glusterfs.stop_volume mycluster ''' volinfo = info() if name not in v...
[ "def", "stop_volume", "(", "name", ",", "force", "=", "False", ")", ":", "volinfo", "=", "info", "(", ")", "if", "name", "not", "in", "volinfo", ":", "log", ".", "error", "(", "'Cannot stop non-existing volume %s'", ",", "name", ")", "return", "False", "...
Stop a gluster volume name Volume name force Force stop the volume .. versionadded:: 2015.8.4 CLI Example: .. code-block:: bash salt '*' glusterfs.stop_volume mycluster
[ "Stop", "a", "gluster", "volume" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/glusterfs.py#L475-L505
train
Stop a gluster volume
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/glusterfs.py
delete_volume
def delete_volume(target, stop=True): ''' Deletes a gluster volume target Volume to delete stop : True If ``True``, stop volume before delete CLI Example: .. code-block:: bash salt '*' glusterfs.delete_volume <volume> ''' volinfo = info() if target not in...
python
def delete_volume(target, stop=True): ''' Deletes a gluster volume target Volume to delete stop : True If ``True``, stop volume before delete CLI Example: .. code-block:: bash salt '*' glusterfs.delete_volume <volume> ''' volinfo = info() if target not in...
[ "def", "delete_volume", "(", "target", ",", "stop", "=", "True", ")", ":", "volinfo", "=", "info", "(", ")", "if", "target", "not", "in", "volinfo", ":", "log", ".", "error", "(", "'Cannot delete non-existing volume %s'", ",", "target", ")", "return", "Fal...
Deletes a gluster volume target Volume to delete stop : True If ``True``, stop volume before delete CLI Example: .. code-block:: bash salt '*' glusterfs.delete_volume <volume>
[ "Deletes", "a", "gluster", "volume" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/glusterfs.py#L508-L542
train
Delete a gluster volume
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/glusterfs.py
add_volume_bricks
def add_volume_bricks(name, bricks): ''' Add brick(s) to an existing volume name Volume name bricks List of bricks to add to the volume CLI Example: .. code-block:: bash salt '*' glusterfs.add_volume_bricks <volume> <bricks> ''' volinfo = info() if name ...
python
def add_volume_bricks(name, bricks): ''' Add brick(s) to an existing volume name Volume name bricks List of bricks to add to the volume CLI Example: .. code-block:: bash salt '*' glusterfs.add_volume_bricks <volume> <bricks> ''' volinfo = info() if name ...
[ "def", "add_volume_bricks", "(", "name", ",", "bricks", ")", ":", "volinfo", "=", "info", "(", ")", "if", "name", "not", "in", "volinfo", ":", "log", ".", "error", "(", "'Volume %s does not exist, cannot add bricks'", ",", "name", ")", "return", "False", "ne...
Add brick(s) to an existing volume name Volume name bricks List of bricks to add to the volume CLI Example: .. code-block:: bash salt '*' glusterfs.add_volume_bricks <volume> <bricks>
[ "Add", "brick", "(", "s", ")", "to", "an", "existing", "volume" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/glusterfs.py#L545-L589
train
Add bricks to an existing volume
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/glusterfs.py
set_quota_volume
def set_quota_volume(name, path, size, enable_quota=False): ''' Set quota to glusterfs volume. name Name of the gluster volume path Folder path for restriction in volume ("/") size Hard-limit size of the volume (MB/GB) enable_quota Enable quota before set up r...
python
def set_quota_volume(name, path, size, enable_quota=False): ''' Set quota to glusterfs volume. name Name of the gluster volume path Folder path for restriction in volume ("/") size Hard-limit size of the volume (MB/GB) enable_quota Enable quota before set up r...
[ "def", "set_quota_volume", "(", "name", ",", "path", ",", "size", ",", "enable_quota", "=", "False", ")", ":", "cmd", "=", "'volume quota {0}'", ".", "format", "(", "name", ")", "if", "path", ":", "cmd", "+=", "' limit-usage {0}'", ".", "format", "(", "p...
Set quota to glusterfs volume. name Name of the gluster volume path Folder path for restriction in volume ("/") size Hard-limit size of the volume (MB/GB) enable_quota Enable quota before set up restriction CLI Example: .. code-block:: bash salt '*'...
[ "Set", "quota", "to", "glusterfs", "volume", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/glusterfs.py#L632-L665
train
Sets quota for a glusterfs volume
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/glusterfs.py
unset_quota_volume
def unset_quota_volume(name, path): ''' Unset quota on glusterfs volume name Name of the gluster volume path Folder path for restriction in volume CLI Example: .. code-block:: bash salt '*' glusterfs.unset_quota_volume <volume> <path> ''' cmd = 'volume quota ...
python
def unset_quota_volume(name, path): ''' Unset quota on glusterfs volume name Name of the gluster volume path Folder path for restriction in volume CLI Example: .. code-block:: bash salt '*' glusterfs.unset_quota_volume <volume> <path> ''' cmd = 'volume quota ...
[ "def", "unset_quota_volume", "(", "name", ",", "path", ")", ":", "cmd", "=", "'volume quota {0}'", ".", "format", "(", "name", ")", "if", "path", ":", "cmd", "+=", "' remove {0}'", ".", "format", "(", "path", ")", "if", "not", "_gluster", "(", "cmd", "...
Unset quota on glusterfs volume name Name of the gluster volume path Folder path for restriction in volume CLI Example: .. code-block:: bash salt '*' glusterfs.unset_quota_volume <volume> <path>
[ "Unset", "quota", "on", "glusterfs", "volume" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/glusterfs.py#L668-L690
train
Unset quota on glusterfs volume
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/glusterfs.py
list_quota_volume
def list_quota_volume(name): ''' List quotas of glusterfs volume name Name of the gluster volume CLI Example: .. code-block:: bash salt '*' glusterfs.list_quota_volume <volume> ''' cmd = 'volume quota {0}'.format(name) cmd += ' list' root = _gluster_xml(cmd) ...
python
def list_quota_volume(name): ''' List quotas of glusterfs volume name Name of the gluster volume CLI Example: .. code-block:: bash salt '*' glusterfs.list_quota_volume <volume> ''' cmd = 'volume quota {0}'.format(name) cmd += ' list' root = _gluster_xml(cmd) ...
[ "def", "list_quota_volume", "(", "name", ")", ":", "cmd", "=", "'volume quota {0}'", ".", "format", "(", "name", ")", "cmd", "+=", "' list'", "root", "=", "_gluster_xml", "(", "cmd", ")", "if", "not", "_gluster_ok", "(", "root", ")", ":", "return", "None...
List quotas of glusterfs volume name Name of the gluster volume CLI Example: .. code-block:: bash salt '*' glusterfs.list_quota_volume <volume>
[ "List", "quotas", "of", "glusterfs", "volume" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/glusterfs.py#L693-L718
train
List quota of glusterfs volume
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/glusterfs.py
get_op_version
def get_op_version(name): ''' .. versionadded:: 2019.2.0 Returns the glusterfs volume op-version name Name of the glusterfs volume CLI Example: .. code-block:: bash salt '*' glusterfs.get_op_version <volume> ''' cmd = 'volume get {0} cluster.op-version'.format(name)...
python
def get_op_version(name): ''' .. versionadded:: 2019.2.0 Returns the glusterfs volume op-version name Name of the glusterfs volume CLI Example: .. code-block:: bash salt '*' glusterfs.get_op_version <volume> ''' cmd = 'volume get {0} cluster.op-version'.format(name)...
[ "def", "get_op_version", "(", "name", ")", ":", "cmd", "=", "'volume get {0} cluster.op-version'", ".", "format", "(", "name", ")", "root", "=", "_gluster_xml", "(", "cmd", ")", "if", "not", "_gluster_ok", "(", "root", ")", ":", "return", "False", ",", "ro...
.. versionadded:: 2019.2.0 Returns the glusterfs volume op-version name Name of the glusterfs volume CLI Example: .. code-block:: bash salt '*' glusterfs.get_op_version <volume>
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/glusterfs.py#L721-L753
train
Get the glusterfs volume op - 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/modules/glusterfs.py
get_max_op_version
def get_max_op_version(): ''' .. versionadded:: 2019.2.0 Returns the glusterfs volume's max op-version value Requires Glusterfs version > 3.9 CLI Example: .. code-block:: bash salt '*' glusterfs.get_max_op_version ''' if _get_version() < (3, 10,): return False, 'Gluste...
python
def get_max_op_version(): ''' .. versionadded:: 2019.2.0 Returns the glusterfs volume's max op-version value Requires Glusterfs version > 3.9 CLI Example: .. code-block:: bash salt '*' glusterfs.get_max_op_version ''' if _get_version() < (3, 10,): return False, 'Gluste...
[ "def", "get_max_op_version", "(", ")", ":", "if", "_get_version", "(", ")", "<", "(", "3", ",", "10", ",", ")", ":", "return", "False", ",", "'Glusterfs version must be 3.10+. Your version is {0}.'", ".", "format", "(", "str", "(", "'.'", ".", "join", "(", ...
.. versionadded:: 2019.2.0 Returns the glusterfs volume's max op-version value Requires Glusterfs version > 3.9 CLI Example: .. code-block:: bash salt '*' glusterfs.get_max_op_version
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/glusterfs.py#L756-L787
train
Get the max op - version of the glusterfs volume
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/glusterfs.py
set_op_version
def set_op_version(version): ''' .. versionadded:: 2019.2.0 Set the glusterfs volume op-version version Version to set the glusterfs volume op-version CLI Example: .. code-block:: bash salt '*' glusterfs.set_op_version <volume> ''' cmd = 'volume set all cluster.op-v...
python
def set_op_version(version): ''' .. versionadded:: 2019.2.0 Set the glusterfs volume op-version version Version to set the glusterfs volume op-version CLI Example: .. code-block:: bash salt '*' glusterfs.set_op_version <volume> ''' cmd = 'volume set all cluster.op-v...
[ "def", "set_op_version", "(", "version", ")", ":", "cmd", "=", "'volume set all cluster.op-version {0}'", ".", "format", "(", "version", ")", "root", "=", "_gluster_xml", "(", "cmd", ")", "if", "not", "_gluster_ok", "(", "root", ")", ":", "return", "False", ...
.. versionadded:: 2019.2.0 Set the glusterfs volume op-version version Version to set the glusterfs volume op-version CLI Example: .. code-block:: bash salt '*' glusterfs.set_op_version <volume>
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/glusterfs.py#L790-L812
train
Sets the glusterfs volume op - 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/modules/bower.py
_check_valid_version
def _check_valid_version(): ''' Check the version of Bower to ensure this module will work. Currently bower must be at least version 1.3. ''' # pylint: disable=no-member bower_version = _LooseVersion( __salt__['cmd.run']('bower --version')) valid_version = _LooseVersion('1.3') # ...
python
def _check_valid_version(): ''' Check the version of Bower to ensure this module will work. Currently bower must be at least version 1.3. ''' # pylint: disable=no-member bower_version = _LooseVersion( __salt__['cmd.run']('bower --version')) valid_version = _LooseVersion('1.3') # ...
[ "def", "_check_valid_version", "(", ")", ":", "# pylint: disable=no-member", "bower_version", "=", "_LooseVersion", "(", "__salt__", "[", "'cmd.run'", "]", "(", "'bower --version'", ")", ")", "valid_version", "=", "_LooseVersion", "(", "'1.3'", ")", "# pylint: enable=...
Check the version of Bower to ensure this module will work. Currently bower must be at least version 1.3.
[ "Check", "the", "version", "of", "Bower", "to", "ensure", "this", "module", "will", "work", ".", "Currently", "bower", "must", "be", "at", "least", "version", "1", ".", "3", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bower.py#L41-L57
train
Check the version of Bower to ensure this module will work. Currently bower must be at least version 1. 3.
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/bower.py
_construct_bower_command
def _construct_bower_command(bower_command): ''' Create bower command line string ''' if not bower_command: raise CommandExecutionError( 'bower_command, e.g. install, must be specified') cmd = ['bower'] + shlex.split(bower_command) cmd.extend(['--config.analytics', 'false', ...
python
def _construct_bower_command(bower_command): ''' Create bower command line string ''' if not bower_command: raise CommandExecutionError( 'bower_command, e.g. install, must be specified') cmd = ['bower'] + shlex.split(bower_command) cmd.extend(['--config.analytics', 'false', ...
[ "def", "_construct_bower_command", "(", "bower_command", ")", ":", "if", "not", "bower_command", ":", "raise", "CommandExecutionError", "(", "'bower_command, e.g. install, must be specified'", ")", "cmd", "=", "[", "'bower'", "]", "+", "shlex", ".", "split", "(", "b...
Create bower command line string
[ "Create", "bower", "command", "line", "string" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bower.py#L60-L72
train
Construct bower command line 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/bower.py
install
def install(pkg, dir, pkgs=None, runas=None, env=None): ''' Install a Bower package. If no package is specified, the dependencies (from bower.json) of the package in the given directory will be installed. pkg A package name in any format acce...
python
def install(pkg, dir, pkgs=None, runas=None, env=None): ''' Install a Bower package. If no package is specified, the dependencies (from bower.json) of the package in the given directory will be installed. pkg A package name in any format acce...
[ "def", "install", "(", "pkg", ",", "dir", ",", "pkgs", "=", "None", ",", "runas", "=", "None", ",", "env", "=", "None", ")", ":", "_check_valid_version", "(", ")", "cmd", "=", "_construct_bower_command", "(", "'install'", ")", "if", "pkg", ":", "cmd", ...
Install a Bower package. If no package is specified, the dependencies (from bower.json) of the package in the given directory will be installed. pkg A package name in any format accepted by Bower, including a version identifier dir The target directory in which to install the ...
[ "Install", "a", "Bower", "package", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bower.py#L75-L133
train
Install a Bower package in the given 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/modules/linux_sysctl.py
default_config
def default_config(): ''' Linux hosts using systemd 207 or later ignore ``/etc/sysctl.conf`` and only load from ``/etc/sysctl.d/*.conf``. This function will do the proper checks and return a default config file which will be valid for the Minion. Hosts running systemd >= 207 will use ``/etc/sysctl.d...
python
def default_config(): ''' Linux hosts using systemd 207 or later ignore ``/etc/sysctl.conf`` and only load from ``/etc/sysctl.d/*.conf``. This function will do the proper checks and return a default config file which will be valid for the Minion. Hosts running systemd >= 207 will use ``/etc/sysctl.d...
[ "def", "default_config", "(", ")", ":", "if", "salt", ".", "utils", ".", "systemd", ".", "booted", "(", "__context__", ")", "and", "salt", ".", "utils", ".", "systemd", ".", "version", "(", "__context__", ")", ">=", "207", ":", "return", "'/etc/sysctl.d/...
Linux hosts using systemd 207 or later ignore ``/etc/sysctl.conf`` and only load from ``/etc/sysctl.d/*.conf``. This function will do the proper checks and return a default config file which will be valid for the Minion. Hosts running systemd >= 207 will use ``/etc/sysctl.d/99-salt.conf``. CLI Example:...
[ "Linux", "hosts", "using", "systemd", "207", "or", "later", "ignore", "/", "etc", "/", "sysctl", ".", "conf", "and", "only", "load", "from", "/", "etc", "/", "sysctl", ".", "d", "/", "*", ".", "conf", ".", "This", "function", "will", "do", "the", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_sysctl.py#L40-L56
train
Return the default config file for the Minion
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/linux_sysctl.py
show
def show(config_file=False): ''' Return a list of sysctl parameters for this minion config: Pull the data from the system configuration file instead of the live data. CLI Example: .. code-block:: bash salt '*' sysctl.show ''' ret = {} if config_file: # If the ...
python
def show(config_file=False): ''' Return a list of sysctl parameters for this minion config: Pull the data from the system configuration file instead of the live data. CLI Example: .. code-block:: bash salt '*' sysctl.show ''' ret = {} if config_file: # If the ...
[ "def", "show", "(", "config_file", "=", "False", ")", ":", "ret", "=", "{", "}", "if", "config_file", ":", "# If the file doesn't exist, return an empty list", "if", "not", "os", ".", "path", ".", "exists", "(", "config_file", ")", ":", "return", "[", "]", ...
Return a list of sysctl parameters for this minion config: Pull the data from the system configuration file instead of the live data. CLI Example: .. code-block:: bash salt '*' sysctl.show
[ "Return", "a", "list", "of", "sysctl", "parameters", "for", "this", "minion" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_sysctl.py#L59-L102
train
Return a list of sysctl parameters for this minion
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/linux_sysctl.py
assign
def assign(name, value): ''' Assign a single sysctl parameter for this minion CLI Example: .. code-block:: bash salt '*' sysctl.assign net.ipv4.ip_forward 1 ''' value = six.text_type(value) if six.PY3: tran_tab = name.translate(''.maketrans('./', '/.')) else: ...
python
def assign(name, value): ''' Assign a single sysctl parameter for this minion CLI Example: .. code-block:: bash salt '*' sysctl.assign net.ipv4.ip_forward 1 ''' value = six.text_type(value) if six.PY3: tran_tab = name.translate(''.maketrans('./', '/.')) else: ...
[ "def", "assign", "(", "name", ",", "value", ")", ":", "value", "=", "six", ".", "text_type", "(", "value", ")", "if", "six", ".", "PY3", ":", "tran_tab", "=", "name", ".", "translate", "(", "''", ".", "maketrans", "(", "'./'", ",", "'/.'", ")", "...
Assign a single sysctl parameter for this minion CLI Example: .. code-block:: bash salt '*' sysctl.assign net.ipv4.ip_forward 1
[ "Assign", "a", "single", "sysctl", "parameter", "for", "this", "minion" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_sysctl.py#L120-L164
train
Assign a single sysctl parameter for this minion
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/linux_sysctl.py
persist
def persist(name, value, config=None): ''' Assign and persist a simple sysctl parameter for this minion. If ``config`` is not specified, a sensible default will be chosen using :mod:`sysctl.default_config <salt.modules.linux_sysctl.default_config>`. CLI Example: .. code-block:: bash s...
python
def persist(name, value, config=None): ''' Assign and persist a simple sysctl parameter for this minion. If ``config`` is not specified, a sensible default will be chosen using :mod:`sysctl.default_config <salt.modules.linux_sysctl.default_config>`. CLI Example: .. code-block:: bash s...
[ "def", "persist", "(", "name", ",", "value", ",", "config", "=", "None", ")", ":", "if", "config", "is", "None", ":", "config", "=", "default_config", "(", ")", "edited", "=", "False", "# If the sysctl.conf is not present, add it", "if", "not", "os", ".", ...
Assign and persist a simple sysctl parameter for this minion. If ``config`` is not specified, a sensible default will be chosen using :mod:`sysctl.default_config <salt.modules.linux_sysctl.default_config>`. CLI Example: .. code-block:: bash salt '*' sysctl.persist net.ipv4.ip_forward 1
[ "Assign", "and", "persist", "a", "simple", "sysctl", "parameter", "for", "this", "minion", ".", "If", "config", "is", "not", "specified", "a", "sensible", "default", "will", "be", "chosen", "using", ":", "mod", ":", "sysctl", ".", "default_config", "<salt", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_sysctl.py#L167-L256
train
Assign and persist a sysctl parameter for this minion.
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/pillar/mongo.py
ext_pillar
def ext_pillar(minion_id, pillar, # pylint: disable=W0613 collection='pillar', id_field='_id', re_pattern=None, re_replace='', fields=None): ''' Connect to a mongo database and read per-node pillar information. Param...
python
def ext_pillar(minion_id, pillar, # pylint: disable=W0613 collection='pillar', id_field='_id', re_pattern=None, re_replace='', fields=None): ''' Connect to a mongo database and read per-node pillar information. Param...
[ "def", "ext_pillar", "(", "minion_id", ",", "pillar", ",", "# pylint: disable=W0613", "collection", "=", "'pillar'", ",", "id_field", "=", "'_id'", ",", "re_pattern", "=", "None", ",", "re_replace", "=", "''", ",", "fields", "=", "None", ")", ":", "host", ...
Connect to a mongo database and read per-node pillar information. Parameters: * `collection`: The mongodb collection to read data from. Defaults to ``'pillar'``. * `id_field`: The field in the collection that represents an individual minion id. Defaults to ``'_id'``. * `...
[ "Connect", "to", "a", "mongo", "database", "and", "read", "per", "-", "node", "pillar", "information", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/mongo.py#L89-L165
train
Read pillar data from a single 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/utils/xmlutil.py
_conv_name
def _conv_name(x): ''' If this XML tree has an xmlns attribute, then etree will add it to the beginning of the tag, like: "{http://path}tag". ''' if '}' in x: comps = x.split('}') name = comps[1] return name return x
python
def _conv_name(x): ''' If this XML tree has an xmlns attribute, then etree will add it to the beginning of the tag, like: "{http://path}tag". ''' if '}' in x: comps = x.split('}') name = comps[1] return name return x
[ "def", "_conv_name", "(", "x", ")", ":", "if", "'}'", "in", "x", ":", "comps", "=", "x", ".", "split", "(", "'}'", ")", "name", "=", "comps", "[", "1", "]", "return", "name", "return", "x" ]
If this XML tree has an xmlns attribute, then etree will add it to the beginning of the tag, like: "{http://path}tag".
[ "If", "this", "XML", "tree", "has", "an", "xmlns", "attribute", "then", "etree", "will", "add", "it", "to", "the", "beginning", "of", "the", "tag", "like", ":", "{", "http", ":", "//", "path", "}", "tag", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/xmlutil.py#L10-L19
train
Convert XML tree name to name.
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/xmlutil.py
_to_dict
def _to_dict(xmltree): ''' Converts an XML ElementTree to a dictionary that only contains items. This is the default behavior in version 2017.7. This will default to prevent unexpected parsing issues on modules dependant on this. ''' # If this object has no children, the for..loop below will ret...
python
def _to_dict(xmltree): ''' Converts an XML ElementTree to a dictionary that only contains items. This is the default behavior in version 2017.7. This will default to prevent unexpected parsing issues on modules dependant on this. ''' # If this object has no children, the for..loop below will ret...
[ "def", "_to_dict", "(", "xmltree", ")", ":", "# If this object has no children, the for..loop below will return nothing", "# for it, so just return a single dict representing it.", "if", "not", "xmltree", ".", "getchildren", "(", ")", ":", "name", "=", "_conv_name", "(", "xml...
Converts an XML ElementTree to a dictionary that only contains items. This is the default behavior in version 2017.7. This will default to prevent unexpected parsing issues on modules dependant on this.
[ "Converts", "an", "XML", "ElementTree", "to", "a", "dictionary", "that", "only", "contains", "items", ".", "This", "is", "the", "default", "behavior", "in", "version", "2017", ".", "7", ".", "This", "will", "default", "to", "prevent", "unexpected", "parsing"...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/xmlutil.py#L22-L50
train
Converts an XML ElementTree to a dictionary that only contains items.
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/xmlutil.py
_to_full_dict
def _to_full_dict(xmltree): ''' Returns the full XML dictionary including attributes. ''' xmldict = {} for attrName, attrValue in xmltree.attrib.items(): xmldict[attrName] = attrValue if not xmltree.getchildren(): if not xmldict: # If we don't have attributes, we sh...
python
def _to_full_dict(xmltree): ''' Returns the full XML dictionary including attributes. ''' xmldict = {} for attrName, attrValue in xmltree.attrib.items(): xmldict[attrName] = attrValue if not xmltree.getchildren(): if not xmldict: # If we don't have attributes, we sh...
[ "def", "_to_full_dict", "(", "xmltree", ")", ":", "xmldict", "=", "{", "}", "for", "attrName", ",", "attrValue", "in", "xmltree", ".", "attrib", ".", "items", "(", ")", ":", "xmldict", "[", "attrName", "]", "=", "attrValue", "if", "not", "xmltree", "."...
Returns the full XML dictionary including attributes.
[ "Returns", "the", "full", "XML", "dictionary", "including", "attributes", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/xmlutil.py#L53-L86
train
Returns the full XML dictionary including attributes.
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/stateconf.py
_no_op
def _no_op(name, **kwargs): ''' No-op state to support state config via the stateconf renderer. ''' return dict(name=name, result=True, changes={}, comment='')
python
def _no_op(name, **kwargs): ''' No-op state to support state config via the stateconf renderer. ''' return dict(name=name, result=True, changes={}, comment='')
[ "def", "_no_op", "(", "name", ",", "*", "*", "kwargs", ")", ":", "return", "dict", "(", "name", "=", "name", ",", "result", "=", "True", ",", "changes", "=", "{", "}", ",", "comment", "=", "''", ")" ]
No-op state to support state config via the stateconf renderer.
[ "No", "-", "op", "state", "to", "support", "state", "config", "via", "the", "stateconf", "renderer", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/stateconf.py#L13-L17
train
No - op state to support state config via the stateconf renderer.
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/dockermod.py
_get_state
def _get_state(inspect_results): ''' Helper for deriving the current state of the container from the inspect results. ''' if inspect_results.get('State', {}).get('Paused', False): return 'paused' elif inspect_results.get('State', {}).get('Running', False): return 'running' el...
python
def _get_state(inspect_results): ''' Helper for deriving the current state of the container from the inspect results. ''' if inspect_results.get('State', {}).get('Paused', False): return 'paused' elif inspect_results.get('State', {}).get('Running', False): return 'running' el...
[ "def", "_get_state", "(", "inspect_results", ")", ":", "if", "inspect_results", ".", "get", "(", "'State'", ",", "{", "}", ")", ".", "get", "(", "'Paused'", ",", "False", ")", ":", "return", "'paused'", "elif", "inspect_results", ".", "get", "(", "'State...
Helper for deriving the current state of the container from the inspect results.
[ "Helper", "for", "deriving", "the", "current", "state", "of", "the", "container", "from", "the", "inspect", "results", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L395-L405
train
Helper for deriving the current state of the container from the inspect results.
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/dockermod.py
_docker_client
def _docker_client(wrapped): ''' Decorator to run a function that requires the use of a docker.Client() instance. ''' @functools.wraps(wrapped) def wrapper(*args, **kwargs): ''' Ensure that the client is present ''' kwargs = __utils__['args.clean_kwargs'](**kwargs...
python
def _docker_client(wrapped): ''' Decorator to run a function that requires the use of a docker.Client() instance. ''' @functools.wraps(wrapped) def wrapper(*args, **kwargs): ''' Ensure that the client is present ''' kwargs = __utils__['args.clean_kwargs'](**kwargs...
[ "def", "_docker_client", "(", "wrapped", ")", ":", "@", "functools", ".", "wraps", "(", "wrapped", ")", "def", "wrapper", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "'''\n Ensure that the client is present\n '''", "kwargs", "=", "__utils_...
Decorator to run a function that requires the use of a docker.Client() instance.
[ "Decorator", "to", "run", "a", "function", "that", "requires", "the", "use", "of", "a", "docker", ".", "Client", "()", "instance", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L409-L436
train
Decorator to run a function that requires the use of a docker. Client 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/dockermod.py
_refresh_mine_cache
def _refresh_mine_cache(wrapped): ''' Decorator to trigger a refresh of salt mine data. ''' @functools.wraps(wrapped) def wrapper(*args, **kwargs): ''' refresh salt mine on exit. ''' returned = wrapped(*args, **__utils__['args.clean_kwargs'](**kwargs)) if _che...
python
def _refresh_mine_cache(wrapped): ''' Decorator to trigger a refresh of salt mine data. ''' @functools.wraps(wrapped) def wrapper(*args, **kwargs): ''' refresh salt mine on exit. ''' returned = wrapped(*args, **__utils__['args.clean_kwargs'](**kwargs)) if _che...
[ "def", "_refresh_mine_cache", "(", "wrapped", ")", ":", "@", "functools", ".", "wraps", "(", "wrapped", ")", "def", "wrapper", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "'''\n refresh salt mine on exit.\n '''", "returned", "=", "wrapped"...
Decorator to trigger a refresh of salt mine data.
[ "Decorator", "to", "trigger", "a", "refresh", "of", "salt", "mine", "data", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L439-L453
train
Decorator to trigger a refresh of salt mine 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/dockermod.py
_change_state
def _change_state(name, action, expected, *args, **kwargs): ''' Change the state of a container ''' pre = state(name) if action != 'restart' and pre == expected: return {'result': False, 'state': {'old': expected, 'new': expected}, 'comment': ('Container \'{0}...
python
def _change_state(name, action, expected, *args, **kwargs): ''' Change the state of a container ''' pre = state(name) if action != 'restart' and pre == expected: return {'result': False, 'state': {'old': expected, 'new': expected}, 'comment': ('Container \'{0}...
[ "def", "_change_state", "(", "name", ",", "action", ",", "expected", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "pre", "=", "state", "(", "name", ")", "if", "action", "!=", "'restart'", "and", "pre", "==", "expected", ":", "return", "{", ...
Change the state of a container
[ "Change", "the", "state", "of", "a", "container" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L466-L485
train
Change the state of a container
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/dockermod.py
_get_md5
def _get_md5(name, path): ''' Get the MD5 checksum of a file from a container ''' output = run_stdout(name, 'md5sum {0}'.format(pipes.quote(path)), ignore_retcode=True) try: return output.split()[0] except IndexError: # Destination ...
python
def _get_md5(name, path): ''' Get the MD5 checksum of a file from a container ''' output = run_stdout(name, 'md5sum {0}'.format(pipes.quote(path)), ignore_retcode=True) try: return output.split()[0] except IndexError: # Destination ...
[ "def", "_get_md5", "(", "name", ",", "path", ")", ":", "output", "=", "run_stdout", "(", "name", ",", "'md5sum {0}'", ".", "format", "(", "pipes", ".", "quote", "(", "path", ")", ")", ",", "ignore_retcode", "=", "True", ")", "try", ":", "return", "ou...
Get the MD5 checksum of a file from a container
[ "Get", "the", "MD5", "checksum", "of", "a", "file", "from", "a", "container" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L507-L518
train
Get the MD5 checksum of a file from a container
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/dockermod.py
_get_exec_driver
def _get_exec_driver(): ''' Get the method to be used in shell commands ''' contextkey = 'docker.exec_driver' if contextkey not in __context__: from_config = __salt__['config.get'](contextkey, None) # This if block can be removed once we make docker-exec a default # option, a...
python
def _get_exec_driver(): ''' Get the method to be used in shell commands ''' contextkey = 'docker.exec_driver' if contextkey not in __context__: from_config = __salt__['config.get'](contextkey, None) # This if block can be removed once we make docker-exec a default # option, a...
[ "def", "_get_exec_driver", "(", ")", ":", "contextkey", "=", "'docker.exec_driver'", "if", "contextkey", "not", "in", "__context__", ":", "from_config", "=", "__salt__", "[", "'config.get'", "]", "(", "contextkey", ",", "None", ")", "# This if block can be removed o...
Get the method to be used in shell commands
[ "Get", "the", "method", "to", "be", "used", "in", "shell", "commands" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L521-L556
train
Get the method to be used in shell commands
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/dockermod.py
_get_top_level_images
def _get_top_level_images(imagedata, subset=None): ''' Returns a list of the top-level images (those which are not parents). If ``subset`` (an iterable) is passed, the top-level images in the subset will be returned, otherwise all top-level images will be returned. ''' try: parents = [im...
python
def _get_top_level_images(imagedata, subset=None): ''' Returns a list of the top-level images (those which are not parents). If ``subset`` (an iterable) is passed, the top-level images in the subset will be returned, otherwise all top-level images will be returned. ''' try: parents = [im...
[ "def", "_get_top_level_images", "(", "imagedata", ",", "subset", "=", "None", ")", ":", "try", ":", "parents", "=", "[", "imagedata", "[", "x", "]", "[", "'ParentId'", "]", "for", "x", "in", "imagedata", "]", "filter_", "=", "subset", "if", "subset", "...
Returns a list of the top-level images (those which are not parents). If ``subset`` (an iterable) is passed, the top-level images in the subset will be returned, otherwise all top-level images will be returned.
[ "Returns", "a", "list", "of", "the", "top", "-", "level", "images", "(", "those", "which", "are", "not", "parents", ")", ".", "If", "subset", "(", "an", "iterable", ")", "is", "passed", "the", "top", "-", "level", "images", "in", "the", "subset", "wi...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L559-L573
train
Returns a list of the top - level images that are not parents.
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/dockermod.py
_scrub_links
def _scrub_links(links, name): ''' Remove container name from HostConfig:Links values to enable comparing container configurations correctly. ''' if isinstance(links, list): ret = [] for l in links: ret.append(l.replace('/{0}/'.format(name), '/', 1)) else: ret...
python
def _scrub_links(links, name): ''' Remove container name from HostConfig:Links values to enable comparing container configurations correctly. ''' if isinstance(links, list): ret = [] for l in links: ret.append(l.replace('/{0}/'.format(name), '/', 1)) else: ret...
[ "def", "_scrub_links", "(", "links", ",", "name", ")", ":", "if", "isinstance", "(", "links", ",", "list", ")", ":", "ret", "=", "[", "]", "for", "l", "in", "links", ":", "ret", ".", "append", "(", "l", ".", "replace", "(", "'/{0}/'", ".", "forma...
Remove container name from HostConfig:Links values to enable comparing container configurations correctly.
[ "Remove", "container", "name", "from", "HostConfig", ":", "Links", "values", "to", "enable", "comparing", "container", "configurations", "correctly", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L584-L596
train
Remove container name from HostConfig : Links values to enable comparing container configurations correctly.
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/dockermod.py
_size_fmt
def _size_fmt(num): ''' Format bytes as human-readable file sizes ''' try: num = int(num) if num < 1024: return '{0} bytes'.format(num) num /= 1024.0 for unit in ('KiB', 'MiB', 'GiB', 'TiB', 'PiB'): if num < 1024.0: return '{0:3.1f}...
python
def _size_fmt(num): ''' Format bytes as human-readable file sizes ''' try: num = int(num) if num < 1024: return '{0} bytes'.format(num) num /= 1024.0 for unit in ('KiB', 'MiB', 'GiB', 'TiB', 'PiB'): if num < 1024.0: return '{0:3.1f}...
[ "def", "_size_fmt", "(", "num", ")", ":", "try", ":", "num", "=", "int", "(", "num", ")", "if", "num", "<", "1024", ":", "return", "'{0} bytes'", ".", "format", "(", "num", ")", "num", "/=", "1024.0", "for", "unit", "in", "(", "'KiB'", ",", "'MiB...
Format bytes as human-readable file sizes
[ "Format", "bytes", "as", "human", "-", "readable", "file", "sizes" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L608-L623
train
Format file size as human - readable file sizes
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/dockermod.py
_client_wrapper
def _client_wrapper(attr, *args, **kwargs): ''' Common functionality for running low-level API calls ''' catch_api_errors = kwargs.pop('catch_api_errors', True) func = getattr(__context__['docker.client'], attr, None) if func is None or not hasattr(func, '__call__'): raise SaltInvocation...
python
def _client_wrapper(attr, *args, **kwargs): ''' Common functionality for running low-level API calls ''' catch_api_errors = kwargs.pop('catch_api_errors', True) func = getattr(__context__['docker.client'], attr, None) if func is None or not hasattr(func, '__call__'): raise SaltInvocation...
[ "def", "_client_wrapper", "(", "attr", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "catch_api_errors", "=", "kwargs", ".", "pop", "(", "'catch_api_errors'", ",", "True", ")", "func", "=", "getattr", "(", "__context__", "[", "'docker.client'", "]",...
Common functionality for running low-level API calls
[ "Common", "functionality", "for", "running", "low", "-", "level", "API", "calls" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L627-L671
train
Wrapper for running low - level API calls
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/dockermod.py
_build_status
def _build_status(data, item): ''' Process a status update from a docker build, updating the data structure ''' stream = item['stream'] if 'Running in' in stream: data.setdefault('Intermediate_Containers', []).append( stream.rstrip().split()[-1]) if 'Successfully built' in st...
python
def _build_status(data, item): ''' Process a status update from a docker build, updating the data structure ''' stream = item['stream'] if 'Running in' in stream: data.setdefault('Intermediate_Containers', []).append( stream.rstrip().split()[-1]) if 'Successfully built' in st...
[ "def", "_build_status", "(", "data", ",", "item", ")", ":", "stream", "=", "item", "[", "'stream'", "]", "if", "'Running in'", "in", "stream", ":", "data", ".", "setdefault", "(", "'Intermediate_Containers'", ",", "[", "]", ")", ".", "append", "(", "stre...
Process a status update from a docker build, updating the data structure
[ "Process", "a", "status", "update", "from", "a", "docker", "build", "updating", "the", "data", "structure" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L674-L683
train
Process a status update from a docker build updating the data 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/modules/dockermod.py
_import_status
def _import_status(data, item, repo_name, repo_tag): ''' Process a status update from docker import, updating the data structure ''' status = item['status'] try: if 'Downloading from' in status: return elif all(x in string.hexdigits for x in status): # Status ...
python
def _import_status(data, item, repo_name, repo_tag): ''' Process a status update from docker import, updating the data structure ''' status = item['status'] try: if 'Downloading from' in status: return elif all(x in string.hexdigits for x in status): # Status ...
[ "def", "_import_status", "(", "data", ",", "item", ",", "repo_name", ",", "repo_tag", ")", ":", "status", "=", "item", "[", "'status'", "]", "try", ":", "if", "'Downloading from'", "in", "status", ":", "return", "elif", "all", "(", "x", "in", "string", ...
Process a status update from docker import, updating the data structure
[ "Process", "a", "status", "update", "from", "docker", "import", "updating", "the", "data", "structure" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L686-L699
train
Process a status update from docker import updating the data 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/modules/dockermod.py
_pull_status
def _pull_status(data, item): ''' Process a status update from a docker pull, updating the data structure. For containers created with older versions of Docker, there is no distinction in the status updates between layers that were already present (and thus not necessary to download), and those whi...
python
def _pull_status(data, item): ''' Process a status update from a docker pull, updating the data structure. For containers created with older versions of Docker, there is no distinction in the status updates between layers that were already present (and thus not necessary to download), and those whi...
[ "def", "_pull_status", "(", "data", ",", "item", ")", ":", "def", "_already_exists", "(", "id_", ")", ":", "'''\n Layer already exists\n '''", "already_pulled", "=", "data", ".", "setdefault", "(", "'Layers'", ",", "{", "}", ")", ".", "setdefault",...
Process a status update from a docker pull, updating the data structure. For containers created with older versions of Docker, there is no distinction in the status updates between layers that were already present (and thus not necessary to download), and those which were actually downloaded. Because o...
[ "Process", "a", "status", "update", "from", "a", "docker", "pull", "updating", "the", "data", "structure", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L702-L759
train
Process a status update from a docker pull and update the data 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/modules/dockermod.py
_push_status
def _push_status(data, item): ''' Process a status update from a docker push, updating the data structure ''' status = item['status'].lower() if 'id' in item: if 'already pushed' in status or 'already exists' in status: # Layer already exists already_pushed = data.set...
python
def _push_status(data, item): ''' Process a status update from a docker push, updating the data structure ''' status = item['status'].lower() if 'id' in item: if 'already pushed' in status or 'already exists' in status: # Layer already exists already_pushed = data.set...
[ "def", "_push_status", "(", "data", ",", "item", ")", ":", "status", "=", "item", "[", "'status'", "]", ".", "lower", "(", ")", "if", "'id'", "in", "item", ":", "if", "'already pushed'", "in", "status", "or", "'already exists'", "in", "status", ":", "#...
Process a status update from a docker push, updating the data structure
[ "Process", "a", "status", "update", "from", "a", "docker", "push", "updating", "the", "data", "structure" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L762-L777
train
Process a status update from a docker push updating the data structure RS
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/dockermod.py
_error_detail
def _error_detail(data, item): ''' Process an API error, updating the data structure ''' err = item['errorDetail'] if 'code' in err: try: msg = ': '.join(( item['errorDetail']['code'], item['errorDetail']['message'] )) except Ty...
python
def _error_detail(data, item): ''' Process an API error, updating the data structure ''' err = item['errorDetail'] if 'code' in err: try: msg = ': '.join(( item['errorDetail']['code'], item['errorDetail']['message'] )) except Ty...
[ "def", "_error_detail", "(", "data", ",", "item", ")", ":", "err", "=", "item", "[", "'errorDetail'", "]", "if", "'code'", "in", "err", ":", "try", ":", "msg", "=", "': '", ".", "join", "(", "(", "item", "[", "'errorDetail'", "]", "[", "'code'", "]...
Process an API error, updating the data structure
[ "Process", "an", "API", "error", "updating", "the", "data", "structure" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L780-L798
train
Process an API error and update the data 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/modules/dockermod.py
_get_create_kwargs
def _get_create_kwargs(skip_translate=None, ignore_collisions=False, validate_ip_addrs=True, client_args=None, **kwargs): ''' Take input kwargs and return a kwargs dict to pass to docker-py's create_container() funct...
python
def _get_create_kwargs(skip_translate=None, ignore_collisions=False, validate_ip_addrs=True, client_args=None, **kwargs): ''' Take input kwargs and return a kwargs dict to pass to docker-py's create_container() funct...
[ "def", "_get_create_kwargs", "(", "skip_translate", "=", "None", ",", "ignore_collisions", "=", "False", ",", "validate_ip_addrs", "=", "True", ",", "client_args", "=", "None", ",", "*", "*", "kwargs", ")", ":", "networks", "=", "kwargs", ".", "pop", "(", ...
Take input kwargs and return a kwargs dict to pass to docker-py's create_container() function.
[ "Take", "input", "kwargs", "and", "return", "a", "kwargs", "dict", "to", "pass", "to", "docker", "-", "py", "s", "create_container", "()", "function", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L852-L907
train
Take input kwargs and return a kwargs dict to pass to docker - py s create_container 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/modules/dockermod.py
compare_containers
def compare_containers(first, second, ignore=None): ''' .. versionadded:: 2017.7.0 .. versionchanged:: 2018.3.0 Renamed from ``docker.compare_container`` to ``docker.compare_containers`` (old function name remains as an alias) Compare two containers' Config and and HostConfig and return...
python
def compare_containers(first, second, ignore=None): ''' .. versionadded:: 2017.7.0 .. versionchanged:: 2018.3.0 Renamed from ``docker.compare_container`` to ``docker.compare_containers`` (old function name remains as an alias) Compare two containers' Config and and HostConfig and return...
[ "def", "compare_containers", "(", "first", ",", "second", ",", "ignore", "=", "None", ")", ":", "ignore", "=", "__utils__", "[", "'args.split_input'", "]", "(", "ignore", "or", "[", "]", ")", "result1", "=", "inspect_container", "(", "first", ")", "result2...
.. versionadded:: 2017.7.0 .. versionchanged:: 2018.3.0 Renamed from ``docker.compare_container`` to ``docker.compare_containers`` (old function name remains as an alias) Compare two containers' Config and and HostConfig and return any differences between the two. first Name or...
[ "..", "versionadded", "::", "2017", ".", "7", ".", "0", "..", "versionchanged", "::", "2018", ".", "3", ".", "0", "Renamed", "from", "docker", ".", "compare_container", "to", "docker", ".", "compare_containers", "(", "old", "function", "name", "remains", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L910-L1004
train
Compare two containers and return any containers which differ between them.
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/dockermod.py
compare_container_networks
def compare_container_networks(first, second): ''' .. versionadded:: 2018.3.0 Returns the differences between two containers' networks. When a network is only present one of the two containers, that network's diff will simply be represented with ``True`` for the side of the diff in which the networ...
python
def compare_container_networks(first, second): ''' .. versionadded:: 2018.3.0 Returns the differences between two containers' networks. When a network is only present one of the two containers, that network's diff will simply be represented with ``True`` for the side of the diff in which the networ...
[ "def", "compare_container_networks", "(", "first", ",", "second", ")", ":", "def", "_get_nets", "(", "data", ")", ":", "return", "data", ".", "get", "(", "'NetworkSettings'", ",", "{", "}", ")", ".", "get", "(", "'Networks'", ",", "{", "}", ")", "compa...
.. versionadded:: 2018.3.0 Returns the differences between two containers' networks. When a network is only present one of the two containers, that network's diff will simply be represented with ``True`` for the side of the diff in which the network is present) and ``False`` for the side of the diff in...
[ "..", "versionadded", "::", "2018", ".", "3", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L1012-L1248
train
Compare two containers with the same network.
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/dockermod.py
compare_networks
def compare_networks(first, second, ignore='Name,Id,Created,Containers'): ''' .. versionadded:: 2018.3.0 Compare two networks and return any differences between the two first Name or ID of first container second Name or ID of second container ignore : Name,Id,Created,Containe...
python
def compare_networks(first, second, ignore='Name,Id,Created,Containers'): ''' .. versionadded:: 2018.3.0 Compare two networks and return any differences between the two first Name or ID of first container second Name or ID of second container ignore : Name,Id,Created,Containe...
[ "def", "compare_networks", "(", "first", ",", "second", ",", "ignore", "=", "'Name,Id,Created,Containers'", ")", ":", "ignore", "=", "__utils__", "[", "'args.split_input'", "]", "(", "ignore", "or", "[", "]", ")", "net1", "=", "inspect_network", "(", "first", ...
.. versionadded:: 2018.3.0 Compare two networks and return any differences between the two first Name or ID of first container second Name or ID of second container ignore : Name,Id,Created,Containers A comma-separated list (or Python list) of keys to ignore when comp...
[ "..", "versionadded", "::", "2018", ".", "3", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L1251-L1322
train
Compare two networks and return any differences between them
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/dockermod.py
connected
def connected(name, verbose=False): ''' .. versionadded:: 2018.3.0 Return a list of running containers attached to the specified network name Network name verbose : False If ``True``, return extended info about each container (IP configuration, etc.) CLI Example: ...
python
def connected(name, verbose=False): ''' .. versionadded:: 2018.3.0 Return a list of running containers attached to the specified network name Network name verbose : False If ``True``, return extended info about each container (IP configuration, etc.) CLI Example: ...
[ "def", "connected", "(", "name", ",", "verbose", "=", "False", ")", ":", "containers", "=", "inspect_network", "(", "name", ")", ".", "get", "(", "'Containers'", ",", "{", "}", ")", "ret", "=", "{", "}", "for", "cid", ",", "cinfo", "in", "six", "."...
.. versionadded:: 2018.3.0 Return a list of running containers attached to the specified network name Network name verbose : False If ``True``, return extended info about each container (IP configuration, etc.) CLI Example: .. code-block:: bash salt myminion doc...
[ "..", "versionadded", "::", "2018", ".", "3", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L1325-L1366
train
Return a list of running containers attached to the specified network
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/dockermod.py
login
def login(*registries): ''' .. versionadded:: 2016.3.7,2016.11.4,2017.7.0 Performs a ``docker login`` to authenticate to one or more configured repositories. See the documentation at the top of this page to configure authentication credentials. Multiple registry URLs (matching those configured...
python
def login(*registries): ''' .. versionadded:: 2016.3.7,2016.11.4,2017.7.0 Performs a ``docker login`` to authenticate to one or more configured repositories. See the documentation at the top of this page to configure authentication credentials. Multiple registry URLs (matching those configured...
[ "def", "login", "(", "*", "registries", ")", ":", "# NOTE: This function uses the \"docker login\" CLI command so that login", "# information is added to the config.json, since docker-py isn't designed", "# to do so.", "registry_auth", "=", "__pillar__", ".", "get", "(", "'docker-reg...
.. versionadded:: 2016.3.7,2016.11.4,2017.7.0 Performs a ``docker login`` to authenticate to one or more configured repositories. See the documentation at the top of this page to configure authentication credentials. Multiple registry URLs (matching those configured in Pillar) can be passed, and S...
[ "..", "versionadded", "::", "2016", ".", "3", ".", "7", "2016", ".", "11", ".", "4", "2017", ".", "7", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L1369-L1465
train
Authenticate to one or more configured registry URLs.
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/dockermod.py
depends
def depends(name): ''' Returns the containers and images, if any, which depend on the given image name Name or ID of image **RETURN DATA** A dictionary containing the following keys: - ``Containers`` - A list of containers which depend on the specified image - ``Images`` - A lis...
python
def depends(name): ''' Returns the containers and images, if any, which depend on the given image name Name or ID of image **RETURN DATA** A dictionary containing the following keys: - ``Containers`` - A list of containers which depend on the specified image - ``Images`` - A lis...
[ "def", "depends", "(", "name", ")", ":", "# Resolve tag or short-SHA to full SHA", "image_id", "=", "inspect_image", "(", "name", ")", "[", "'Id'", "]", "container_depends", "=", "[", "]", "for", "container", "in", "six", ".", "itervalues", "(", "ps_", "(", ...
Returns the containers and images, if any, which depend on the given image name Name or ID of image **RETURN DATA** A dictionary containing the following keys: - ``Containers`` - A list of containers which depend on the specified image - ``Images`` - A list of IDs of images which depend...
[ "Returns", "the", "containers", "and", "images", "if", "any", "which", "depend", "on", "the", "given", "image" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L1469-L1506
train
Returns the containers and images which depend on the given image
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/dockermod.py
diff
def diff(name): ''' Get information on changes made to container's filesystem since it was created. Equivalent to running the ``docker diff`` Docker CLI command. name Container name or ID **RETURN DATA** A dictionary containing any of the following keys: - ``Added`` - A list of ...
python
def diff(name): ''' Get information on changes made to container's filesystem since it was created. Equivalent to running the ``docker diff`` Docker CLI command. name Container name or ID **RETURN DATA** A dictionary containing any of the following keys: - ``Added`` - A list of ...
[ "def", "diff", "(", "name", ")", ":", "changes", "=", "_client_wrapper", "(", "'diff'", ",", "name", ")", "kind_map", "=", "{", "0", ":", "'Changed'", ",", "1", ":", "'Added'", ",", "2", ":", "'Deleted'", "}", "ret", "=", "{", "}", "for", "change",...
Get information on changes made to container's filesystem since it was created. Equivalent to running the ``docker diff`` Docker CLI command. name Container name or ID **RETURN DATA** A dictionary containing any of the following keys: - ``Added`` - A list of paths that were added. -...
[ "Get", "information", "on", "changes", "made", "to", "container", "s", "filesystem", "since", "it", "was", "created", ".", "Equivalent", "to", "running", "the", "docker", "diff", "Docker", "CLI", "command", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L1509-L1548
train
Returns a dictionary containing the changes made to the container s filesystem since it was created.
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/dockermod.py
exists
def exists(name): ''' Check if a given container exists name Container name or ID **RETURN DATA** A boolean (``True`` if the container exists, otherwise ``False``) CLI Example: .. code-block:: bash salt myminion docker.exists mycontainer ''' contextkey = 'dock...
python
def exists(name): ''' Check if a given container exists name Container name or ID **RETURN DATA** A boolean (``True`` if the container exists, otherwise ``False``) CLI Example: .. code-block:: bash salt myminion docker.exists mycontainer ''' contextkey = 'dock...
[ "def", "exists", "(", "name", ")", ":", "contextkey", "=", "'docker.exists.{0}'", ".", "format", "(", "name", ")", "if", "contextkey", "in", "__context__", ":", "return", "__context__", "[", "contextkey", "]", "try", ":", "c_info", "=", "_client_wrapper", "(...
Check if a given container exists name Container name or ID **RETURN DATA** A boolean (``True`` if the container exists, otherwise ``False``) CLI Example: .. code-block:: bash salt myminion docker.exists mycontainer
[ "Check", "if", "a", "given", "container", "exists" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L1551-L1581
train
Check if a given container 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/dockermod.py
history
def history(name, quiet=False): ''' Return the history for an image. Equivalent to running the ``docker history`` Docker CLI command. name Container name or ID quiet : False If ``True``, the return data will simply be a list of the commands run to build the container. ...
python
def history(name, quiet=False): ''' Return the history for an image. Equivalent to running the ``docker history`` Docker CLI command. name Container name or ID quiet : False If ``True``, the return data will simply be a list of the commands run to build the container. ...
[ "def", "history", "(", "name", ",", "quiet", "=", "False", ")", ":", "response", "=", "_client_wrapper", "(", "'history'", ",", "name", ")", "key_map", "=", "{", "'CreatedBy'", ":", "'Command'", ",", "'Created'", ":", "'Time_Created_Epoch'", ",", "}", "com...
Return the history for an image. Equivalent to running the ``docker history`` Docker CLI command. name Container name or ID quiet : False If ``True``, the return data will simply be a list of the commands run to build the container. .. code-block:: bash $ salt...
[ "Return", "the", "history", "for", "an", "image", ".", "Equivalent", "to", "running", "the", "docker", "history", "Docker", "CLI", "command", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L1584-L1670
train
Return the history for an image.
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/dockermod.py
images
def images(verbose=False, **kwargs): ''' Returns information about the Docker images on the Minion. Equivalent to running the ``docker images`` Docker CLI command. all : False If ``True``, untagged images will also be returned verbose : False If ``True``, a ``docker inspect`` will ...
python
def images(verbose=False, **kwargs): ''' Returns information about the Docker images on the Minion. Equivalent to running the ``docker images`` Docker CLI command. all : False If ``True``, untagged images will also be returned verbose : False If ``True``, a ``docker inspect`` will ...
[ "def", "images", "(", "verbose", "=", "False", ",", "*", "*", "kwargs", ")", ":", "if", "'docker.images'", "not", "in", "__context__", ":", "response", "=", "_client_wrapper", "(", "'images'", ",", "all", "=", "kwargs", ".", "get", "(", "'all'", ",", "...
Returns information about the Docker images on the Minion. Equivalent to running the ``docker images`` Docker CLI command. all : False If ``True``, untagged images will also be returned verbose : False If ``True``, a ``docker inspect`` will be run on each image returned. **RETURN DAT...
[ "Returns", "information", "about", "the", "Docker", "images", "on", "the", "Minion", ".", "Equivalent", "to", "running", "the", "docker", "images", "Docker", "CLI", "command", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L1673-L1739
train
Return information about the Docker images on the Minion.
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/dockermod.py
inspect
def inspect(name): ''' .. versionchanged:: 2017.7.0 Volumes and networks are now checked, in addition to containers and images. This is a generic container/image/volume/network inspecton function. It will run the following functions in order: - :py:func:`docker.inspect_container ...
python
def inspect(name): ''' .. versionchanged:: 2017.7.0 Volumes and networks are now checked, in addition to containers and images. This is a generic container/image/volume/network inspecton function. It will run the following functions in order: - :py:func:`docker.inspect_container ...
[ "def", "inspect", "(", "name", ")", ":", "try", ":", "return", "inspect_container", "(", "name", ")", "except", "CommandExecutionError", "as", "exc", ":", "if", "'does not exist'", "not", "in", "exc", ".", "strerror", ":", "raise", "try", ":", "return", "i...
.. versionchanged:: 2017.7.0 Volumes and networks are now checked, in addition to containers and images. This is a generic container/image/volume/network inspecton function. It will run the following functions in order: - :py:func:`docker.inspect_container <salt.modules.dockermod.ins...
[ "..", "versionchanged", "::", "2017", ".", "7", ".", "0", "Volumes", "and", "networks", "are", "now", "checked", "in", "addition", "to", "containers", "and", "images", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L1756-L1812
train
Inspect a container image volume or network
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/dockermod.py
inspect_image
def inspect_image(name): ''' Retrieves image information. Equivalent to running the ``docker inspect`` Docker CLI command, but will only look for image information. .. note:: To inspect an image, it must have been pulled from a registry or built locally. Images on a Docker registry whic...
python
def inspect_image(name): ''' Retrieves image information. Equivalent to running the ``docker inspect`` Docker CLI command, but will only look for image information. .. note:: To inspect an image, it must have been pulled from a registry or built locally. Images on a Docker registry whic...
[ "def", "inspect_image", "(", "name", ")", ":", "ret", "=", "_client_wrapper", "(", "'inspect_image'", ",", "name", ")", "for", "param", "in", "(", "'Size'", ",", "'VirtualSize'", ")", ":", "if", "param", "in", "ret", ":", "ret", "[", "'{0}_Human'", ".", ...
Retrieves image information. Equivalent to running the ``docker inspect`` Docker CLI command, but will only look for image information. .. note:: To inspect an image, it must have been pulled from a registry or built locally. Images on a Docker registry which have not been pulled cannot ...
[ "Retrieves", "image", "information", ".", "Equivalent", "to", "running", "the", "docker", "inspect", "Docker", "CLI", "command", "but", "will", "only", "look", "for", "image", "information", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L1839-L1870
train
Inspect an image.
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/dockermod.py
list_containers
def list_containers(**kwargs): ''' Returns a list of containers by name. This is different from :py:func:`docker.ps <salt.modules.dockermod.ps_>` in that :py:func:`docker.ps <salt.modules.dockermod.ps_>` returns its results organized by container ID. all : False If ``True``, stopped con...
python
def list_containers(**kwargs): ''' Returns a list of containers by name. This is different from :py:func:`docker.ps <salt.modules.dockermod.ps_>` in that :py:func:`docker.ps <salt.modules.dockermod.ps_>` returns its results organized by container ID. all : False If ``True``, stopped con...
[ "def", "list_containers", "(", "*", "*", "kwargs", ")", ":", "ret", "=", "set", "(", ")", "for", "item", "in", "six", ".", "itervalues", "(", "ps_", "(", "all", "=", "kwargs", ".", "get", "(", "'all'", ",", "False", ")", ")", ")", ":", "names", ...
Returns a list of containers by name. This is different from :py:func:`docker.ps <salt.modules.dockermod.ps_>` in that :py:func:`docker.ps <salt.modules.dockermod.ps_>` returns its results organized by container ID. all : False If ``True``, stopped containers will be included in return data ...
[ "Returns", "a", "list", "of", "containers", "by", "name", ".", "This", "is", "different", "from", ":", "py", ":", "func", ":", "docker", ".", "ps", "<salt", ".", "modules", ".", "dockermod", ".", "ps_", ">", "in", "that", ":", "py", ":", "func", ":...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L1873-L1896
train
Returns a list of containers by name. This is different from the list_containers method in thatis corrected for the Docker CLI.
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/dockermod.py
list_tags
def list_tags(): ''' Returns a list of tagged images CLI Example: .. code-block:: bash salt myminion docker.list_tags ''' ret = set() for item in six.itervalues(images()): if not item.get('RepoTags'): continue ret.update(set(item['RepoTags'])) retur...
python
def list_tags(): ''' Returns a list of tagged images CLI Example: .. code-block:: bash salt myminion docker.list_tags ''' ret = set() for item in six.itervalues(images()): if not item.get('RepoTags'): continue ret.update(set(item['RepoTags'])) retur...
[ "def", "list_tags", "(", ")", ":", "ret", "=", "set", "(", ")", "for", "item", "in", "six", ".", "itervalues", "(", "images", "(", ")", ")", ":", "if", "not", "item", ".", "get", "(", "'RepoTags'", ")", ":", "continue", "ret", ".", "update", "(",...
Returns a list of tagged images CLI Example: .. code-block:: bash salt myminion docker.list_tags
[ "Returns", "a", "list", "of", "tagged", "images" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L1899-L1914
train
Returns a list of tagged images
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/dockermod.py
resolve_image_id
def resolve_image_id(name): ''' .. versionadded:: 2018.3.0 Given an image name (or partial image ID), return the full image ID. If no match is found among the locally-pulled images, then ``False`` will be returned. CLI Examples: .. code-block:: bash salt myminion docker.resolve_i...
python
def resolve_image_id(name): ''' .. versionadded:: 2018.3.0 Given an image name (or partial image ID), return the full image ID. If no match is found among the locally-pulled images, then ``False`` will be returned. CLI Examples: .. code-block:: bash salt myminion docker.resolve_i...
[ "def", "resolve_image_id", "(", "name", ")", ":", "try", ":", "inspect_result", "=", "inspect_image", "(", "name", ")", "return", "inspect_result", "[", "'Id'", "]", "except", "CommandExecutionError", ":", "# No matching image pulled locally, or inspect_image otherwise fa...
.. versionadded:: 2018.3.0 Given an image name (or partial image ID), return the full image ID. If no match is found among the locally-pulled images, then ``False`` will be returned. CLI Examples: .. code-block:: bash salt myminion docker.resolve_image_id foo salt myminion docker...
[ "..", "versionadded", "::", "2018", ".", "3", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L1917-L1944
train
Given an image name or partial image ID return the full image ID.
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/dockermod.py
resolve_tag
def resolve_tag(name, **kwargs): ''' .. versionadded:: 2017.7.2 .. versionchanged:: 2018.3.0 Instead of matching against pulled tags using :py:func:`docker.list_tags <salt.modules.dockermod.list_tags>`, this function now simply inspects the passed image name using :py:func:`d...
python
def resolve_tag(name, **kwargs): ''' .. versionadded:: 2017.7.2 .. versionchanged:: 2018.3.0 Instead of matching against pulled tags using :py:func:`docker.list_tags <salt.modules.dockermod.list_tags>`, this function now simply inspects the passed image name using :py:func:`d...
[ "def", "resolve_tag", "(", "name", ",", "*", "*", "kwargs", ")", ":", "kwargs", "=", "__utils__", "[", "'args.clean_kwargs'", "]", "(", "*", "*", "kwargs", ")", "all_", "=", "kwargs", ".", "pop", "(", "'all'", ",", "False", ")", "if", "kwargs", ":", ...
.. versionadded:: 2017.7.2 .. versionchanged:: 2018.3.0 Instead of matching against pulled tags using :py:func:`docker.list_tags <salt.modules.dockermod.list_tags>`, this function now simply inspects the passed image name using :py:func:`docker.inspect_image <salt.modules.dockermod.i...
[ "..", "versionadded", "::", "2017", ".", "7", ".", "2", "..", "versionchanged", "::", "2018", ".", "3", ".", "0", "Instead", "of", "matching", "against", "pulled", "tags", "using", ":", "py", ":", "func", ":", "docker", ".", "list_tags", "<salt", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L1947-L2012
train
Return the first matching tag for the passed image name.
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/dockermod.py
logs
def logs(name, **kwargs): ''' .. versionchanged:: 2018.3.0 Support for all of docker-py's `logs()`_ function's arguments, with the exception of ``stream``. Returns the logs for the container. An interface to docker-py's `logs()`_ function. name Container name or ID std...
python
def logs(name, **kwargs): ''' .. versionchanged:: 2018.3.0 Support for all of docker-py's `logs()`_ function's arguments, with the exception of ``stream``. Returns the logs for the container. An interface to docker-py's `logs()`_ function. name Container name or ID std...
[ "def", "logs", "(", "name", ",", "*", "*", "kwargs", ")", ":", "kwargs", "=", "__utils__", "[", "'args.clean_kwargs'", "]", "(", "*", "*", "kwargs", ")", "if", "'stream'", "in", "kwargs", ":", "raise", "SaltInvocationError", "(", "'The \\'stream\\' argument ...
.. versionchanged:: 2018.3.0 Support for all of docker-py's `logs()`_ function's arguments, with the exception of ``stream``. Returns the logs for the container. An interface to docker-py's `logs()`_ function. name Container name or ID stdout : True Return stdout lines...
[ "..", "versionchanged", "::", "2018", ".", "3", ".", "0", "Support", "for", "all", "of", "docker", "-", "py", "s", "logs", "()", "_", "function", "s", "arguments", "with", "the", "exception", "of", "stream", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L2015-L2096
train
Return the logs for a container.
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/dockermod.py
port
def port(name, private_port=None): ''' Returns port mapping information for a given container. Equivalent to running the ``docker port`` Docker CLI command. name Container name or ID .. versionchanged:: 2019.2.0 This value can now be a pattern expression (using the ...
python
def port(name, private_port=None): ''' Returns port mapping information for a given container. Equivalent to running the ``docker port`` Docker CLI command. name Container name or ID .. versionchanged:: 2019.2.0 This value can now be a pattern expression (using the ...
[ "def", "port", "(", "name", ",", "private_port", "=", "None", ")", ":", "pattern_used", "=", "bool", "(", "re", ".", "search", "(", "r'[*?\\[]'", ",", "name", ")", ")", "names", "=", "fnmatch", ".", "filter", "(", "list_containers", "(", "all", "=", ...
Returns port mapping information for a given container. Equivalent to running the ``docker port`` Docker CLI command. name Container name or ID .. versionchanged:: 2019.2.0 This value can now be a pattern expression (using the pattern-matching characters defined in fnma...
[ "Returns", "port", "mapping", "information", "for", "a", "given", "container", ".", "Equivalent", "to", "running", "the", "docker", "port", "Docker", "CLI", "command", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L2116-L2192
train
Returns a dictionary mapping port numbers to containers with the specified port number.
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/dockermod.py
ps_
def ps_(filters=None, **kwargs): ''' Returns information about the Docker containers on the Minion. Equivalent to running the ``docker ps`` Docker CLI command. all : False If ``True``, stopped containers will also be returned host: False If ``True``, local host's network topology w...
python
def ps_(filters=None, **kwargs): ''' Returns information about the Docker containers on the Minion. Equivalent to running the ``docker ps`` Docker CLI command. all : False If ``True``, stopped containers will also be returned host: False If ``True``, local host's network topology w...
[ "def", "ps_", "(", "filters", "=", "None", ",", "*", "*", "kwargs", ")", ":", "response", "=", "_client_wrapper", "(", "'containers'", ",", "all", "=", "True", ",", "filters", "=", "filters", ")", "key_map", "=", "{", "'Created'", ":", "'Time_Created_Epo...
Returns information about the Docker containers on the Minion. Equivalent to running the ``docker ps`` Docker CLI command. all : False If ``True``, stopped containers will also be returned host: False If ``True``, local host's network topology will be included verbose : False ...
[ "Returns", "information", "about", "the", "Docker", "containers", "on", "the", "Minion", ".", "Equivalent", "to", "running", "the", "docker", "ps", "Docker", "CLI", "command", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L2195-L2268
train
Return information about the Docker containers on the Minion.
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/dockermod.py
state
def state(name): ''' Returns the state of the container name Container name or ID **RETURN DATA** A string representing the current state of the container (either ``running``, ``paused``, or ``stopped``) CLI Example: .. code-block:: bash salt myminion docker.state...
python
def state(name): ''' Returns the state of the container name Container name or ID **RETURN DATA** A string representing the current state of the container (either ``running``, ``paused``, or ``stopped``) CLI Example: .. code-block:: bash salt myminion docker.state...
[ "def", "state", "(", "name", ")", ":", "contextkey", "=", "'docker.state.{0}'", ".", "format", "(", "name", ")", "if", "contextkey", "in", "__context__", ":", "return", "__context__", "[", "contextkey", "]", "__context__", "[", "contextkey", "]", "=", "_get_...
Returns the state of the container name Container name or ID **RETURN DATA** A string representing the current state of the container (either ``running``, ``paused``, or ``stopped``) CLI Example: .. code-block:: bash salt myminion docker.state mycontainer
[ "Returns", "the", "state", "of", "the", "container" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L2271-L2295
train
Return the current state of a container
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/dockermod.py
search
def search(name, official=False, trusted=False): ''' Searches the registry for an image name Search keyword official : False Limit results to official builds trusted : False Limit results to `trusted builds`_ **RETURN DATA** A dictionary with each key being the n...
python
def search(name, official=False, trusted=False): ''' Searches the registry for an image name Search keyword official : False Limit results to official builds trusted : False Limit results to `trusted builds`_ **RETURN DATA** A dictionary with each key being the n...
[ "def", "search", "(", "name", ",", "official", "=", "False", ",", "trusted", "=", "False", ")", ":", "response", "=", "_client_wrapper", "(", "'search'", ",", "name", ")", "if", "not", "response", ":", "raise", "CommandExecutionError", "(", "'No images match...
Searches the registry for an image name Search keyword official : False Limit results to official builds trusted : False Limit results to `trusted builds`_ **RETURN DATA** A dictionary with each key being the name of an image, and the following information for each i...
[ "Searches", "the", "registry", "for", "an", "image" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L2298-L2365
train
Search the registry for an image and return the image information for each image.
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/dockermod.py
top
def top(name): ''' Runs the `docker top` command on a specific container name Container name or ID CLI Example: **RETURN DATA** A list of dictionaries containing information about each process .. code-block:: bash salt myminion docker.top mycontainer salt mymi...
python
def top(name): ''' Runs the `docker top` command on a specific container name Container name or ID CLI Example: **RETURN DATA** A list of dictionaries containing information about each process .. code-block:: bash salt myminion docker.top mycontainer salt mymi...
[ "def", "top", "(", "name", ")", ":", "response", "=", "_client_wrapper", "(", "'top'", ",", "name", ")", "# Read in column names", "columns", "=", "{", "}", "for", "idx", ",", "col_name", "in", "enumerate", "(", "response", "[", "'Titles'", "]", ")", ":"...
Runs the `docker top` command on a specific container name Container name or ID CLI Example: **RETURN DATA** A list of dictionaries containing information about each process .. code-block:: bash salt myminion docker.top mycontainer salt myminion docker.top 0123456789a...
[ "Runs", "the", "docker", "top", "command", "on", "a", "specific", "container" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L2368-L2402
train
Runs the docker top command on a specific container and ID container name or ID CLI Example :
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/dockermod.py
version
def version(): ''' Returns a dictionary of Docker version information. Equivalent to running the ``docker version`` Docker CLI command. CLI Example: .. code-block:: bash salt myminion docker.version ''' ret = _client_wrapper('version') version_re = re.compile(VERSION_RE) i...
python
def version(): ''' Returns a dictionary of Docker version information. Equivalent to running the ``docker version`` Docker CLI command. CLI Example: .. code-block:: bash salt myminion docker.version ''' ret = _client_wrapper('version') version_re = re.compile(VERSION_RE) i...
[ "def", "version", "(", ")", ":", "ret", "=", "_client_wrapper", "(", "'version'", ")", "version_re", "=", "re", ".", "compile", "(", "VERSION_RE", ")", "if", "'Version'", "in", "ret", ":", "match", "=", "version_re", ".", "match", "(", "six", ".", "tex...
Returns a dictionary of Docker version information. Equivalent to running the ``docker version`` Docker CLI command. CLI Example: .. code-block:: bash salt myminion docker.version
[ "Returns", "a", "dictionary", "of", "Docker", "version", "information", ".", "Equivalent", "to", "running", "the", "docker", "version", "Docker", "CLI", "command", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L2405-L2430
train
Returns a dictionary of Docker version information. Equivalent to running the docker version CLI 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/dockermod.py
create
def create(image, name=None, start=False, skip_translate=None, ignore_collisions=False, validate_ip_addrs=True, client_timeout=salt.utils.docker.CLIENT_TIMEOUT, **kwargs): ''' Create a new container image Image from which ...
python
def create(image, name=None, start=False, skip_translate=None, ignore_collisions=False, validate_ip_addrs=True, client_timeout=salt.utils.docker.CLIENT_TIMEOUT, **kwargs): ''' Create a new container image Image from which ...
[ "def", "create", "(", "image", ",", "name", "=", "None", ",", "start", "=", "False", ",", "skip_translate", "=", "None", ",", "ignore_collisions", "=", "False", ",", "validate_ip_addrs", "=", "True", ",", "client_timeout", "=", "salt", ".", "utils", ".", ...
Create a new container image Image from which to create the container name Name for the new container. If not provided, Docker will randomly generate one for you (it will be included in the return data). start : False If ``True``, start container after creating it ...
[ "Create", "a", "new", "container" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L2440-L3210
train
Create a new container with the specified image and optional name.
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/dockermod.py
run_container
def run_container(image, name=None, skip_translate=None, ignore_collisions=False, validate_ip_addrs=True, client_timeout=salt.utils.docker.CLIENT_TIMEOUT, bg=False, replace=False, ...
python
def run_container(image, name=None, skip_translate=None, ignore_collisions=False, validate_ip_addrs=True, client_timeout=salt.utils.docker.CLIENT_TIMEOUT, bg=False, replace=False, ...
[ "def", "run_container", "(", "image", ",", "name", "=", "None", ",", "skip_translate", "=", "None", ",", "ignore_collisions", "=", "False", ",", "validate_ip_addrs", "=", "True", ",", "client_timeout", "=", "salt", ".", "utils", ".", "docker", ".", "CLIENT_T...
.. versionadded:: 2018.3.0 Equivalent to ``docker run`` on the Docker CLI. Runs the container, waits for it to exit, and returns the container's logs when complete. .. note:: Not to be confused with :py:func:`docker.run <salt.modules.dockermod.run>`, which provides a :py:func:`cmd.run ...
[ "..", "versionadded", "::", "2018", ".", "3", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L3214-L3452
train
Runs a container and returns its name and ID.
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/dockermod.py
copy_from
def copy_from(name, source, dest, overwrite=False, makedirs=False): ''' Copy a file from inside a container to the Minion name Container name source Path of the file on the container's filesystem dest Destination on the Minion. Must be an absolute path. If the destination ...
python
def copy_from(name, source, dest, overwrite=False, makedirs=False): ''' Copy a file from inside a container to the Minion name Container name source Path of the file on the container's filesystem dest Destination on the Minion. Must be an absolute path. If the destination ...
[ "def", "copy_from", "(", "name", ",", "source", ",", "dest", ",", "overwrite", "=", "False", ",", "makedirs", "=", "False", ")", ":", "c_state", "=", "state", "(", "name", ")", "if", "c_state", "!=", "'running'", ":", "raise", "CommandExecutionError", "(...
Copy a file from inside a container to the Minion name Container name source Path of the file on the container's filesystem dest Destination on the Minion. Must be an absolute path. If the destination is a directory, the file will be copied into that directory. overwr...
[ "Copy", "a", "file", "from", "inside", "a", "container", "to", "the", "Minion" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L3455-L3563
train
Copy a file from a container to a Minion
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/dockermod.py
copy_to
def copy_to(name, source, dest, exec_driver=None, overwrite=False, makedirs=False): ''' Copy a file from the host into a container name Container name source File to be copied to the container. Can be a local path on the Minio...
python
def copy_to(name, source, dest, exec_driver=None, overwrite=False, makedirs=False): ''' Copy a file from the host into a container name Container name source File to be copied to the container. Can be a local path on the Minio...
[ "def", "copy_to", "(", "name", ",", "source", ",", "dest", ",", "exec_driver", "=", "None", ",", "overwrite", "=", "False", ",", "makedirs", "=", "False", ")", ":", "if", "exec_driver", "is", "None", ":", "exec_driver", "=", "_get_exec_driver", "(", ")",...
Copy a file from the host into a container name Container name source File to be copied to the container. Can be a local path on the Minion or a remote file from the Salt fileserver. dest Destination on the container. Must be an absolute path. If the destination is...
[ "Copy", "a", "file", "from", "the", "host", "into", "a", "container" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L3570-L3624
train
Copy a file from the host into a container.
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/dockermod.py
export
def export(name, path, overwrite=False, makedirs=False, compression=None, **kwargs): ''' Exports a container to a tar archive. It can also optionally compress that tar archive, and push it up to the Master. name Container name or ID pa...
python
def export(name, path, overwrite=False, makedirs=False, compression=None, **kwargs): ''' Exports a container to a tar archive. It can also optionally compress that tar archive, and push it up to the Master. name Container name or ID pa...
[ "def", "export", "(", "name", ",", "path", ",", "overwrite", "=", "False", ",", "makedirs", "=", "False", ",", "compression", "=", "None", ",", "*", "*", "kwargs", ")", ":", "err", "=", "'Path \\'{0}\\' is not absolute'", ".", "format", "(", "path", ")",...
Exports a container to a tar archive. It can also optionally compress that tar archive, and push it up to the Master. name Container name or ID path Absolute path on the Minion where the container will be exported overwrite : False Unless this option is set to ``True``, then i...
[ "Exports", "a", "container", "to", "a", "tar", "archive", ".", "It", "can", "also", "optionally", "compress", "that", "tar", "archive", "and", "push", "it", "up", "to", "the", "Master", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L3627-L3806
train
Exports a container to a tar archive.
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/dockermod.py
rm_
def rm_(name, force=False, volumes=False, **kwargs): ''' Removes a container name Container name or ID force : False If ``True``, the container will be killed first before removal, as the Docker API will not permit a running container to be removed. This option is set t...
python
def rm_(name, force=False, volumes=False, **kwargs): ''' Removes a container name Container name or ID force : False If ``True``, the container will be killed first before removal, as the Docker API will not permit a running container to be removed. This option is set t...
[ "def", "rm_", "(", "name", ",", "force", "=", "False", ",", "volumes", "=", "False", ",", "*", "*", "kwargs", ")", ":", "kwargs", "=", "__utils__", "[", "'args.clean_kwargs'", "]", "(", "*", "*", "kwargs", ")", "stop_", "=", "kwargs", ".", "pop", "...
Removes a container name Container name or ID force : False If ``True``, the container will be killed first before removal, as the Docker API will not permit a running container to be removed. This option is set to ``False`` by default to prevent accidental removal of a...
[ "Removes", "a", "container" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L3810-L3880
train
Removes a container from the cluster
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/dockermod.py
rename
def rename(name, new_name): ''' .. versionadded:: 2017.7.0 Renames a container. Returns ``True`` if successful, and raises an error if the API returns one. If unsuccessful and the API returns no error (should not happen), then ``False`` will be returned. name Name or ID of existing con...
python
def rename(name, new_name): ''' .. versionadded:: 2017.7.0 Renames a container. Returns ``True`` if successful, and raises an error if the API returns one. If unsuccessful and the API returns no error (should not happen), then ``False`` will be returned. name Name or ID of existing con...
[ "def", "rename", "(", "name", ",", "new_name", ")", ":", "id_", "=", "inspect_container", "(", "name", ")", "[", "'Id'", "]", "log", ".", "debug", "(", "'Renaming container \\'%s\\' (ID: %s) to \\'%s\\''", ",", "name", ",", "id_", ",", "new_name", ")", "_cli...
.. versionadded:: 2017.7.0 Renames a container. Returns ``True`` if successful, and raises an error if the API returns one. If unsuccessful and the API returns no error (should not happen), then ``False`` will be returned. name Name or ID of existing container new_name New name to...
[ "..", "versionadded", "::", "2017", ".", "7", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L3883-L3909
train
Rename a container.
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/dockermod.py
build
def build(path=None, repository=None, tag=None, cache=True, rm=True, api_response=False, fileobj=None, dockerfile=None, buildargs=None, network_mode=None, labels=None, cache_from=None, target=None): ...
python
def build(path=None, repository=None, tag=None, cache=True, rm=True, api_response=False, fileobj=None, dockerfile=None, buildargs=None, network_mode=None, labels=None, cache_from=None, target=None): ...
[ "def", "build", "(", "path", "=", "None", ",", "repository", "=", "None", ",", "tag", "=", "None", ",", "cache", "=", "True", ",", "rm", "=", "True", ",", "api_response", "=", "False", ",", "fileobj", "=", "None", ",", "dockerfile", "=", "None", ",...
.. versionchanged:: 2018.3.0 If the built image should be tagged, then the repository and tag must now be passed separately using the ``repository`` and ``tag`` arguments, rather than together in the (now deprecated) ``image`` argument. Builds a docker image from a Dockerfile or a U...
[ "..", "versionchanged", "::", "2018", ".", "3", ".", "0", "If", "the", "built", "image", "should", "be", "tagged", "then", "the", "repository", "and", "tag", "must", "now", "be", "passed", "separately", "using", "the", "repository", "and", "tag", "argument...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L3913-L4106
train
Build a new image from a Dockerfile or URL.
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/dockermod.py
commit
def commit(name, repository, tag='latest', message=None, author=None): ''' .. versionchanged:: 2018.3.0 The repository and tag must now be passed separately using the ``repository`` and ``tag`` arguments, rather than together in the (now deprec...
python
def commit(name, repository, tag='latest', message=None, author=None): ''' .. versionchanged:: 2018.3.0 The repository and tag must now be passed separately using the ``repository`` and ``tag`` arguments, rather than together in the (now deprec...
[ "def", "commit", "(", "name", ",", "repository", ",", "tag", "=", "'latest'", ",", "message", "=", "None", ",", "author", "=", "None", ")", ":", "if", "not", "isinstance", "(", "repository", ",", "six", ".", "string_types", ")", ":", "repository", "=",...
.. versionchanged:: 2018.3.0 The repository and tag must now be passed separately using the ``repository`` and ``tag`` arguments, rather than together in the (now deprecated) ``image`` argument. Commits a container, thereby promoting it to an image. Equivalent to running the ``docker co...
[ "..", "versionchanged", "::", "2018", ".", "3", ".", "0", "The", "repository", "and", "tag", "must", "now", "be", "passed", "separately", "using", "the", "repository", "and", "tag", "arguments", "rather", "than", "together", "in", "the", "(", "now", "depre...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L4109-L4188
train
Commits a container to an image.
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/dockermod.py
dangling
def dangling(prune=False, force=False): ''' Return top-level images (those on which no other images depend) which do not have a tag assigned to them. These include: - Images which were once tagged but were later untagged, such as those which were superseded by committing a new copy of an existing...
python
def dangling(prune=False, force=False): ''' Return top-level images (those on which no other images depend) which do not have a tag assigned to them. These include: - Images which were once tagged but were later untagged, such as those which were superseded by committing a new copy of an existing...
[ "def", "dangling", "(", "prune", "=", "False", ",", "force", "=", "False", ")", ":", "all_images", "=", "images", "(", "all", "=", "True", ")", "dangling_images", "=", "[", "x", "[", ":", "12", "]", "for", "x", "in", "_get_top_level_images", "(", "al...
Return top-level images (those on which no other images depend) which do not have a tag assigned to them. These include: - Images which were once tagged but were later untagged, such as those which were superseded by committing a new copy of an existing tagged image. - Images which were loaded ...
[ "Return", "top", "-", "level", "images", "(", "those", "on", "which", "no", "other", "images", "depend", ")", "which", "do", "not", "have", "a", "tag", "assigned", "to", "them", ".", "These", "include", ":" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L4191-L4245
train
Return a list of top - level images which are not tagged but have a tag assigned to them.
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/dockermod.py
import_
def import_(source, repository, tag='latest', api_response=False): ''' .. versionchanged:: 2018.3.0 The repository and tag must now be passed separately using the ``repository`` and ``tag`` arguments, rather than together in the (now deprecated) ``imag...
python
def import_(source, repository, tag='latest', api_response=False): ''' .. versionchanged:: 2018.3.0 The repository and tag must now be passed separately using the ``repository`` and ``tag`` arguments, rather than together in the (now deprecated) ``imag...
[ "def", "import_", "(", "source", ",", "repository", ",", "tag", "=", "'latest'", ",", "api_response", "=", "False", ")", ":", "if", "not", "isinstance", "(", "repository", ",", "six", ".", "string_types", ")", ":", "repository", "=", "six", ".", "text_ty...
.. versionchanged:: 2018.3.0 The repository and tag must now be passed separately using the ``repository`` and ``tag`` arguments, rather than together in the (now deprecated) ``image`` argument. Imports content from a local tarball or a URL as a new docker image source Content ...
[ "..", "versionchanged", "::", "2018", ".", "3", ".", "0", "The", "repository", "and", "tag", "must", "now", "be", "passed", "separately", "using", "the", "repository", "and", "tag", "arguments", "rather", "than", "together", "in", "the", "(", "now", "depre...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L4248-L4348
train
Imports the content from a local tarball or an absolute path to a local tarball and returns the new image and the new version of the image.
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/dockermod.py
load
def load(path, repository=None, tag=None): ''' .. versionchanged:: 2018.3.0 If the loaded image should be tagged, then the repository and tag must now be passed separately using the ``repository`` and ``tag`` arguments, rather than together in the (now deprecated) ``image`` argum...
python
def load(path, repository=None, tag=None): ''' .. versionchanged:: 2018.3.0 If the loaded image should be tagged, then the repository and tag must now be passed separately using the ``repository`` and ``tag`` arguments, rather than together in the (now deprecated) ``image`` argum...
[ "def", "load", "(", "path", ",", "repository", "=", "None", ",", "tag", "=", "None", ")", ":", "if", "(", "repository", "or", "tag", ")", "and", "not", "(", "repository", "and", "tag", ")", ":", "# Have to have both or neither", "raise", "SaltInvocationErr...
.. versionchanged:: 2018.3.0 If the loaded image should be tagged, then the repository and tag must now be passed separately using the ``repository`` and ``tag`` arguments, rather than together in the (now deprecated) ``image`` argument. Load a tar archive that was created using :py...
[ "..", "versionchanged", "::", "2018", ".", "3", ".", "0", "If", "the", "loaded", "image", "should", "be", "tagged", "then", "the", "repository", "and", "tag", "must", "now", "be", "passed", "separately", "using", "the", "repository", "and", "tag", "argumen...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L4351-L4469
train
Load a tar archive from a file on the Minion and return a dictionary containing the contents of the tar archive.
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/dockermod.py
layers
def layers(name): ''' Returns a list of the IDs of layers belonging to the specified image, with the top-most layer (the one correspnding to the passed name) appearing last. name Image name or ID CLI Example: .. code-block:: bash salt myminion docker.layers centos:7 '...
python
def layers(name): ''' Returns a list of the IDs of layers belonging to the specified image, with the top-most layer (the one correspnding to the passed name) appearing last. name Image name or ID CLI Example: .. code-block:: bash salt myminion docker.layers centos:7 '...
[ "def", "layers", "(", "name", ")", ":", "ret", "=", "[", "]", "cmd", "=", "[", "'docker'", ",", "'history'", ",", "'-q'", ",", "name", "]", "for", "line", "in", "reversed", "(", "__salt__", "[", "'cmd.run_stdout'", "]", "(", "cmd", ",", "python_shell...
Returns a list of the IDs of layers belonging to the specified image, with the top-most layer (the one correspnding to the passed name) appearing last. name Image name or ID CLI Example: .. code-block:: bash salt myminion docker.layers centos:7
[ "Returns", "a", "list", "of", "the", "IDs", "of", "layers", "belonging", "to", "the", "specified", "image", "with", "the", "top", "-", "most", "layer", "(", "the", "one", "correspnding", "to", "the", "passed", "name", ")", "appearing", "last", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L4472-L4494
train
Returns a list of the IDs of layers belonging to the specified image
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/dockermod.py
pull
def pull(image, insecure_registry=False, api_response=False, client_timeout=salt.utils.docker.CLIENT_TIMEOUT): ''' .. versionchanged:: 2018.3.0 If no tag is specified in the ``image`` argument, all tags for the image will be pulled. For this reason is it recommended to...
python
def pull(image, insecure_registry=False, api_response=False, client_timeout=salt.utils.docker.CLIENT_TIMEOUT): ''' .. versionchanged:: 2018.3.0 If no tag is specified in the ``image`` argument, all tags for the image will be pulled. For this reason is it recommended to...
[ "def", "pull", "(", "image", ",", "insecure_registry", "=", "False", ",", "api_response", "=", "False", ",", "client_timeout", "=", "salt", ".", "utils", ".", "docker", ".", "CLIENT_TIMEOUT", ")", ":", "_prep_pull", "(", ")", "kwargs", "=", "{", "'stream'"...
.. versionchanged:: 2018.3.0 If no tag is specified in the ``image`` argument, all tags for the image will be pulled. For this reason is it recommended to pass ``image`` using the ``repo:tag`` notation. Pulls an image from a Docker registry image Image to be pulled insecur...
[ "..", "versionchanged", "::", "2018", ".", "3", ".", "0", "If", "no", "tag", "is", "specified", "in", "the", "image", "argument", "all", "tags", "for", "the", "image", "will", "be", "pulled", ".", "For", "this", "reason", "is", "it", "recommended", "to...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L4497-L4593
train
Pull an image from a Docker registry and return a dictionary containing the image information.
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...