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
deepmind/sonnet
sonnet/python/modules/spatial_transformer.py
AffineWarpConstraints._combine
def _combine(self, x, y): """Combines two constraints, raising an error if they are not compatible.""" if x is None or y is None: return x or y if x != y: raise ValueError('Incompatible set of constraints provided.') return x
python
def _combine(self, x, y): """Combines two constraints, raising an error if they are not compatible.""" if x is None or y is None: return x or y if x != y: raise ValueError('Incompatible set of constraints provided.') return x
[ "def", "_combine", "(", "self", ",", "x", ",", "y", ")", ":", "if", "x", "is", "None", "or", "y", "is", "None", ":", "return", "x", "or", "y", "if", "x", "!=", "y", ":", "raise", "ValueError", "(", "'Incompatible set of constraints provided.'", ")", ...
Combines two constraints, raising an error if they are not compatible.
[ "Combines", "two", "constraints", "raising", "an", "error", "if", "they", "are", "not", "compatible", "." ]
00612ca3178964d86b556e062694d808ff81fcca
https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/python/modules/spatial_transformer.py#L526-L532
train
Combines two constraints raising an error if they are not compatible.
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...
deepmind/sonnet
sonnet/python/modules/spatial_transformer.py
AffineWarpConstraints.combine_with
def combine_with(self, additional_constraints): """Combines two sets of constraints into a coherent single set.""" x = additional_constraints if not isinstance(additional_constraints, AffineWarpConstraints): x = AffineWarpConstraints(additional_constraints) new_constraints = [] for left, right...
python
def combine_with(self, additional_constraints): """Combines two sets of constraints into a coherent single set.""" x = additional_constraints if not isinstance(additional_constraints, AffineWarpConstraints): x = AffineWarpConstraints(additional_constraints) new_constraints = [] for left, right...
[ "def", "combine_with", "(", "self", ",", "additional_constraints", ")", ":", "x", "=", "additional_constraints", "if", "not", "isinstance", "(", "additional_constraints", ",", "AffineWarpConstraints", ")", ":", "x", "=", "AffineWarpConstraints", "(", "additional_const...
Combines two sets of constraints into a coherent single set.
[ "Combines", "two", "sets", "of", "constraints", "into", "a", "coherent", "single", "set", "." ]
00612ca3178964d86b556e062694d808ff81fcca
https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/python/modules/spatial_transformer.py#L538-L546
train
Combines two sets of constraints into a coherent single set.
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...
deepmind/sonnet
sonnet/python/ops/initializers.py
_Restore._partition_spec
def _partition_spec(self, shape, partition_info): """Build magic (and sparsely documented) shapes_and_slices spec string.""" if partition_info is None: return '' # Empty string indicates a non-partitioned tensor. ssi = tf.Variable.SaveSliceInfo( full_name=self._var_name, full_shape=pa...
python
def _partition_spec(self, shape, partition_info): """Build magic (and sparsely documented) shapes_and_slices spec string.""" if partition_info is None: return '' # Empty string indicates a non-partitioned tensor. ssi = tf.Variable.SaveSliceInfo( full_name=self._var_name, full_shape=pa...
[ "def", "_partition_spec", "(", "self", ",", "shape", ",", "partition_info", ")", ":", "if", "partition_info", "is", "None", ":", "return", "''", "# Empty string indicates a non-partitioned tensor.", "ssi", "=", "tf", ".", "Variable", ".", "SaveSliceInfo", "(", "fu...
Build magic (and sparsely documented) shapes_and_slices spec string.
[ "Build", "magic", "(", "and", "sparsely", "documented", ")", "shapes_and_slices", "spec", "string", "." ]
00612ca3178964d86b556e062694d808ff81fcca
https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/python/ops/initializers.py#L58-L67
train
Build magic ( and sparsely documented ) shapes_and_slices spec 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...
ansible/molecule
molecule/provisioner/ansible_playbook.py
AnsiblePlaybook.bake
def bake(self): """ Bake an ``ansible-playbook`` command so it's ready to execute and returns ``None``. :return: None """ # Pass a directory as inventory to let Ansible merge the multiple # inventory sources located under self.add_cli_arg('inventory', ...
python
def bake(self): """ Bake an ``ansible-playbook`` command so it's ready to execute and returns ``None``. :return: None """ # Pass a directory as inventory to let Ansible merge the multiple # inventory sources located under self.add_cli_arg('inventory', ...
[ "def", "bake", "(", "self", ")", ":", "# Pass a directory as inventory to let Ansible merge the multiple", "# inventory sources located under", "self", ".", "add_cli_arg", "(", "'inventory'", ",", "self", ".", "_config", ".", "provisioner", ".", "inventory_directory", ")", ...
Bake an ``ansible-playbook`` command so it's ready to execute and returns ``None``. :return: None
[ "Bake", "an", "ansible", "-", "playbook", "command", "so", "it", "s", "ready", "to", "execute", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/provisioner/ansible_playbook.py#L51-L83
train
Bake an ansible - playbook command so it s ready to execute and returns None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/provisioner/ansible_playbook.py
AnsiblePlaybook.execute
def execute(self): """ Executes ``ansible-playbook`` and returns a string. :return: str """ if self._ansible_command is None: self.bake() try: self._config.driver.sanity_checks() cmd = util.run_command( self._ansible_c...
python
def execute(self): """ Executes ``ansible-playbook`` and returns a string. :return: str """ if self._ansible_command is None: self.bake() try: self._config.driver.sanity_checks() cmd = util.run_command( self._ansible_c...
[ "def", "execute", "(", "self", ")", ":", "if", "self", ".", "_ansible_command", "is", "None", ":", "self", ".", "bake", "(", ")", "try", ":", "self", ".", "_config", ".", "driver", ".", "sanity_checks", "(", ")", "cmd", "=", "util", ".", "run_command...
Executes ``ansible-playbook`` and returns a string. :return: str
[ "Executes", "ansible", "-", "playbook", "and", "returns", "a", "string", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/provisioner/ansible_playbook.py#L85-L101
train
Executes ansible - playbook and returns a 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...
ansible/molecule
molecule/command/login.py
login
def login(ctx, host, scenario_name): # pragma: no cover """ Log in to one instance. """ args = ctx.obj.get('args') subcommand = base._get_subcommand(__name__) command_args = { 'subcommand': subcommand, 'host': host, } s = scenarios.Scenarios( base.get_configs(args, comm...
python
def login(ctx, host, scenario_name): # pragma: no cover """ Log in to one instance. """ args = ctx.obj.get('args') subcommand = base._get_subcommand(__name__) command_args = { 'subcommand': subcommand, 'host': host, } s = scenarios.Scenarios( base.get_configs(args, comm...
[ "def", "login", "(", "ctx", ",", "host", ",", "scenario_name", ")", ":", "# pragma: no cover", "args", "=", "ctx", ".", "obj", ".", "get", "(", "'args'", ")", "subcommand", "=", "base", ".", "_get_subcommand", "(", "__name__", ")", "command_args", "=", "...
Log in to one instance.
[ "Log", "in", "to", "one", "instance", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/command/login.py#L170-L182
train
Log in to one 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...
ansible/molecule
molecule/command/login.py
Login.execute
def execute(self): """ Execute the actions necessary to perform a `molecule login` and returns None. :return: None """ c = self._config if ((not c.state.created) and c.driver.managed): msg = 'Instances not created. Please create instances first.' ...
python
def execute(self): """ Execute the actions necessary to perform a `molecule login` and returns None. :return: None """ c = self._config if ((not c.state.created) and c.driver.managed): msg = 'Instances not created. Please create instances first.' ...
[ "def", "execute", "(", "self", ")", ":", "c", "=", "self", ".", "_config", "if", "(", "(", "not", "c", ".", "state", ".", "created", ")", "and", "c", ".", "driver", ".", "managed", ")", ":", "msg", "=", "'Instances not created. Please create instances f...
Execute the actions necessary to perform a `molecule login` and returns None. :return: None
[ "Execute", "the", "actions", "necessary", "to", "perform", "a", "molecule", "login", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/command/login.py#L89-L103
train
Execute the actions necessary to perform a molecule login and return None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/command/base.py
execute_cmdline_scenarios
def execute_cmdline_scenarios(scenario_name, args, command_args): """ Execute scenario sequences based on parsed command-line arguments. This is useful for subcommands that run scenario sequences, which excludes subcommands such as ``list``, ``login``, and ``matrix``. ``args`` and ``command_args``...
python
def execute_cmdline_scenarios(scenario_name, args, command_args): """ Execute scenario sequences based on parsed command-line arguments. This is useful for subcommands that run scenario sequences, which excludes subcommands such as ``list``, ``login``, and ``matrix``. ``args`` and ``command_args``...
[ "def", "execute_cmdline_scenarios", "(", "scenario_name", ",", "args", ",", "command_args", ")", ":", "scenarios", "=", "molecule", ".", "scenarios", ".", "Scenarios", "(", "get_configs", "(", "args", ",", "command_args", ")", ",", "scenario_name", ")", "scenari...
Execute scenario sequences based on parsed command-line arguments. This is useful for subcommands that run scenario sequences, which excludes subcommands such as ``list``, ``login``, and ``matrix``. ``args`` and ``command_args`` are combined using :func:`get_configs` to generate the scenario(s) config...
[ "Execute", "scenario", "sequences", "based", "on", "parsed", "command", "-", "line", "arguments", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/command/base.py#L75-L112
train
Execute all scenarios in the specified scenario_name in the command - line.
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...
ansible/molecule
molecule/command/base.py
execute_scenario
def execute_scenario(scenario): """ Execute each command in the given scenario's configured sequence. :param scenario: The scenario to execute. :returns: None """ for action in scenario.sequence: execute_subcommand(scenario.config, action) # pruning only if a 'destroy' step was i...
python
def execute_scenario(scenario): """ Execute each command in the given scenario's configured sequence. :param scenario: The scenario to execute. :returns: None """ for action in scenario.sequence: execute_subcommand(scenario.config, action) # pruning only if a 'destroy' step was i...
[ "def", "execute_scenario", "(", "scenario", ")", ":", "for", "action", "in", "scenario", ".", "sequence", ":", "execute_subcommand", "(", "scenario", ".", "config", ",", "action", ")", "# pruning only if a 'destroy' step was in the sequence allows for normal", "# debuggin...
Execute each command in the given scenario's configured sequence. :param scenario: The scenario to execute. :returns: None
[ "Execute", "each", "command", "in", "the", "given", "scenario", "s", "configured", "sequence", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/command/base.py#L127-L142
train
Execute each command in the given scenario s configured sequence.
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...
ansible/molecule
molecule/command/base.py
get_configs
def get_configs(args, command_args, ansible_args=()): """ Glob the current directory for Molecule config files, instantiate config objects, and returns a list. :param args: A dict of options, arguments and commands from the CLI. :param command_args: A dict of options passed to the subcommand from ...
python
def get_configs(args, command_args, ansible_args=()): """ Glob the current directory for Molecule config files, instantiate config objects, and returns a list. :param args: A dict of options, arguments and commands from the CLI. :param command_args: A dict of options passed to the subcommand from ...
[ "def", "get_configs", "(", "args", ",", "command_args", ",", "ansible_args", "=", "(", ")", ")", ":", "configs", "=", "[", "config", ".", "Config", "(", "molecule_file", "=", "util", ".", "abs_path", "(", "c", ")", ",", "args", "=", "args", ",", "com...
Glob the current directory for Molecule config files, instantiate config objects, and returns a list. :param args: A dict of options, arguments and commands from the CLI. :param command_args: A dict of options passed to the subcommand from the CLI. :param ansible_args: An optional tuple of argumen...
[ "Glob", "the", "current", "directory", "for", "Molecule", "config", "files", "instantiate", "config", "objects", "and", "returns", "a", "list", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/command/base.py#L145-L167
train
Glob the current directory for Molecule config files instantiate config objects and return a list of config objects.
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...
ansible/molecule
molecule/command/base.py
_verify_configs
def _verify_configs(configs): """ Verify a Molecule config was found and returns None. :param configs: A list containing absolute paths to Molecule config files. :return: None """ if configs: scenario_names = [c.scenario.name for c in configs] for scenario_name, n in collections...
python
def _verify_configs(configs): """ Verify a Molecule config was found and returns None. :param configs: A list containing absolute paths to Molecule config files. :return: None """ if configs: scenario_names = [c.scenario.name for c in configs] for scenario_name, n in collections...
[ "def", "_verify_configs", "(", "configs", ")", ":", "if", "configs", ":", "scenario_names", "=", "[", "c", ".", "scenario", ".", "name", "for", "c", "in", "configs", "]", "for", "scenario_name", ",", "n", "in", "collections", ".", "Counter", "(", "scenar...
Verify a Molecule config was found and returns None. :param configs: A list containing absolute paths to Molecule config files. :return: None
[ "Verify", "a", "Molecule", "config", "was", "found", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/command/base.py#L170-L187
train
Verify that a Molecule config file was found and returns None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/dependency/gilt.py
Gilt.bake
def bake(self): """ Bake a ``gilt`` command so it's ready to execute and returns None. :return: None """ self._sh_command = getattr(sh, self.command) self._sh_command = self._sh_command.bake( self.options, 'overlay', _env=self.env, ...
python
def bake(self): """ Bake a ``gilt`` command so it's ready to execute and returns None. :return: None """ self._sh_command = getattr(sh, self.command) self._sh_command = self._sh_command.bake( self.options, 'overlay', _env=self.env, ...
[ "def", "bake", "(", "self", ")", ":", "self", ".", "_sh_command", "=", "getattr", "(", "sh", ",", "self", ".", "command", ")", "self", ".", "_sh_command", "=", "self", ".", "_sh_command", ".", "bake", "(", "self", ".", "options", ",", "'overlay'", ",...
Bake a ``gilt`` command so it's ready to execute and returns None. :return: None
[ "Bake", "a", "gilt", "command", "so", "it", "s", "ready", "to", "execute", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/dependency/gilt.py#L86-L98
train
Bake a gilt command so it s ready to execute and returns None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/command/cleanup.py
Cleanup.execute
def execute(self): """ Execute the actions necessary to cleanup the instances and returns None. :return: None """ self.print_info() if not self._config.provisioner.playbooks.cleanup: msg = 'Skipping, cleanup playbook not configured.' LOG....
python
def execute(self): """ Execute the actions necessary to cleanup the instances and returns None. :return: None """ self.print_info() if not self._config.provisioner.playbooks.cleanup: msg = 'Skipping, cleanup playbook not configured.' LOG....
[ "def", "execute", "(", "self", ")", ":", "self", ".", "print_info", "(", ")", "if", "not", "self", ".", "_config", ".", "provisioner", ".", "playbooks", ".", "cleanup", ":", "msg", "=", "'Skipping, cleanup playbook not configured.'", "LOG", ".", "warn", "(",...
Execute the actions necessary to cleanup the instances and returns None. :return: None
[ "Execute", "the", "actions", "necessary", "to", "cleanup", "the", "instances", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/command/cleanup.py#L66-L80
train
Execute the actions necessary to cleanup the instances and returns None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/provisioner/lint/ansible_lint.py
AnsibleLintMixin.bake
def bake(self): """ Bake an `ansible-lint` command so it's ready to execute and returns None. :return: None """ options = self.options default_exclude_list = options.pop('default_exclude') options_exclude_list = options.pop('exclude') excludes = d...
python
def bake(self): """ Bake an `ansible-lint` command so it's ready to execute and returns None. :return: None """ options = self.options default_exclude_list = options.pop('default_exclude') options_exclude_list = options.pop('exclude') excludes = d...
[ "def", "bake", "(", "self", ")", ":", "options", "=", "self", ".", "options", "default_exclude_list", "=", "options", ".", "pop", "(", "'default_exclude'", ")", "options_exclude_list", "=", "options", ".", "pop", "(", "'exclude'", ")", "excludes", "=", "defa...
Bake an `ansible-lint` command so it's ready to execute and returns None. :return: None
[ "Bake", "an", "ansible", "-", "lint", "command", "so", "it", "s", "ready", "to", "execute", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/provisioner/lint/ansible_lint.py#L64-L86
train
Bake an ansible - lint command so it s ready to execute and returns None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/util.py
print_environment_vars
def print_environment_vars(env): """ Print ``Ansible`` and ``Molecule`` environment variables and returns None. :param env: A dict containing the shell's environment as collected by ``os.environ``. :return: None """ ansible_env = {k: v for (k, v) in env.items() if 'ANSIBLE_' in k} print...
python
def print_environment_vars(env): """ Print ``Ansible`` and ``Molecule`` environment variables and returns None. :param env: A dict containing the shell's environment as collected by ``os.environ``. :return: None """ ansible_env = {k: v for (k, v) in env.items() if 'ANSIBLE_' in k} print...
[ "def", "print_environment_vars", "(", "env", ")", ":", "ansible_env", "=", "{", "k", ":", "v", "for", "(", "k", ",", "v", ")", "in", "env", ".", "items", "(", ")", "if", "'ANSIBLE_'", "in", "k", "}", "print_debug", "(", "'ANSIBLE ENVIRONMENT'", ",", ...
Print ``Ansible`` and ``Molecule`` environment variables and returns None. :param env: A dict containing the shell's environment as collected by ``os.environ``. :return: None
[ "Print", "Ansible", "and", "Molecule", "environment", "variables", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/util.py#L58-L77
train
Print the environment variables and returns None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/util.py
run_command
def run_command(cmd, debug=False): """ Execute the given command and returns None. :param cmd: A ``sh.Command`` object to execute. :param debug: An optional bool to toggle debug output. :return: ``sh`` object """ if debug: # WARN(retr0h): Uses an internal ``sh`` data structure to di...
python
def run_command(cmd, debug=False): """ Execute the given command and returns None. :param cmd: A ``sh.Command`` object to execute. :param debug: An optional bool to toggle debug output. :return: ``sh`` object """ if debug: # WARN(retr0h): Uses an internal ``sh`` data structure to di...
[ "def", "run_command", "(", "cmd", ",", "debug", "=", "False", ")", ":", "if", "debug", ":", "# WARN(retr0h): Uses an internal ``sh`` data structure to dig", "# the environment out of the ``sh.command`` object.", "print_environment_vars", "(", "cmd", ".", "_partial_call_args", ...
Execute the given command and returns None. :param cmd: A ``sh.Command`` object to execute. :param debug: An optional bool to toggle debug output. :return: ``sh`` object
[ "Execute", "the", "given", "command", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/util.py#L89-L103
train
Execute the given command and returns None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/util.py
write_file
def write_file(filename, content): """ Writes a file with the given filename and content and returns None. :param filename: A string containing the target filename. :param content: A string containing the data to be written. :return: None """ with open_file(filename, 'w') as f: f.wr...
python
def write_file(filename, content): """ Writes a file with the given filename and content and returns None. :param filename: A string containing the target filename. :param content: A string containing the data to be written. :return: None """ with open_file(filename, 'w') as f: f.wr...
[ "def", "write_file", "(", "filename", ",", "content", ")", ":", "with", "open_file", "(", "filename", ",", "'w'", ")", "as", "f", ":", "f", ".", "write", "(", "content", ")", "file_prepender", "(", "filename", ")" ]
Writes a file with the given filename and content and returns None. :param filename: A string containing the target filename. :param content: A string containing the data to be written. :return: None
[ "Writes", "a", "file", "with", "the", "given", "filename", "and", "content", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/util.py#L123-L134
train
Writes a file with the given filename and content and returns None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/util.py
file_prepender
def file_prepender(filename): """ Prepend an informational header on files managed by Molecule and returns None. :param filename: A string containing the target filename. :return: None """ with open_file(filename, 'r+') as f: content = f.read() f.seek(0, 0) f.write(m...
python
def file_prepender(filename): """ Prepend an informational header on files managed by Molecule and returns None. :param filename: A string containing the target filename. :return: None """ with open_file(filename, 'r+') as f: content = f.read() f.seek(0, 0) f.write(m...
[ "def", "file_prepender", "(", "filename", ")", ":", "with", "open_file", "(", "filename", ",", "'r+'", ")", "as", "f", ":", "content", "=", "f", ".", "read", "(", ")", "f", ".", "seek", "(", "0", ",", "0", ")", "f", ".", "write", "(", "molecule_p...
Prepend an informational header on files managed by Molecule and returns None. :param filename: A string containing the target filename. :return: None
[ "Prepend", "an", "informational", "header", "on", "files", "managed", "by", "Molecule", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/util.py#L141-L152
train
Prepend an informational header on files managed by Molecule and returns None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/util.py
safe_dump
def safe_dump(data): """ Dump the provided data to a YAML document and returns a string. :param data: A string containing an absolute path to the file to parse. :return: str """ # TODO(retr0h): Do we need to encode? # yaml.dump(data) produces the document as a str object in both python ...
python
def safe_dump(data): """ Dump the provided data to a YAML document and returns a string. :param data: A string containing an absolute path to the file to parse. :return: str """ # TODO(retr0h): Do we need to encode? # yaml.dump(data) produces the document as a str object in both python ...
[ "def", "safe_dump", "(", "data", ")", ":", "# TODO(retr0h): Do we need to encode?", "# yaml.dump(data) produces the document as a str object in both python", "# 2 and 3.", "return", "yaml", ".", "dump", "(", "data", ",", "Dumper", "=", "SafeDumper", ",", "default_flow_style",...
Dump the provided data to a YAML document and returns a string. :param data: A string containing an absolute path to the file to parse. :return: str
[ "Dump", "the", "provided", "data", "to", "a", "YAML", "document", "and", "returns", "a", "string", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/util.py#L155-L166
train
Dump the provided data to a YAML document and returns a 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...
ansible/molecule
molecule/util.py
safe_load
def safe_load(string): """ Parse the provided string returns a dict. :param string: A string to be parsed. :return: dict """ try: return yaml.safe_load(string) or {} except yaml.scanner.ScannerError as e: sysexit_with_message(str(e))
python
def safe_load(string): """ Parse the provided string returns a dict. :param string: A string to be parsed. :return: dict """ try: return yaml.safe_load(string) or {} except yaml.scanner.ScannerError as e: sysexit_with_message(str(e))
[ "def", "safe_load", "(", "string", ")", ":", "try", ":", "return", "yaml", ".", "safe_load", "(", "string", ")", "or", "{", "}", "except", "yaml", ".", "scanner", ".", "ScannerError", "as", "e", ":", "sysexit_with_message", "(", "str", "(", "e", ")", ...
Parse the provided string returns a dict. :param string: A string to be parsed. :return: dict
[ "Parse", "the", "provided", "string", "returns", "a", "dict", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/util.py#L169-L179
train
Parse the provided string returns a dict.
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...
ansible/molecule
molecule/util.py
merge_dicts
def merge_dicts(a, b): """ Merges the values of B into A and returns a mutated dict A. :: dict a b: - c: 0 - c: 2 d: e: "aaa" f: 3 dict b a: 1 b: - c: 3 d: e: "bbb" Will give a...
python
def merge_dicts(a, b): """ Merges the values of B into A and returns a mutated dict A. :: dict a b: - c: 0 - c: 2 d: e: "aaa" f: 3 dict b a: 1 b: - c: 3 d: e: "bbb" Will give a...
[ "def", "merge_dicts", "(", "a", ",", "b", ")", ":", "anyconfig", ".", "merge", "(", "a", ",", "b", ",", "ac_merge", "=", "MERGE_STRATEGY", ")", "return", "a" ]
Merges the values of B into A and returns a mutated dict A. :: dict a b: - c: 0 - c: 2 d: e: "aaa" f: 3 dict b a: 1 b: - c: 3 d: e: "bbb" Will give an object such as:: {'a': 1...
[ "Merges", "the", "values", "of", "B", "into", "A", "and", "returns", "a", "mutated", "dict", "A", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/util.py#L265-L299
train
Merges the values of B into A and returns a mutated dict A.
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...
ansible/molecule
molecule/model/schema_v2.py
Validator._validate_unique
def _validate_unique(self, unique, field, value): """Ensure value uniqueness. The rule's arguments are validated against this schema: {'type': 'boolean'} """ if unique: root_key = self.schema_path[0] data = (doc[field] for doc in self.root_document[root_k...
python
def _validate_unique(self, unique, field, value): """Ensure value uniqueness. The rule's arguments are validated against this schema: {'type': 'boolean'} """ if unique: root_key = self.schema_path[0] data = (doc[field] for doc in self.root_document[root_k...
[ "def", "_validate_unique", "(", "self", ",", "unique", ",", "field", ",", "value", ")", ":", "if", "unique", ":", "root_key", "=", "self", ".", "schema_path", "[", "0", "]", "data", "=", "(", "doc", "[", "field", "]", "for", "doc", "in", "self", "....
Ensure value uniqueness. The rule's arguments are validated against this schema: {'type': 'boolean'}
[ "Ensure", "value", "uniqueness", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/model/schema_v2.py#L986-L998
train
Ensure value uniqueness.
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...
ansible/molecule
molecule/model/schema_v2.py
Validator._validate_disallowed
def _validate_disallowed(self, disallowed, field, value): """ Readonly but with a custom error. The rule's arguments are validated against this schema: {'type': 'boolean'} """ if disallowed: msg = 'disallowed user provided config option' self._error(field...
python
def _validate_disallowed(self, disallowed, field, value): """ Readonly but with a custom error. The rule's arguments are validated against this schema: {'type': 'boolean'} """ if disallowed: msg = 'disallowed user provided config option' self._error(field...
[ "def", "_validate_disallowed", "(", "self", ",", "disallowed", ",", "field", ",", "value", ")", ":", "if", "disallowed", ":", "msg", "=", "'disallowed user provided config option'", "self", ".", "_error", "(", "field", ",", "msg", ")" ]
Readonly but with a custom error. The rule's arguments are validated against this schema: {'type': 'boolean'}
[ "Readonly", "but", "with", "a", "custom", "error", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/model/schema_v2.py#L1000-L1008
train
Readonly but with a custom error.
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...
ansible/molecule
molecule/model/schema_v2.py
Validator._validate_molecule_env_var
def _validate_molecule_env_var(self, molecule_env_var, field, value): """ Readonly but with a custom error. The rule's arguments are validated against this schema: {'type': 'boolean'} """ # TODO(retr0h): This needs to be better handled. pattern = r'^[{$]+MOLECULE[_a-z0-9...
python
def _validate_molecule_env_var(self, molecule_env_var, field, value): """ Readonly but with a custom error. The rule's arguments are validated against this schema: {'type': 'boolean'} """ # TODO(retr0h): This needs to be better handled. pattern = r'^[{$]+MOLECULE[_a-z0-9...
[ "def", "_validate_molecule_env_var", "(", "self", ",", "molecule_env_var", ",", "field", ",", "value", ")", ":", "# TODO(retr0h): This needs to be better handled.", "pattern", "=", "r'^[{$]+MOLECULE[_a-z0-9A-Z]+[}]*$'", "if", "molecule_env_var", ":", "if", "re", ".", "mat...
Readonly but with a custom error. The rule's arguments are validated against this schema: {'type': 'boolean'}
[ "Readonly", "but", "with", "a", "custom", "error", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/model/schema_v2.py#L1021-L1034
train
Readonly but with a custom error.
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...
ansible/molecule
molecule/command/idempotence.py
Idempotence.execute
def execute(self): """ Execute the actions necessary to perform a `molecule idempotence` and returns None. :return: None """ self.print_info() if not self._config.state.converged: msg = 'Instances not converged. Please converge instances first.' ...
python
def execute(self): """ Execute the actions necessary to perform a `molecule idempotence` and returns None. :return: None """ self.print_info() if not self._config.state.converged: msg = 'Instances not converged. Please converge instances first.' ...
[ "def", "execute", "(", "self", ")", ":", "self", ".", "print_info", "(", ")", "if", "not", "self", ".", "_config", ".", "state", ".", "converged", ":", "msg", "=", "'Instances not converged. Please converge instances first.'", "util", ".", "sysexit_with_message",...
Execute the actions necessary to perform a `molecule idempotence` and returns None. :return: None
[ "Execute", "the", "actions", "necessary", "to", "perform", "a", "molecule", "idempotence", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/command/idempotence.py#L69-L90
train
Execute the actions necessary to perform a molecule idempotence and return None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/command/idempotence.py
Idempotence._is_idempotent
def _is_idempotent(self, output): """ Parses the output of the provisioning for changed and returns a bool. :param output: A string containing the output of the ansible run. :return: bool """ # Remove blank lines to make regex matches easier output = re.sub(r'\n...
python
def _is_idempotent(self, output): """ Parses the output of the provisioning for changed and returns a bool. :param output: A string containing the output of the ansible run. :return: bool """ # Remove blank lines to make regex matches easier output = re.sub(r'\n...
[ "def", "_is_idempotent", "(", "self", ",", "output", ")", ":", "# Remove blank lines to make regex matches easier", "output", "=", "re", ".", "sub", "(", "r'\\n\\s*\\n*'", ",", "'\\n'", ",", "output", ")", "# Look for any non-zero changed lines", "changed", "=", "re",...
Parses the output of the provisioning for changed and returns a bool. :param output: A string containing the output of the ansible run. :return: bool
[ "Parses", "the", "output", "of", "the", "provisioning", "for", "changed", "and", "returns", "a", "bool", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/command/idempotence.py#L92-L110
train
Parses the output of the ansible run and returns a bool.
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...
ansible/molecule
molecule/command/idempotence.py
Idempotence._non_idempotent_tasks
def _non_idempotent_tasks(self, output): """ Parses the output to identify the non idempotent tasks. :param (str) output: A string containing the output of the ansible run. :return: A list containing the names of the non idempotent tasks. """ # Remove blank lines to make...
python
def _non_idempotent_tasks(self, output): """ Parses the output to identify the non idempotent tasks. :param (str) output: A string containing the output of the ansible run. :return: A list containing the names of the non idempotent tasks. """ # Remove blank lines to make...
[ "def", "_non_idempotent_tasks", "(", "self", ",", "output", ")", ":", "# Remove blank lines to make regex matches easier.", "output", "=", "re", ".", "sub", "(", "r'\\n\\s*\\n*'", ",", "'\\n'", ",", "output", ")", "# Remove ansi escape sequences.", "output", "=", "uti...
Parses the output to identify the non idempotent tasks. :param (str) output: A string containing the output of the ansible run. :return: A list containing the names of the non idempotent tasks.
[ "Parses", "the", "output", "to", "identify", "the", "non", "idempotent", "tasks", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/command/idempotence.py#L112-L137
train
Parses the output of the ansible run to identify the non idempotent tasks.
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...
ansible/molecule
molecule/command/init/scenario.py
scenario
def scenario(ctx, dependency_name, driver_name, lint_name, provisioner_name, role_name, scenario_name, verifier_name): # pragma: no cover """ Initialize a new scenario for use with Molecule. """ command_args = { 'dependency_name': dependency_name, 'driver_name': driver_name, ...
python
def scenario(ctx, dependency_name, driver_name, lint_name, provisioner_name, role_name, scenario_name, verifier_name): # pragma: no cover """ Initialize a new scenario for use with Molecule. """ command_args = { 'dependency_name': dependency_name, 'driver_name': driver_name, ...
[ "def", "scenario", "(", "ctx", ",", "dependency_name", ",", "driver_name", ",", "lint_name", ",", "provisioner_name", ",", "role_name", ",", "scenario_name", ",", "verifier_name", ")", ":", "# pragma: no cover", "command_args", "=", "{", "'dependency_name'", ":", ...
Initialize a new scenario for use with Molecule.
[ "Initialize", "a", "new", "scenario", "for", "use", "with", "Molecule", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/command/init/scenario.py#L162-L186
train
Initialize a new scenario for use with Molecule.
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...
ansible/molecule
molecule/command/init/scenario.py
Scenario.execute
def execute(self): """ Execute the actions necessary to perform a `molecule init scenario` and returns None. :return: None """ scenario_name = self._command_args['scenario_name'] role_name = os.getcwd().split(os.sep)[-1] role_directory = util.abs_path(os....
python
def execute(self): """ Execute the actions necessary to perform a `molecule init scenario` and returns None. :return: None """ scenario_name = self._command_args['scenario_name'] role_name = os.getcwd().split(os.sep)[-1] role_directory = util.abs_path(os....
[ "def", "execute", "(", "self", ")", ":", "scenario_name", "=", "self", ".", "_command_args", "[", "'scenario_name'", "]", "role_name", "=", "os", ".", "getcwd", "(", ")", ".", "split", "(", "os", ".", "sep", ")", "[", "-", "1", "]", "role_directory", ...
Execute the actions necessary to perform a `molecule init scenario` and returns None. :return: None
[ "Execute", "the", "actions", "necessary", "to", "perform", "a", "molecule", "init", "scenario", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/command/init/scenario.py#L53-L89
train
Execute the actions necessary to perform a molecule init scenario and return None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/driver/docker.py
Docker.sanity_checks
def sanity_checks(self): """Implement Docker driver sanity checks.""" if self._config.state.sanity_checked: return log.info("Sanity checks: '{}'".format(self._name)) HAS_DOCKER_PY = None try: from ansible.module_utils.docker_common import HAS_DOCKER_PY ...
python
def sanity_checks(self): """Implement Docker driver sanity checks.""" if self._config.state.sanity_checked: return log.info("Sanity checks: '{}'".format(self._name)) HAS_DOCKER_PY = None try: from ansible.module_utils.docker_common import HAS_DOCKER_PY ...
[ "def", "sanity_checks", "(", "self", ")", ":", "if", "self", ".", "_config", ".", "state", ".", "sanity_checked", ":", "return", "log", ".", "info", "(", "\"Sanity checks: '{}'\"", ".", "format", "(", "self", ".", "_name", ")", ")", "HAS_DOCKER_PY", "=", ...
Implement Docker driver sanity checks.
[ "Implement", "Docker", "driver", "sanity", "checks", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/driver/docker.py#L191-L227
train
Implement Docker driver sanity checks.
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...
ansible/molecule
molecule/verifier/lint/flake8.py
Flake8.bake
def bake(self): """ Bake a `flake8` command so it's ready to execute and returns None. :return: None """ self._flake8_command = sh.flake8.bake( self.options, self._tests, _env=self.env, _out=LOG.out, _err=LOG.error)
python
def bake(self): """ Bake a `flake8` command so it's ready to execute and returns None. :return: None """ self._flake8_command = sh.flake8.bake( self.options, self._tests, _env=self.env, _out=LOG.out, _err=LOG.error)
[ "def", "bake", "(", "self", ")", ":", "self", ".", "_flake8_command", "=", "sh", ".", "flake8", ".", "bake", "(", "self", ".", "options", ",", "self", ".", "_tests", ",", "_env", "=", "self", ".", "env", ",", "_out", "=", "LOG", ".", "out", ",", ...
Bake a `flake8` command so it's ready to execute and returns None. :return: None
[ "Bake", "a", "flake8", "command", "so", "it", "s", "ready", "to", "execute", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/verifier/lint/flake8.py#L94-L105
train
Bake a fle8 command so it s ready to execute and returns None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/dependency/ansible_galaxy.py
AnsibleGalaxy._setup
def _setup(self): """ Prepare the system for using ``ansible-galaxy`` and returns None. :return: None """ role_directory = os.path.join(self._config.scenario.directory, self.options['roles-path']) if not os.path.isdir(role_directory)...
python
def _setup(self): """ Prepare the system for using ``ansible-galaxy`` and returns None. :return: None """ role_directory = os.path.join(self._config.scenario.directory, self.options['roles-path']) if not os.path.isdir(role_directory)...
[ "def", "_setup", "(", "self", ")", ":", "role_directory", "=", "os", ".", "path", ".", "join", "(", "self", ".", "_config", ".", "scenario", ".", "directory", ",", "self", ".", "options", "[", "'roles-path'", "]", ")", "if", "not", "os", ".", "path",...
Prepare the system for using ``ansible-galaxy`` and returns None. :return: None
[ "Prepare", "the", "system", "for", "using", "ansible", "-", "galaxy", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/dependency/ansible_galaxy.py#L154-L163
train
Prepare the system for using ansible - galaxy and returns None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/command/converge.py
converge
def converge(ctx, scenario_name, ansible_args): # pragma: no cover """ Use the provisioner to configure instances (dependency, create, prepare converge). """ args = ctx.obj.get('args') subcommand = base._get_subcommand(__name__) command_args = { 'subcommand': subcommand, } ...
python
def converge(ctx, scenario_name, ansible_args): # pragma: no cover """ Use the provisioner to configure instances (dependency, create, prepare converge). """ args = ctx.obj.get('args') subcommand = base._get_subcommand(__name__) command_args = { 'subcommand': subcommand, } ...
[ "def", "converge", "(", "ctx", ",", "scenario_name", ",", "ansible_args", ")", ":", "# pragma: no cover", "args", "=", "ctx", ".", "obj", ".", "get", "(", "'args'", ")", "subcommand", "=", "base", ".", "_get_subcommand", "(", "__name__", ")", "command_args",...
Use the provisioner to configure instances (dependency, create, prepare converge).
[ "Use", "the", "provisioner", "to", "configure", "instances", "(", "dependency", "create", "prepare", "converge", ")", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/command/converge.py#L93-L105
train
Execute a scenario in a new version of the application.
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...
ansible/molecule
molecule/command/converge.py
Converge.execute
def execute(self): """ Execute the actions necessary to perform a `molecule converge` and returns None. :return: None """ self.print_info() self._config.provisioner.converge() self._config.state.change_state('converged', True)
python
def execute(self): """ Execute the actions necessary to perform a `molecule converge` and returns None. :return: None """ self.print_info() self._config.provisioner.converge() self._config.state.change_state('converged', True)
[ "def", "execute", "(", "self", ")", ":", "self", ".", "print_info", "(", ")", "self", ".", "_config", ".", "provisioner", ".", "converge", "(", ")", "self", ".", "_config", ".", "state", ".", "change_state", "(", "'converged'", ",", "True", ")" ]
Execute the actions necessary to perform a `molecule converge` and returns None. :return: None
[ "Execute", "the", "actions", "necessary", "to", "perform", "a", "molecule", "converge", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/command/converge.py#L72-L81
train
Execute the actions necessary to perform a molecule converge and return None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/scenarios.py
Scenarios.all
def all(self): """ Return a list containing all scenario objects. :return: list """ if self._scenario_name: scenarios = self._filter_for_scenario() self._verify() return scenarios scenarios = [c.scenario for c in self._configs] ...
python
def all(self): """ Return a list containing all scenario objects. :return: list """ if self._scenario_name: scenarios = self._filter_for_scenario() self._verify() return scenarios scenarios = [c.scenario for c in self._configs] ...
[ "def", "all", "(", "self", ")", ":", "if", "self", ".", "_scenario_name", ":", "scenarios", "=", "self", ".", "_filter_for_scenario", "(", ")", "self", ".", "_verify", "(", ")", "return", "scenarios", "scenarios", "=", "[", "c", ".", "scenario", "for", ...
Return a list containing all scenario objects. :return: list
[ "Return", "a", "list", "containing", "all", "scenario", "objects", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/scenarios.py#L60-L74
train
Return a list containing all scenario objects.
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...
ansible/molecule
molecule/scenarios.py
Scenarios._verify
def _verify(self): """ Verify the specified scenario was found and returns None. :return: None """ scenario_names = [c.scenario.name for c in self._configs] if self._scenario_name not in scenario_names: msg = ("Scenario '{}' not found. " '...
python
def _verify(self): """ Verify the specified scenario was found and returns None. :return: None """ scenario_names = [c.scenario.name for c in self._configs] if self._scenario_name not in scenario_names: msg = ("Scenario '{}' not found. " '...
[ "def", "_verify", "(", "self", ")", ":", "scenario_names", "=", "[", "c", ".", "scenario", ".", "name", "for", "c", "in", "self", ".", "_configs", "]", "if", "self", ".", "_scenario_name", "not", "in", "scenario_names", ":", "msg", "=", "(", "\"Scenari...
Verify the specified scenario was found and returns None. :return: None
[ "Verify", "the", "specified", "scenario", "was", "found", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/scenarios.py#L92-L102
train
Verify the specified scenario was found and returns None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/scenarios.py
Scenarios._filter_for_scenario
def _filter_for_scenario(self): """ Find the scenario matching the provided scenario name and returns a list. :return: list """ return [ c.scenario for c in self._configs if c.scenario.name == self._scenario_name ]
python
def _filter_for_scenario(self): """ Find the scenario matching the provided scenario name and returns a list. :return: list """ return [ c.scenario for c in self._configs if c.scenario.name == self._scenario_name ]
[ "def", "_filter_for_scenario", "(", "self", ")", ":", "return", "[", "c", ".", "scenario", "for", "c", "in", "self", ".", "_configs", "if", "c", ".", "scenario", ".", "name", "==", "self", ".", "_scenario_name", "]" ]
Find the scenario matching the provided scenario name and returns a list. :return: list
[ "Find", "the", "scenario", "matching", "the", "provided", "scenario", "name", "and", "returns", "a", "list", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/scenarios.py#L104-L114
train
Returns a list of the scenario that matches the provided scenario name and returns a 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...
ansible/molecule
molecule/scenarios.py
Scenarios._get_matrix
def _get_matrix(self): """ Build a matrix of scenarios with sequence to include and returns a dict. { scenario_1: { 'subcommand': [ 'action-1', 'action-2', ], }, scenario_2: { ...
python
def _get_matrix(self): """ Build a matrix of scenarios with sequence to include and returns a dict. { scenario_1: { 'subcommand': [ 'action-1', 'action-2', ], }, scenario_2: { ...
[ "def", "_get_matrix", "(", "self", ")", ":", "return", "dict", "(", "{", "scenario", ".", "name", ":", "{", "'check'", ":", "scenario", ".", "check_sequence", ",", "'cleanup'", ":", "scenario", ".", "cleanup_sequence", ",", "'converge'", ":", "scenario", "...
Build a matrix of scenarios with sequence to include and returns a dict. { scenario_1: { 'subcommand': [ 'action-1', 'action-2', ], }, scenario_2: { 'subcommand': [ ...
[ "Build", "a", "matrix", "of", "scenarios", "with", "sequence", "to", "include", "and", "returns", "a", "dict", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/scenarios.py#L116-L154
train
Builds a matrix of scenarios with sequence to include and returns a dict.
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...
ansible/molecule
molecule/logger.py
get_logger
def get_logger(name=None): """ Build a logger with the given name and returns the logger. :param name: The name for the logger. This is usually the module name, ``__name__``. :return: logger object """ logging.setLoggerClass(CustomLogger) logger = logging.getLogger(name) ...
python
def get_logger(name=None): """ Build a logger with the given name and returns the logger. :param name: The name for the logger. This is usually the module name, ``__name__``. :return: logger object """ logging.setLoggerClass(CustomLogger) logger = logging.getLogger(name) ...
[ "def", "get_logger", "(", "name", "=", "None", ")", ":", "logging", ".", "setLoggerClass", "(", "CustomLogger", ")", "logger", "=", "logging", ".", "getLogger", "(", "name", ")", "logger", ".", "setLevel", "(", "logging", ".", "DEBUG", ")", "logger", "."...
Build a logger with the given name and returns the logger. :param name: The name for the logger. This is usually the module name, ``__name__``. :return: logger object
[ "Build", "a", "logger", "with", "the", "given", "name", "and", "returns", "the", "logger", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/logger.py#L86-L107
train
Build a logger with the given name and returns the logger 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...
ansible/molecule
molecule/command/lint.py
lint
def lint(ctx, scenario_name): # pragma: no cover """ Lint the role. """ args = ctx.obj.get('args') subcommand = base._get_subcommand(__name__) command_args = { 'subcommand': subcommand, } base.execute_cmdline_scenarios(scenario_name, args, command_args)
python
def lint(ctx, scenario_name): # pragma: no cover """ Lint the role. """ args = ctx.obj.get('args') subcommand = base._get_subcommand(__name__) command_args = { 'subcommand': subcommand, } base.execute_cmdline_scenarios(scenario_name, args, command_args)
[ "def", "lint", "(", "ctx", ",", "scenario_name", ")", ":", "# pragma: no cover", "args", "=", "ctx", ".", "obj", ".", "get", "(", "'args'", ")", "subcommand", "=", "base", ".", "_get_subcommand", "(", "__name__", ")", "command_args", "=", "{", "'subcommand...
Lint the role.
[ "Lint", "the", "role", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/command/lint.py#L91-L99
train
Lint the role.
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...
ansible/molecule
molecule/command/lint.py
Lint.execute
def execute(self): """ Execute the actions necessary to perform a `molecule lint` and returns None. :return: None """ self.print_info() linters = [ l for l in [ self._config.lint, self._config.verifier.lint, ...
python
def execute(self): """ Execute the actions necessary to perform a `molecule lint` and returns None. :return: None """ self.print_info() linters = [ l for l in [ self._config.lint, self._config.verifier.lint, ...
[ "def", "execute", "(", "self", ")", ":", "self", ".", "print_info", "(", ")", "linters", "=", "[", "l", "for", "l", "in", "[", "self", ".", "_config", ".", "lint", ",", "self", ".", "_config", ".", "verifier", ".", "lint", ",", "self", ".", "_con...
Execute the actions necessary to perform a `molecule lint` and returns None. :return: None
[ "Execute", "the", "actions", "necessary", "to", "perform", "a", "molecule", "lint", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/command/lint.py#L63-L80
train
Execute the actions necessary to perform a molecule lint and return None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/provisioner/ansible.py
Ansible.inventory
def inventory(self): """ Create an inventory structure and returns a dict. .. code-block:: yaml ungrouped: vars: foo: bar hosts: instance-1: instance-2: children: $child_group_n...
python
def inventory(self): """ Create an inventory structure and returns a dict. .. code-block:: yaml ungrouped: vars: foo: bar hosts: instance-1: instance-2: children: $child_group_n...
[ "def", "inventory", "(", "self", ")", ":", "dd", "=", "self", ".", "_vivify", "(", ")", "for", "platform", "in", "self", ".", "_config", ".", "platforms", ".", "instances", ":", "for", "group", "in", "platform", ".", "get", "(", "'groups'", ",", "[",...
Create an inventory structure and returns a dict. .. code-block:: yaml ungrouped: vars: foo: bar hosts: instance-1: instance-2: children: $child_group_name: hosts: ...
[ "Create", "an", "inventory", "structure", "and", "returns", "a", "dict", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/provisioner/ansible.py#L529-L588
train
Create an inventory structure and returns a dict.
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...
ansible/molecule
molecule/provisioner/ansible.py
Ansible.cleanup
def cleanup(self): """ Executes `ansible-playbook` against the cleanup playbook and returns None. :return: None """ pb = self._get_ansible_playbook(self.playbooks.cleanup) pb.execute()
python
def cleanup(self): """ Executes `ansible-playbook` against the cleanup playbook and returns None. :return: None """ pb = self._get_ansible_playbook(self.playbooks.cleanup) pb.execute()
[ "def", "cleanup", "(", "self", ")", ":", "pb", "=", "self", ".", "_get_ansible_playbook", "(", "self", ".", "playbooks", ".", "cleanup", ")", "pb", ".", "execute", "(", ")" ]
Executes `ansible-playbook` against the cleanup playbook and returns None. :return: None
[ "Executes", "ansible", "-", "playbook", "against", "the", "cleanup", "playbook", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/provisioner/ansible.py#L614-L622
train
Executes ansible - playbook against the cleanup playbook and returns None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/provisioner/ansible.py
Ansible.converge
def converge(self, playbook=None, **kwargs): """ Executes ``ansible-playbook`` against the converge playbook unless specified otherwise and returns a string. :param playbook: An optional string containing an absolute path to a playbook. :param kwargs: An optional keywor...
python
def converge(self, playbook=None, **kwargs): """ Executes ``ansible-playbook`` against the converge playbook unless specified otherwise and returns a string. :param playbook: An optional string containing an absolute path to a playbook. :param kwargs: An optional keywor...
[ "def", "converge", "(", "self", ",", "playbook", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "playbook", "is", "None", ":", "pb", "=", "self", ".", "_get_ansible_playbook", "(", "self", ".", "playbooks", ".", "converge", ",", "*", "*", "kwa...
Executes ``ansible-playbook`` against the converge playbook unless specified otherwise and returns a string. :param playbook: An optional string containing an absolute path to a playbook. :param kwargs: An optional keyword arguments. :return: str
[ "Executes", "ansible", "-", "playbook", "against", "the", "converge", "playbook", "unless", "specified", "otherwise", "and", "returns", "a", "string", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/provisioner/ansible.py#L641-L656
train
Executes an ansible - playbook against the converge playbook unless the a playbook is specified otherwise returns a 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...
ansible/molecule
molecule/provisioner/ansible.py
Ansible.destroy
def destroy(self): """ Executes ``ansible-playbook`` against the destroy playbook and returns None. :return: None """ pb = self._get_ansible_playbook(self.playbooks.destroy) pb.execute()
python
def destroy(self): """ Executes ``ansible-playbook`` against the destroy playbook and returns None. :return: None """ pb = self._get_ansible_playbook(self.playbooks.destroy) pb.execute()
[ "def", "destroy", "(", "self", ")", ":", "pb", "=", "self", ".", "_get_ansible_playbook", "(", "self", ".", "playbooks", ".", "destroy", ")", "pb", ".", "execute", "(", ")" ]
Executes ``ansible-playbook`` against the destroy playbook and returns None. :return: None
[ "Executes", "ansible", "-", "playbook", "against", "the", "destroy", "playbook", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/provisioner/ansible.py#L658-L666
train
Executes ansible - playbook against the destroy playbook and returns None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/provisioner/ansible.py
Ansible.side_effect
def side_effect(self): """ Executes ``ansible-playbook`` against the side_effect playbook and returns None. :return: None """ pb = self._get_ansible_playbook(self.playbooks.side_effect) pb.execute()
python
def side_effect(self): """ Executes ``ansible-playbook`` against the side_effect playbook and returns None. :return: None """ pb = self._get_ansible_playbook(self.playbooks.side_effect) pb.execute()
[ "def", "side_effect", "(", "self", ")", ":", "pb", "=", "self", ".", "_get_ansible_playbook", "(", "self", ".", "playbooks", ".", "side_effect", ")", "pb", ".", "execute", "(", ")" ]
Executes ``ansible-playbook`` against the side_effect playbook and returns None. :return: None
[ "Executes", "ansible", "-", "playbook", "against", "the", "side_effect", "playbook", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/provisioner/ansible.py#L668-L676
train
Executes ansible - playbook against the side_effect playbook and returns None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/provisioner/ansible.py
Ansible.create
def create(self): """ Executes ``ansible-playbook`` against the create playbook and returns None. :return: None """ pb = self._get_ansible_playbook(self.playbooks.create) pb.execute()
python
def create(self): """ Executes ``ansible-playbook`` against the create playbook and returns None. :return: None """ pb = self._get_ansible_playbook(self.playbooks.create) pb.execute()
[ "def", "create", "(", "self", ")", ":", "pb", "=", "self", ".", "_get_ansible_playbook", "(", "self", ".", "playbooks", ".", "create", ")", "pb", ".", "execute", "(", ")" ]
Executes ``ansible-playbook`` against the create playbook and returns None. :return: None
[ "Executes", "ansible", "-", "playbook", "against", "the", "create", "playbook", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/provisioner/ansible.py#L678-L686
train
Executes ansible - playbook against the create playbook and returns None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/provisioner/ansible.py
Ansible.prepare
def prepare(self): """ Executes ``ansible-playbook`` against the prepare playbook and returns None. :return: None """ pb = self._get_ansible_playbook(self.playbooks.prepare) pb.execute()
python
def prepare(self): """ Executes ``ansible-playbook`` against the prepare playbook and returns None. :return: None """ pb = self._get_ansible_playbook(self.playbooks.prepare) pb.execute()
[ "def", "prepare", "(", "self", ")", ":", "pb", "=", "self", ".", "_get_ansible_playbook", "(", "self", ".", "playbooks", ".", "prepare", ")", "pb", ".", "execute", "(", ")" ]
Executes ``ansible-playbook`` against the prepare playbook and returns None. :return: None
[ "Executes", "ansible", "-", "playbook", "against", "the", "prepare", "playbook", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/provisioner/ansible.py#L688-L696
train
Executes ansible - playbook against the prepare playbook and returns None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/provisioner/ansible.py
Ansible.syntax
def syntax(self): """ Executes ``ansible-playbook`` against the converge playbook with the ``-syntax-check`` flag and returns None. :return: None """ pb = self._get_ansible_playbook(self.playbooks.converge) pb.add_cli_arg('syntax-check', True) pb.execute(...
python
def syntax(self): """ Executes ``ansible-playbook`` against the converge playbook with the ``-syntax-check`` flag and returns None. :return: None """ pb = self._get_ansible_playbook(self.playbooks.converge) pb.add_cli_arg('syntax-check', True) pb.execute(...
[ "def", "syntax", "(", "self", ")", ":", "pb", "=", "self", ".", "_get_ansible_playbook", "(", "self", ".", "playbooks", ".", "converge", ")", "pb", ".", "add_cli_arg", "(", "'syntax-check'", ",", "True", ")", "pb", ".", "execute", "(", ")" ]
Executes ``ansible-playbook`` against the converge playbook with the ``-syntax-check`` flag and returns None. :return: None
[ "Executes", "ansible", "-", "playbook", "against", "the", "converge", "playbook", "with", "the", "-", "syntax", "-", "check", "flag", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/provisioner/ansible.py#L698-L707
train
Executes ansible - playbook against the converge playbook with the syntax - check flag. Returns None if the command fails.
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...
ansible/molecule
molecule/provisioner/ansible.py
Ansible.verify
def verify(self): """ Executes ``ansible-playbook`` against the verify playbook and returns None. :return: None """ pb = self._get_ansible_playbook(self.playbooks.verify) pb.execute()
python
def verify(self): """ Executes ``ansible-playbook`` against the verify playbook and returns None. :return: None """ pb = self._get_ansible_playbook(self.playbooks.verify) pb.execute()
[ "def", "verify", "(", "self", ")", ":", "pb", "=", "self", ".", "_get_ansible_playbook", "(", "self", ".", "playbooks", ".", "verify", ")", "pb", ".", "execute", "(", ")" ]
Executes ``ansible-playbook`` against the verify playbook and returns None. :return: None
[ "Executes", "ansible", "-", "playbook", "against", "the", "verify", "playbook", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/provisioner/ansible.py#L709-L717
train
Executes ansible - playbook against the verify playbook and returns None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/provisioner/ansible.py
Ansible.write_config
def write_config(self): """ Writes the provisioner's config file to disk and returns None. :return: None """ template = util.render_template( self._get_config_template(), config_options=self.config_options) util.write_file(self.config_file, template)
python
def write_config(self): """ Writes the provisioner's config file to disk and returns None. :return: None """ template = util.render_template( self._get_config_template(), config_options=self.config_options) util.write_file(self.config_file, template)
[ "def", "write_config", "(", "self", ")", ":", "template", "=", "util", ".", "render_template", "(", "self", ".", "_get_config_template", "(", ")", ",", "config_options", "=", "self", ".", "config_options", ")", "util", ".", "write_file", "(", "self", ".", ...
Writes the provisioner's config file to disk and returns None. :return: None
[ "Writes", "the", "provisioner", "s", "config", "file", "to", "disk", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/provisioner/ansible.py#L719-L727
train
Writes the provisioner s config file to disk and returns None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/provisioner/ansible.py
Ansible.manage_inventory
def manage_inventory(self): """ Manages inventory for Ansible and returns None. :returns: None """ self._write_inventory() self._remove_vars() if not self.links: self._add_or_update_vars() else: self._link_or_update_vars()
python
def manage_inventory(self): """ Manages inventory for Ansible and returns None. :returns: None """ self._write_inventory() self._remove_vars() if not self.links: self._add_or_update_vars() else: self._link_or_update_vars()
[ "def", "manage_inventory", "(", "self", ")", ":", "self", ".", "_write_inventory", "(", ")", "self", ".", "_remove_vars", "(", ")", "if", "not", "self", ".", "links", ":", "self", ".", "_add_or_update_vars", "(", ")", "else", ":", "self", ".", "_link_or_...
Manages inventory for Ansible and returns None. :returns: None
[ "Manages", "inventory", "for", "Ansible", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/provisioner/ansible.py#L729-L740
train
Manages inventory for Ansible and returns None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/provisioner/ansible.py
Ansible._add_or_update_vars
def _add_or_update_vars(self): """ Creates host and/or group vars and returns None. :returns: None """ # Create the hosts extra inventory source (only if not empty) hosts_file = os.path.join(self.inventory_directory, 'hosts') if self.hosts: util.write...
python
def _add_or_update_vars(self): """ Creates host and/or group vars and returns None. :returns: None """ # Create the hosts extra inventory source (only if not empty) hosts_file = os.path.join(self.inventory_directory, 'hosts') if self.hosts: util.write...
[ "def", "_add_or_update_vars", "(", "self", ")", ":", "# Create the hosts extra inventory source (only if not empty)", "hosts_file", "=", "os", ".", "path", ".", "join", "(", "self", ".", "inventory_directory", ",", "'hosts'", ")", "if", "self", ".", "hosts", ":", ...
Creates host and/or group vars and returns None. :returns: None
[ "Creates", "host", "and", "/", "or", "group", "vars", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/provisioner/ansible.py#L746-L782
train
Adds or updates the host and group vars and returns None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/provisioner/ansible.py
Ansible._write_inventory
def _write_inventory(self): """ Writes the provisioner's inventory file to disk and returns None. :return: None """ self._verify_inventory() util.write_file(self.inventory_file, util.safe_dump(self.inventory))
python
def _write_inventory(self): """ Writes the provisioner's inventory file to disk and returns None. :return: None """ self._verify_inventory() util.write_file(self.inventory_file, util.safe_dump(self.inventory))
[ "def", "_write_inventory", "(", "self", ")", ":", "self", ".", "_verify_inventory", "(", ")", "util", ".", "write_file", "(", "self", ".", "inventory_file", ",", "util", ".", "safe_dump", "(", "self", ".", "inventory", ")", ")" ]
Writes the provisioner's inventory file to disk and returns None. :return: None
[ "Writes", "the", "provisioner", "s", "inventory", "file", "to", "disk", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/provisioner/ansible.py#L784-L792
train
Writes the provisioner s inventory file to disk and returns None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/provisioner/ansible.py
Ansible._remove_vars
def _remove_vars(self): """ Remove hosts/host_vars/group_vars and returns None. :returns: None """ for name in ("hosts", "group_vars", "host_vars"): d = os.path.join(self.inventory_directory, name) if os.path.islink(d) or os.path.isfile(d): ...
python
def _remove_vars(self): """ Remove hosts/host_vars/group_vars and returns None. :returns: None """ for name in ("hosts", "group_vars", "host_vars"): d = os.path.join(self.inventory_directory, name) if os.path.islink(d) or os.path.isfile(d): ...
[ "def", "_remove_vars", "(", "self", ")", ":", "for", "name", "in", "(", "\"hosts\"", ",", "\"group_vars\"", ",", "\"host_vars\"", ")", ":", "d", "=", "os", ".", "path", ".", "join", "(", "self", ".", "inventory_directory", ",", "name", ")", "if", "os",...
Remove hosts/host_vars/group_vars and returns None. :returns: None
[ "Remove", "hosts", "/", "host_vars", "/", "group_vars", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/provisioner/ansible.py#L794-L805
train
Removes hosts group_vars and hosts files and returns None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/provisioner/ansible.py
Ansible._link_or_update_vars
def _link_or_update_vars(self): """ Creates or updates the symlink to group_vars and returns None. :returns: None """ for d, source in self.links.items(): target = os.path.join(self.inventory_directory, d) source = os.path.join(self._config.scenario.direc...
python
def _link_or_update_vars(self): """ Creates or updates the symlink to group_vars and returns None. :returns: None """ for d, source in self.links.items(): target = os.path.join(self.inventory_directory, d) source = os.path.join(self._config.scenario.direc...
[ "def", "_link_or_update_vars", "(", "self", ")", ":", "for", "d", ",", "source", "in", "self", ".", "links", ".", "items", "(", ")", ":", "target", "=", "os", ".", "path", ".", "join", "(", "self", ".", "inventory_directory", ",", "d", ")", "source",...
Creates or updates the symlink to group_vars and returns None. :returns: None
[ "Creates", "or", "updates", "the", "symlink", "to", "group_vars", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/provisioner/ansible.py#L807-L822
train
Creates or updates the symlink to group_vars and returns None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/provisioner/ansible.py
Ansible._get_ansible_playbook
def _get_ansible_playbook(self, playbook, **kwargs): """ Get an instance of AnsiblePlaybook and returns it. :param playbook: A string containing an absolute path to a provisioner's playbook. :param kwargs: An optional keyword arguments. :return: object """ ...
python
def _get_ansible_playbook(self, playbook, **kwargs): """ Get an instance of AnsiblePlaybook and returns it. :param playbook: A string containing an absolute path to a provisioner's playbook. :param kwargs: An optional keyword arguments. :return: object """ ...
[ "def", "_get_ansible_playbook", "(", "self", ",", "playbook", ",", "*", "*", "kwargs", ")", ":", "return", "ansible_playbook", ".", "AnsiblePlaybook", "(", "playbook", ",", "self", ".", "_config", ",", "*", "*", "kwargs", ")" ]
Get an instance of AnsiblePlaybook and returns it. :param playbook: A string containing an absolute path to a provisioner's playbook. :param kwargs: An optional keyword arguments. :return: object
[ "Get", "an", "instance", "of", "AnsiblePlaybook", "and", "returns", "it", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/provisioner/ansible.py#L824-L834
train
Get an instance of AnsiblePlaybook and returns it.
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...
ansible/molecule
molecule/lint/yamllint.py
Yamllint._get_files
def _get_files(self): """ Walk the project directory for tests and returns a list. :return: list """ excludes = [ '.git', '.tox', '.vagrant', '.venv', os.path.basename(self._config.verifier.directory), ] ...
python
def _get_files(self): """ Walk the project directory for tests and returns a list. :return: list """ excludes = [ '.git', '.tox', '.vagrant', '.venv', os.path.basename(self._config.verifier.directory), ] ...
[ "def", "_get_files", "(", "self", ")", ":", "excludes", "=", "[", "'.git'", ",", "'.tox'", ",", "'.vagrant'", ",", "'.venv'", ",", "os", ".", "path", ".", "basename", "(", "self", ".", "_config", ".", "verifier", ".", "directory", ")", ",", "]", "gen...
Walk the project directory for tests and returns a list. :return: list
[ "Walk", "the", "project", "directory", "for", "tests", "and", "returns", "a", "list", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/lint/yamllint.py#L143-L161
train
Walk the project directory for tests and returns a 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...
ansible/molecule
molecule/verifier/lint/yamllint.py
Yamllint.bake
def bake(self): """ Bake a `yamllint` command so it's ready to execute and returns None. :return: None """ self._yamllint_command = sh.yamllint.bake( self.options, self._tests, _env=self.env, _out=LOG.out, _err=LOG.erro...
python
def bake(self): """ Bake a `yamllint` command so it's ready to execute and returns None. :return: None """ self._yamllint_command = sh.yamllint.bake( self.options, self._tests, _env=self.env, _out=LOG.out, _err=LOG.erro...
[ "def", "bake", "(", "self", ")", ":", "self", ".", "_yamllint_command", "=", "sh", ".", "yamllint", ".", "bake", "(", "self", ".", "options", ",", "self", ".", "_tests", ",", "_env", "=", "self", ".", "env", ",", "_out", "=", "LOG", ".", "out", "...
Bake a `yamllint` command so it's ready to execute and returns None. :return: None
[ "Bake", "a", "yamllint", "command", "so", "it", "s", "ready", "to", "execute", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/verifier/lint/yamllint.py#L96-L107
train
Bake a yamllint command so it s ready to execute and returns None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
setup.py
str_if_nested_or_str
def str_if_nested_or_str(s): """Turn input into a native string if possible.""" if isinstance(s, ALL_STRING_TYPES): return str(s) if isinstance(s, (list, tuple)): return type(s)(map(str_if_nested_or_str, s)) if isinstance(s, (dict, )): return stringify_dict_contents(s) return...
python
def str_if_nested_or_str(s): """Turn input into a native string if possible.""" if isinstance(s, ALL_STRING_TYPES): return str(s) if isinstance(s, (list, tuple)): return type(s)(map(str_if_nested_or_str, s)) if isinstance(s, (dict, )): return stringify_dict_contents(s) return...
[ "def", "str_if_nested_or_str", "(", "s", ")", ":", "if", "isinstance", "(", "s", ",", "ALL_STRING_TYPES", ")", ":", "return", "str", "(", "s", ")", "if", "isinstance", "(", "s", ",", "(", "list", ",", "tuple", ")", ")", ":", "return", "type", "(", ...
Turn input into a native string if possible.
[ "Turn", "input", "into", "a", "native", "string", "if", "possible", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/setup.py#L46-L54
train
Turn input into a native string if possible.
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...
ansible/molecule
setup.py
stringify_dict_contents
def stringify_dict_contents(dct): """Turn dict keys and values into native strings.""" return { str_if_nested_or_str(k): str_if_nested_or_str(v) for k, v in dct.items() }
python
def stringify_dict_contents(dct): """Turn dict keys and values into native strings.""" return { str_if_nested_or_str(k): str_if_nested_or_str(v) for k, v in dct.items() }
[ "def", "stringify_dict_contents", "(", "dct", ")", ":", "return", "{", "str_if_nested_or_str", "(", "k", ")", ":", "str_if_nested_or_str", "(", "v", ")", "for", "k", ",", "v", "in", "dct", ".", "items", "(", ")", "}" ]
Turn dict keys and values into native strings.
[ "Turn", "dict", "keys", "and", "values", "into", "native", "strings", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/setup.py#L57-L62
train
Turn dict keys and values into native strings.
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...
ansible/molecule
molecule/command/create.py
create
def create(ctx, scenario_name, driver_name): # pragma: no cover """ Use the provisioner to start the instances. """ args = ctx.obj.get('args') subcommand = base._get_subcommand(__name__) command_args = { 'subcommand': subcommand, 'driver_name': driver_name, } base.execute_cmdli...
python
def create(ctx, scenario_name, driver_name): # pragma: no cover """ Use the provisioner to start the instances. """ args = ctx.obj.get('args') subcommand = base._get_subcommand(__name__) command_args = { 'subcommand': subcommand, 'driver_name': driver_name, } base.execute_cmdli...
[ "def", "create", "(", "ctx", ",", "scenario_name", ",", "driver_name", ")", ":", "# pragma: no cover", "args", "=", "ctx", ".", "obj", ".", "get", "(", "'args'", ")", "subcommand", "=", "base", ".", "_get_subcommand", "(", "__name__", ")", "command_args", ...
Use the provisioner to start the instances.
[ "Use", "the", "provisioner", "to", "start", "the", "instances", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/command/create.py#L108-L117
train
Create a new virtual environment.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/command/create.py
Create.execute
def execute(self): """ Execute the actions necessary to perform a `molecule create` and returns None. :return: None """ self.print_info() self._config.state.change_state('driver', self._config.driver.name) if self._config.driver.delegated and not self._c...
python
def execute(self): """ Execute the actions necessary to perform a `molecule create` and returns None. :return: None """ self.print_info() self._config.state.change_state('driver', self._config.driver.name) if self._config.driver.delegated and not self._c...
[ "def", "execute", "(", "self", ")", ":", "self", ".", "print_info", "(", ")", "self", ".", "_config", ".", "state", ".", "change_state", "(", "'driver'", ",", "self", ".", "_config", ".", "driver", ".", "name", ")", "if", "self", ".", "_config", ".",...
Execute the actions necessary to perform a `molecule create` and returns None. :return: None
[ "Execute", "the", "actions", "necessary", "to", "perform", "a", "molecule", "create", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/command/create.py#L70-L92
train
Execute the actions necessary to perform a molecule create and return None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/command/init/template.py
template
def template(ctx, url, no_input, role_name): # pragma: no cover """ Initialize a new role from a Cookiecutter URL. """ command_args = { 'role_name': role_name, 'subcommand': __name__, 'url': url, 'no_input': no_input, } t = Template(command_args) t.execute()
python
def template(ctx, url, no_input, role_name): # pragma: no cover """ Initialize a new role from a Cookiecutter URL. """ command_args = { 'role_name': role_name, 'subcommand': __name__, 'url': url, 'no_input': no_input, } t = Template(command_args) t.execute()
[ "def", "template", "(", "ctx", ",", "url", ",", "no_input", ",", "role_name", ")", ":", "# pragma: no cover", "command_args", "=", "{", "'role_name'", ":", "role_name", ",", "'subcommand'", ":", "__name__", ",", "'url'", ":", "url", ",", "'no_input'", ":", ...
Initialize a new role from a Cookiecutter URL.
[ "Initialize", "a", "new", "role", "from", "a", "Cookiecutter", "URL", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/command/init/template.py#L93-L103
train
Initialize a new role from a Cookiecutter 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...
ansible/molecule
molecule/command/init/template.py
Template.execute
def execute(self): """ Execute the actions necessary to perform a `molecule init template` and returns None. :return: None """ role_name = self._command_args['role_name'] url = self._command_args['url'] no_input = self._command_args['no_input'] r...
python
def execute(self): """ Execute the actions necessary to perform a `molecule init template` and returns None. :return: None """ role_name = self._command_args['role_name'] url = self._command_args['url'] no_input = self._command_args['no_input'] r...
[ "def", "execute", "(", "self", ")", ":", "role_name", "=", "self", ".", "_command_args", "[", "'role_name'", "]", "url", "=", "self", ".", "_command_args", "[", "'url'", "]", "no_input", "=", "self", ".", "_command_args", "[", "'no_input'", "]", "role_dire...
Execute the actions necessary to perform a `molecule init template` and returns None. :return: None
[ "Execute", "the", "actions", "necessary", "to", "perform", "a", "molecule", "init", "template", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/command/init/template.py#L46-L74
train
Execute the actions necessary to perform a molecule init template and return None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/command/prepare.py
Prepare.execute
def execute(self): """ Execute the actions necessary to prepare the instances and returns None. :return: None """ self.print_info() if (self._config.state.prepared and not self._config.command_args.get('force')): msg = 'Skipping, inst...
python
def execute(self): """ Execute the actions necessary to prepare the instances and returns None. :return: None """ self.print_info() if (self._config.state.prepared and not self._config.command_args.get('force')): msg = 'Skipping, inst...
[ "def", "execute", "(", "self", ")", ":", "self", ".", "print_info", "(", ")", "if", "(", "self", ".", "_config", ".", "state", ".", "prepared", "and", "not", "self", ".", "_config", ".", "command_args", ".", "get", "(", "'force'", ")", ")", ":", "m...
Execute the actions necessary to prepare the instances and returns None. :return: None
[ "Execute", "the", "actions", "necessary", "to", "prepare", "the", "instances", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/command/prepare.py#L82-L103
train
Execute the actions necessary to prepare the instances and returns None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/state.py
State.change_state
def change_state(self, key, value): """ Changes the state of the instance data with the given ``key`` and the provided ``value``. Wrapping with a decorator is probably not necessary. :param key: A ``str`` containing the key to update :param value: A value to change the ...
python
def change_state(self, key, value): """ Changes the state of the instance data with the given ``key`` and the provided ``value``. Wrapping with a decorator is probably not necessary. :param key: A ``str`` containing the key to update :param value: A value to change the ...
[ "def", "change_state", "(", "self", ",", "key", ",", "value", ")", ":", "if", "key", "not", "in", "VALID_KEYS", ":", "raise", "InvalidState", "self", ".", "_data", "[", "key", "]", "=", "value" ]
Changes the state of the instance data with the given ``key`` and the provided ``value``. Wrapping with a decorator is probably not necessary. :param key: A ``str`` containing the key to update :param value: A value to change the ``key`` to :return: None
[ "Changes", "the", "state", "of", "the", "instance", "data", "with", "the", "given", "key", "and", "the", "provided", "value", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/state.py#L109-L122
train
Changes the state of the given key and the provided value.
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...
ansible/molecule
molecule/dependency/shell.py
Shell.bake
def bake(self): """ Bake a ``shell`` command so it's ready to execute and returns None. :return: None """ command_list = self.command.split(' ') command, args = command_list[0], command_list[1:] self._sh_command = getattr(sh, command) # Reconstruct comma...
python
def bake(self): """ Bake a ``shell`` command so it's ready to execute and returns None. :return: None """ command_list = self.command.split(' ') command, args = command_list[0], command_list[1:] self._sh_command = getattr(sh, command) # Reconstruct comma...
[ "def", "bake", "(", "self", ")", ":", "command_list", "=", "self", ".", "command", ".", "split", "(", "' '", ")", "command", ",", "args", "=", "command_list", "[", "0", "]", ",", "command_list", "[", "1", ":", "]", "self", ".", "_sh_command", "=", ...
Bake a ``shell`` command so it's ready to execute and returns None. :return: None
[ "Bake", "a", "shell", "command", "so", "it", "s", "ready", "to", "execute", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/dependency/shell.py#L90-L102
train
Bake a shell command so it s ready to execute and returns None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/verifier/lint/rubocop.py
RuboCop.bake
def bake(self): """ Bake a `rubocop` command so it's ready to execute and returns None. :return: None """ self._rubocop_command = sh.rubocop.bake( self.options, self._tests, _env=self.env, _out=LOG.out, _err=LOG.error)
python
def bake(self): """ Bake a `rubocop` command so it's ready to execute and returns None. :return: None """ self._rubocop_command = sh.rubocop.bake( self.options, self._tests, _env=self.env, _out=LOG.out, _err=LOG.error)
[ "def", "bake", "(", "self", ")", ":", "self", ".", "_rubocop_command", "=", "sh", ".", "rubocop", ".", "bake", "(", "self", ".", "options", ",", "self", ".", "_tests", ",", "_env", "=", "self", ".", "env", ",", "_out", "=", "LOG", ".", "out", ","...
Bake a `rubocop` command so it's ready to execute and returns None. :return: None
[ "Bake", "a", "rubocop", "command", "so", "it", "s", "ready", "to", "execute", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/verifier/lint/rubocop.py#L98-L109
train
Bake a rabocop command so it s ready to execute and returns None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/command/destroy.py
Destroy.execute
def execute(self): """ Execute the actions necessary to perform a `molecule destroy` and returns None. :return: None """ self.print_info() if self._config.command_args.get('destroy') == 'never': msg = "Skipping, '--destroy=never' requested." ...
python
def execute(self): """ Execute the actions necessary to perform a `molecule destroy` and returns None. :return: None """ self.print_info() if self._config.command_args.get('destroy') == 'never': msg = "Skipping, '--destroy=never' requested." ...
[ "def", "execute", "(", "self", ")", ":", "self", ".", "print_info", "(", ")", "if", "self", ".", "_config", ".", "command_args", ".", "get", "(", "'destroy'", ")", "==", "'never'", ":", "msg", "=", "\"Skipping, '--destroy=never' requested.\"", "LOG", ".", ...
Execute the actions necessary to perform a `molecule destroy` and returns None. :return: None
[ "Execute", "the", "actions", "necessary", "to", "perform", "a", "molecule", "destroy", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/command/destroy.py#L76-L96
train
Execute the actions necessary to perform a molecule destroy and return None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/shell.py
main
def main(ctx, debug, base_config, env_file): # pragma: no cover """ \b _____ _ _ | |___| |___ ___ _ _| |___ | | | | . | | -_| _| | | | -_| |_|_|_|___|_|___|___|___|_|___| Molecule aids in the development and testing of Ansible roles. Enable autocomplete issue: ...
python
def main(ctx, debug, base_config, env_file): # pragma: no cover """ \b _____ _ _ | |___| |___ ___ _ _| |___ | | | | . | | -_| _| | | | -_| |_|_|_|___|_|___|___|___|_|___| Molecule aids in the development and testing of Ansible roles. Enable autocomplete issue: ...
[ "def", "main", "(", "ctx", ",", "debug", ",", "base_config", ",", "env_file", ")", ":", "# pragma: no cover", "ctx", ".", "obj", "=", "{", "}", "ctx", ".", "obj", "[", "'args'", "]", "=", "{", "}", "ctx", ".", "obj", "[", "'args'", "]", "[", "'de...
\b _____ _ _ | |___| |___ ___ _ _| |___ | | | | . | | -_| _| | | | -_| |_|_|_|___|_|___|___|___|_|___| Molecule aids in the development and testing of Ansible roles. Enable autocomplete issue: eval "$(_MOLECULE_COMPLETE=source molecule)"
[ "\\", "b", "_____", "_", "_", "|", "|___|", "|___", "___", "_", "_|", "|___", "|", "|", "|", "|", ".", "|", "|", "-", "_|", "_|", "|", "|", "|", "-", "_|", "|_|_|_|___|_|___|___|___|_|___|" ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/shell.py#L59-L77
train
A basic example of how to use the AIKIF grammar.
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...
ansible/molecule
molecule/provisioner/ansible/plugins/filters/molecule_core.py
from_yaml
def from_yaml(data): """ Interpolate the provided data and return a dict. Currently, this is used to reinterpolate the `molecule.yml` inside an Ansible playbook. If there were any interpolation errors, they would have been found and raised earlier. :return: dict """ molecule_env_file ...
python
def from_yaml(data): """ Interpolate the provided data and return a dict. Currently, this is used to reinterpolate the `molecule.yml` inside an Ansible playbook. If there were any interpolation errors, they would have been found and raised earlier. :return: dict """ molecule_env_file ...
[ "def", "from_yaml", "(", "data", ")", ":", "molecule_env_file", "=", "os", ".", "environ", "[", "'MOLECULE_ENV_FILE'", "]", "env", "=", "os", ".", "environ", ".", "copy", "(", ")", "env", "=", "config", ".", "set_env_from_file", "(", "env", ",", "molecul...
Interpolate the provided data and return a dict. Currently, this is used to reinterpolate the `molecule.yml` inside an Ansible playbook. If there were any interpolation errors, they would have been found and raised earlier. :return: dict
[ "Interpolate", "the", "provided", "data", "and", "return", "a", "dict", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/provisioner/ansible/plugins/filters/molecule_core.py#L28-L46
train
Interpolate the provided data and return a dict.
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...
ansible/molecule
molecule/command/matrix.py
matrix
def matrix(ctx, scenario_name, subcommand): # pragma: no cover """ List matrix of steps used to test instances. """ args = ctx.obj.get('args') command_args = { 'subcommand': subcommand, } s = scenarios.Scenarios( base.get_configs(args, command_args), scenario_name) s.p...
python
def matrix(ctx, scenario_name, subcommand): # pragma: no cover """ List matrix of steps used to test instances. """ args = ctx.obj.get('args') command_args = { 'subcommand': subcommand, } s = scenarios.Scenarios( base.get_configs(args, command_args), scenario_name) s.p...
[ "def", "matrix", "(", "ctx", ",", "scenario_name", ",", "subcommand", ")", ":", "# pragma: no cover", "args", "=", "ctx", ".", "obj", ".", "get", "(", "'args'", ")", "command_args", "=", "{", "'subcommand'", ":", "subcommand", ",", "}", "s", "=", "scenar...
List matrix of steps used to test instances.
[ "List", "matrix", "of", "steps", "used", "to", "test", "instances", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/command/matrix.py#L71-L83
train
List matrix of steps used to test instances.
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...
ansible/molecule
molecule/command/init/base.py
Base._process_templates
def _process_templates(self, template_dir, extra_context, output_dir, overwrite=True): """ Process templates as found in the named directory. :param template_dir: A string containing an a...
python
def _process_templates(self, template_dir, extra_context, output_dir, overwrite=True): """ Process templates as found in the named directory. :param template_dir: A string containing an a...
[ "def", "_process_templates", "(", "self", ",", "template_dir", ",", "extra_context", ",", "output_dir", ",", "overwrite", "=", "True", ")", ":", "template_dir", "=", "self", ".", "_resolve_template_dir", "(", "template_dir", ")", "self", ".", "_validate_template_d...
Process templates as found in the named directory. :param template_dir: A string containing an absolute or relative path to a directory where the templates are located. If the provided directory is a relative path, it is resolved using a known location. :param extra_context: A dict of...
[ "Process", "templates", "as", "found", "in", "the", "named", "directory", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/command/init/base.py#L36-L69
train
Process templates as found in the named 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...
ansible/molecule
molecule/provisioner/ansible/plugins/libraries/molecule_vagrant.py
VagrantClient.stdout_cm
def stdout_cm(self): """ Redirect the stdout to a log file. """ with open(self._get_stdout_log(), 'a+') as fh: msg = '### {} ###\n'.format(self._datetime) fh.write(msg) fh.flush() yield fh
python
def stdout_cm(self): """ Redirect the stdout to a log file. """ with open(self._get_stdout_log(), 'a+') as fh: msg = '### {} ###\n'.format(self._datetime) fh.write(msg) fh.flush() yield fh
[ "def", "stdout_cm", "(", "self", ")", ":", "with", "open", "(", "self", ".", "_get_stdout_log", "(", ")", ",", "'a+'", ")", "as", "fh", ":", "msg", "=", "'### {} ###\\n'", ".", "format", "(", "self", ".", "_datetime", ")", "fh", ".", "write", "(", ...
Redirect the stdout to a log file.
[ "Redirect", "the", "stdout", "to", "a", "log", "file", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/provisioner/ansible/plugins/libraries/molecule_vagrant.py#L364-L371
train
Redirect the stdout to a log file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/provisioner/ansible/plugins/libraries/molecule_vagrant.py
VagrantClient.stderr_cm
def stderr_cm(self): """ Redirect the stderr to a log file. """ with open(self._get_stderr_log(), 'a+') as fh: msg = '### {} ###\n'.format(self._datetime) fh.write(msg) fh.flush() try: yield fh except Exception as e: ...
python
def stderr_cm(self): """ Redirect the stderr to a log file. """ with open(self._get_stderr_log(), 'a+') as fh: msg = '### {} ###\n'.format(self._datetime) fh.write(msg) fh.flush() try: yield fh except Exception as e: ...
[ "def", "stderr_cm", "(", "self", ")", ":", "with", "open", "(", "self", ".", "_get_stderr_log", "(", ")", ",", "'a+'", ")", "as", "fh", ":", "msg", "=", "'### {} ###\\n'", ".", "format", "(", "self", ".", "_datetime", ")", "fh", ".", "write", "(", ...
Redirect the stderr to a log file.
[ "Redirect", "the", "stderr", "to", "a", "log", "file", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/provisioner/ansible/plugins/libraries/molecule_vagrant.py#L374-L387
train
Redirect the stderr to a log file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/driver/base.py
Base.status
def status(self): """ Collects the instances state and returns a list. .. important:: Molecule assumes all instances were created successfully by Ansible, otherwise Ansible would return an error on create. This may prove to be a bad assumption. However, co...
python
def status(self): """ Collects the instances state and returns a list. .. important:: Molecule assumes all instances were created successfully by Ansible, otherwise Ansible would return an error on create. This may prove to be a bad assumption. However, co...
[ "def", "status", "(", "self", ")", ":", "status_list", "=", "[", "]", "for", "platform", "in", "self", ".", "_config", ".", "platforms", ".", "instances", ":", "instance_name", "=", "platform", "[", "'name'", "]", "driver_name", "=", "self", ".", "name",...
Collects the instances state and returns a list. .. important:: Molecule assumes all instances were created successfully by Ansible, otherwise Ansible would return an error on create. This may prove to be a bad assumption. However, configuring Molecule's drive...
[ "Collects", "the", "instances", "state", "and", "returns", "a", "list", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/driver/base.py#L173-L204
train
Collects the instances state and returns a list of Status objects.
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...
ansible/molecule
molecule/scenario.py
Scenario.prune
def prune(self): """ Prune the scenario ephemeral directory files and returns None. "safe files" will not be pruned, including the ansible configuration and inventory used by this scenario, the scenario state file, and files declared as "safe_files" in the ``driver`` configurati...
python
def prune(self): """ Prune the scenario ephemeral directory files and returns None. "safe files" will not be pruned, including the ansible configuration and inventory used by this scenario, the scenario state file, and files declared as "safe_files" in the ``driver`` configurati...
[ "def", "prune", "(", "self", ")", ":", "LOG", ".", "info", "(", "'Pruning extra files from scenario ephemeral directory'", ")", "safe_files", "=", "[", "self", ".", "config", ".", "provisioner", ".", "config_file", ",", "self", ".", "config", ".", "provisioner",...
Prune the scenario ephemeral directory files and returns None. "safe files" will not be pruned, including the ansible configuration and inventory used by this scenario, the scenario state file, and files declared as "safe_files" in the ``driver`` configuration declared in ``molecule.yml...
[ "Prune", "the", "scenario", "ephemeral", "directory", "files", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/scenario.py#L98-L124
train
Prune the scenario ephemeral directory files and returns None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/scenario.py
Scenario.sequence
def sequence(self): """ Select the sequence based on scenario and subcommand of the provided scenario object and returns a list. :param scenario: A scenario object. :param skipped: An optional bool to include skipped scenarios. :return: list """ s = scena...
python
def sequence(self): """ Select the sequence based on scenario and subcommand of the provided scenario object and returns a list. :param scenario: A scenario object. :param skipped: An optional bool to include skipped scenarios. :return: list """ s = scena...
[ "def", "sequence", "(", "self", ")", ":", "s", "=", "scenarios", ".", "Scenarios", "(", "[", "self", ".", "config", "]", ")", "matrix", "=", "s", ".", "_get_matrix", "(", ")", "try", ":", "return", "matrix", "[", "self", ".", "name", "]", "[", "s...
Select the sequence based on scenario and subcommand of the provided scenario object and returns a list. :param scenario: A scenario object. :param skipped: An optional bool to include skipped scenarios. :return: list
[ "Select", "the", "sequence", "based", "on", "scenario", "and", "subcommand", "of", "the", "provided", "scenario", "object", "and", "returns", "a", "list", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/scenario.py#L201-L217
train
Select the sequence based on the provided scenario and subcommand of the provided scenario object and returns a 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...
ansible/molecule
molecule/scenario.py
Scenario._setup
def _setup(self): """ Prepare the scenario for Molecule and returns None. :return: None """ if not os.path.isdir(self.inventory_directory): os.makedirs(self.inventory_directory)
python
def _setup(self): """ Prepare the scenario for Molecule and returns None. :return: None """ if not os.path.isdir(self.inventory_directory): os.makedirs(self.inventory_directory)
[ "def", "_setup", "(", "self", ")", ":", "if", "not", "os", ".", "path", ".", "isdir", "(", "self", ".", "inventory_directory", ")", ":", "os", ".", "makedirs", "(", "self", ".", "inventory_directory", ")" ]
Prepare the scenario for Molecule and returns None. :return: None
[ "Prepare", "the", "scenario", "for", "Molecule", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/scenario.py#L219-L226
train
Prepare the scenario for Molecule and returns None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/command/list.py
list
def list(ctx, scenario_name, format): # pragma: no cover """ Lists status of instances. """ args = ctx.obj.get('args') subcommand = base._get_subcommand(__name__) command_args = { 'subcommand': subcommand, 'format': format, } statuses = [] s = scenarios.Scenarios( b...
python
def list(ctx, scenario_name, format): # pragma: no cover """ Lists status of instances. """ args = ctx.obj.get('args') subcommand = base._get_subcommand(__name__) command_args = { 'subcommand': subcommand, 'format': format, } statuses = [] s = scenarios.Scenarios( b...
[ "def", "list", "(", "ctx", ",", "scenario_name", ",", "format", ")", ":", "# pragma: no cover", "args", "=", "ctx", ".", "obj", ".", "get", "(", "'args'", ")", "subcommand", "=", "base", ".", "_get_subcommand", "(", "__name__", ")", "command_args", "=", ...
Lists status of instances.
[ "Lists", "status", "of", "instances", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/command/list.py#L100-L123
train
Lists status of instances.
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...
ansible/molecule
molecule/command/list.py
_print_tabulate_data
def _print_tabulate_data(headers, data, table_format): # pragma: no cover """ Shows the tabulate data on the screen and returns None. :param headers: A list of column headers. :param data: A list of tabular data to display. :returns: None """ print(tabulate.tabulate(data, headers, tablefm...
python
def _print_tabulate_data(headers, data, table_format): # pragma: no cover """ Shows the tabulate data on the screen and returns None. :param headers: A list of column headers. :param data: A list of tabular data to display. :returns: None """ print(tabulate.tabulate(data, headers, tablefm...
[ "def", "_print_tabulate_data", "(", "headers", ",", "data", ",", "table_format", ")", ":", "# pragma: no cover", "print", "(", "tabulate", ".", "tabulate", "(", "data", ",", "headers", ",", "tablefmt", "=", "table_format", ")", ")" ]
Shows the tabulate data on the screen and returns None. :param headers: A list of column headers. :param data: A list of tabular data to display. :returns: None
[ "Shows", "the", "tabulate", "data", "on", "the", "screen", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/command/list.py#L126-L134
train
Print the tabulate data on the screen and returns None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ansible/molecule
molecule/command/init/role.py
role
def role(ctx, dependency_name, driver_name, lint_name, provisioner_name, role_name, verifier_name, template): # pragma: no cover """ Initialize a new role for use with Molecule. """ command_args = { 'dependency_name': dependency_name, 'driver_name': driver_name, 'lint_name': li...
python
def role(ctx, dependency_name, driver_name, lint_name, provisioner_name, role_name, verifier_name, template): # pragma: no cover """ Initialize a new role for use with Molecule. """ command_args = { 'dependency_name': dependency_name, 'driver_name': driver_name, 'lint_name': li...
[ "def", "role", "(", "ctx", ",", "dependency_name", ",", "driver_name", ",", "lint_name", ",", "provisioner_name", ",", "role_name", ",", "verifier_name", ",", "template", ")", ":", "# pragma: no cover", "command_args", "=", "{", "'dependency_name'", ":", "dependen...
Initialize a new role for use with Molecule.
[ "Initialize", "a", "new", "role", "for", "use", "with", "Molecule", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/command/init/role.py#L133-L160
train
Initialize a new role for use with Molecule.
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...
ansible/molecule
molecule/command/init/role.py
Role.execute
def execute(self): """ Execute the actions necessary to perform a `molecule init role` and returns None. :return: None """ role_name = self._command_args['role_name'] role_directory = os.getcwd() msg = 'Initializing new role {}...'.format(role_name) ...
python
def execute(self): """ Execute the actions necessary to perform a `molecule init role` and returns None. :return: None """ role_name = self._command_args['role_name'] role_directory = os.getcwd() msg = 'Initializing new role {}...'.format(role_name) ...
[ "def", "execute", "(", "self", ")", ":", "role_name", "=", "self", ".", "_command_args", "[", "'role_name'", "]", "role_directory", "=", "os", ".", "getcwd", "(", ")", "msg", "=", "'Initializing new role {}...'", ".", "format", "(", "role_name", ")", "LOG", ...
Execute the actions necessary to perform a `molecule init role` and returns None. :return: None
[ "Execute", "the", "actions", "necessary", "to", "perform", "a", "molecule", "init", "role", "and", "returns", "None", "." ]
766dc35b0b0ce498cd5e3a62b40f828742d0d08c
https://github.com/ansible/molecule/blob/766dc35b0b0ce498cd5e3a62b40f828742d0d08c/molecule/command/init/role.py#L56-L93
train
Execute the actions necessary to perform a molecule init role and return None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
byt3bl33d3r/CrackMapExec
cme/protocols/mssql/database.py
database.add_computer
def add_computer(self, ip, hostname, domain, os, instances): """ Check if this host has already been added to the database, if not add it in. """ cur = self.conn.cursor() cur.execute('SELECT * FROM computers WHERE ip LIKE ?', [ip]) results = cur.fetchall() if no...
python
def add_computer(self, ip, hostname, domain, os, instances): """ Check if this host has already been added to the database, if not add it in. """ cur = self.conn.cursor() cur.execute('SELECT * FROM computers WHERE ip LIKE ?', [ip]) results = cur.fetchall() if no...
[ "def", "add_computer", "(", "self", ",", "ip", ",", "hostname", ",", "domain", ",", "os", ",", "instances", ")", ":", "cur", "=", "self", ".", "conn", ".", "cursor", "(", ")", "cur", ".", "execute", "(", "'SELECT * FROM computers WHERE ip LIKE ?'", ",", ...
Check if this host has already been added to the database, if not add it in.
[ "Check", "if", "this", "host", "has", "already", "been", "added", "to", "the", "database", "if", "not", "add", "it", "in", "." ]
333f1c4e06884e85b2776459963ef85d182aba8e
https://github.com/byt3bl33d3r/CrackMapExec/blob/333f1c4e06884e85b2776459963ef85d182aba8e/cme/protocols/mssql/database.py#L35-L47
train
Add a computer to the database if it does not already exist.
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...
byt3bl33d3r/CrackMapExec
cme/protocols/mssql/database.py
database.remove_credentials
def remove_credentials(self, credIDs): """ Removes a credential ID from the database """ for credID in credIDs: cur = self.conn.cursor() cur.execute("DELETE FROM users WHERE id=?", [credID]) cur.close()
python
def remove_credentials(self, credIDs): """ Removes a credential ID from the database """ for credID in credIDs: cur = self.conn.cursor() cur.execute("DELETE FROM users WHERE id=?", [credID]) cur.close()
[ "def", "remove_credentials", "(", "self", ",", "credIDs", ")", ":", "for", "credID", "in", "credIDs", ":", "cur", "=", "self", ".", "conn", ".", "cursor", "(", ")", "cur", ".", "execute", "(", "\"DELETE FROM users WHERE id=?\"", ",", "[", "credID", "]", ...
Removes a credential ID from the database
[ "Removes", "a", "credential", "ID", "from", "the", "database" ]
333f1c4e06884e85b2776459963ef85d182aba8e
https://github.com/byt3bl33d3r/CrackMapExec/blob/333f1c4e06884e85b2776459963ef85d182aba8e/cme/protocols/mssql/database.py#L63-L70
train
Removes a credential ID from the database.
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...
byt3bl33d3r/CrackMapExec
cme/modules/web_delivery.py
CMEModule.options
def options(self, context, module_options): ''' URL URL for the download cradle ''' if not 'URL' in module_options: context.log.error('URL option is required!') exit(1) self.url = module_options['URL']
python
def options(self, context, module_options): ''' URL URL for the download cradle ''' if not 'URL' in module_options: context.log.error('URL option is required!') exit(1) self.url = module_options['URL']
[ "def", "options", "(", "self", ",", "context", ",", "module_options", ")", ":", "if", "not", "'URL'", "in", "module_options", ":", "context", ".", "log", ".", "error", "(", "'URL option is required!'", ")", "exit", "(", "1", ")", "self", ".", "url", "=",...
URL URL for the download cradle
[ "URL", "URL", "for", "the", "download", "cradle" ]
333f1c4e06884e85b2776459963ef85d182aba8e
https://github.com/byt3bl33d3r/CrackMapExec/blob/333f1c4e06884e85b2776459963ef85d182aba8e/cme/modules/web_delivery.py#L18-L27
train
Set the URL for the download cradle.
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...
byt3bl33d3r/CrackMapExec
cme/modules/slinky.py
CMEModule.options
def options(self, context, module_options): ''' SERVER IP of the SMB server NAME LNK file name CLEANUP Cleanup (choices: True or False) ''' self.cleanup = False if 'CLEANUP' in module_options: self.cleanup = bool(module_options[...
python
def options(self, context, module_options): ''' SERVER IP of the SMB server NAME LNK file name CLEANUP Cleanup (choices: True or False) ''' self.cleanup = False if 'CLEANUP' in module_options: self.cleanup = bool(module_options[...
[ "def", "options", "(", "self", ",", "context", ",", "module_options", ")", ":", "self", ".", "cleanup", "=", "False", "if", "'CLEANUP'", "in", "module_options", ":", "self", ".", "cleanup", "=", "bool", "(", "module_options", "[", "'CLEANUP'", "]", ")", ...
SERVER IP of the SMB server NAME LNK file name CLEANUP Cleanup (choices: True or False)
[ "SERVER", "IP", "of", "the", "SMB", "server", "NAME", "LNK", "file", "name", "CLEANUP", "Cleanup", "(", "choices", ":", "True", "or", "False", ")" ]
333f1c4e06884e85b2776459963ef85d182aba8e
https://github.com/byt3bl33d3r/CrackMapExec/blob/333f1c4e06884e85b2776459963ef85d182aba8e/cme/modules/slinky.py#L18-L46
train
This function is called when the module is loaded from the command line.
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...
byt3bl33d3r/CrackMapExec
cme/modules/mimikatz.py
CMEModule.options
def options(self, context, module_options): ''' COMMAND Mimikatz command to execute (default: 'sekurlsa::logonpasswords') ''' self.command = 'privilege::debug sekurlsa::logonpasswords exit' if module_options and 'COMMAND' in module_options: self.command = module_o...
python
def options(self, context, module_options): ''' COMMAND Mimikatz command to execute (default: 'sekurlsa::logonpasswords') ''' self.command = 'privilege::debug sekurlsa::logonpasswords exit' if module_options and 'COMMAND' in module_options: self.command = module_o...
[ "def", "options", "(", "self", ",", "context", ",", "module_options", ")", ":", "self", ".", "command", "=", "'privilege::debug sekurlsa::logonpasswords exit'", "if", "module_options", "and", "'COMMAND'", "in", "module_options", ":", "self", ".", "command", "=", "...
COMMAND Mimikatz command to execute (default: 'sekurlsa::logonpasswords')
[ "COMMAND", "Mimikatz", "command", "to", "execute", "(", "default", ":", "sekurlsa", "::", "logonpasswords", ")" ]
333f1c4e06884e85b2776459963ef85d182aba8e
https://github.com/byt3bl33d3r/CrackMapExec/blob/333f1c4e06884e85b2776459963ef85d182aba8e/cme/modules/mimikatz.py#L20-L28
train
Set options for the Mimikatz process
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
byt3bl33d3r/CrackMapExec
cme/modules/mimikatz.py
CMEModule.uniquify_tuples
def uniquify_tuples(self, tuples): """ uniquify mimikatz tuples based on the password cred format- (credType, domain, username, password, hostname, sid) Stolen from the Empire project. """ seen = set() return [item for item in tuples if "{}{}{}{}".format(item[0],...
python
def uniquify_tuples(self, tuples): """ uniquify mimikatz tuples based on the password cred format- (credType, domain, username, password, hostname, sid) Stolen from the Empire project. """ seen = set() return [item for item in tuples if "{}{}{}{}".format(item[0],...
[ "def", "uniquify_tuples", "(", "self", ",", "tuples", ")", ":", "seen", "=", "set", "(", ")", "return", "[", "item", "for", "item", "in", "tuples", "if", "\"{}{}{}{}\"", ".", "format", "(", "item", "[", "0", "]", ",", "item", "[", "1", "]", ",", ...
uniquify mimikatz tuples based on the password cred format- (credType, domain, username, password, hostname, sid) Stolen from the Empire project.
[ "uniquify", "mimikatz", "tuples", "based", "on", "the", "password", "cred", "format", "-", "(", "credType", "domain", "username", "password", "hostname", "sid", ")" ]
333f1c4e06884e85b2776459963ef85d182aba8e
https://github.com/byt3bl33d3r/CrackMapExec/blob/333f1c4e06884e85b2776459963ef85d182aba8e/cme/modules/mimikatz.py#L48-L56
train
Uniquify mimikatz tuples based on the password cred format - credType domain username password hostname sid
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...
byt3bl33d3r/CrackMapExec
cme/modules/mimikatz.py
CMEModule.parse_mimikatz
def parse_mimikatz(self, data): """ Parse the output from Invoke-Mimikatz to return credential sets. This was directly stolen from the Empire project as well. """ # cred format: # credType, domain, username, password, hostname, sid creds = [] # regexe...
python
def parse_mimikatz(self, data): """ Parse the output from Invoke-Mimikatz to return credential sets. This was directly stolen from the Empire project as well. """ # cred format: # credType, domain, username, password, hostname, sid creds = [] # regexe...
[ "def", "parse_mimikatz", "(", "self", ",", "data", ")", ":", "# cred format:", "# credType, domain, username, password, hostname, sid", "creds", "=", "[", "]", "# regexes for \"sekurlsa::logonpasswords\" Mimikatz output", "regexes", "=", "[", "\"(?s)(?<=msv :).*?(?=tspkg :)\"",...
Parse the output from Invoke-Mimikatz to return credential sets. This was directly stolen from the Empire project as well.
[ "Parse", "the", "output", "from", "Invoke", "-", "Mimikatz", "to", "return", "credential", "sets", "." ]
333f1c4e06884e85b2776459963ef85d182aba8e
https://github.com/byt3bl33d3r/CrackMapExec/blob/333f1c4e06884e85b2776459963ef85d182aba8e/cme/modules/mimikatz.py#L58-L179
train
Parse the output from Invoke - Mimikatz to return credential sets.
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...
byt3bl33d3r/CrackMapExec
cme/modules/invoke_vnc.py
CMEModule.options
def options(self, context, module_options): ''' CONTYPE Specifies the VNC connection type, choices are: reverse, bind (default: reverse). PORT VNC Port (default: 5900) PASSWORD Specifies the connection password. ''' self.contype = 'reverse' self.port = 59...
python
def options(self, context, module_options): ''' CONTYPE Specifies the VNC connection type, choices are: reverse, bind (default: reverse). PORT VNC Port (default: 5900) PASSWORD Specifies the connection password. ''' self.contype = 'reverse' self.port = 59...
[ "def", "options", "(", "self", ",", "context", ",", "module_options", ")", ":", "self", ".", "contype", "=", "'reverse'", "self", ".", "port", "=", "5900", "self", ".", "password", "=", "None", "if", "'PASSWORD'", "not", "in", "module_options", ":", "con...
CONTYPE Specifies the VNC connection type, choices are: reverse, bind (default: reverse). PORT VNC Port (default: 5900) PASSWORD Specifies the connection password.
[ "CONTYPE", "Specifies", "the", "VNC", "connection", "type", "choices", "are", ":", "reverse", "bind", "(", "default", ":", "reverse", ")", ".", "PORT", "VNC", "Port", "(", "default", ":", "5900", ")", "PASSWORD", "Specifies", "the", "connection", "password",...
333f1c4e06884e85b2776459963ef85d182aba8e
https://github.com/byt3bl33d3r/CrackMapExec/blob/333f1c4e06884e85b2776459963ef85d182aba8e/cme/modules/invoke_vnc.py#L15-L39
train
Set the options for the VNC connection.
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...
byt3bl33d3r/CrackMapExec
cme/protocols/smb/database.py
database.add_computer
def add_computer(self, ip, hostname, domain, os, dc=None): """ Check if this host has already been added to the database, if not add it in. """ domain = domain.split('.')[0].upper() cur = self.conn.cursor() cur.execute('SELECT * FROM computers WHERE ip LIKE ?', [ip]) ...
python
def add_computer(self, ip, hostname, domain, os, dc=None): """ Check if this host has already been added to the database, if not add it in. """ domain = domain.split('.')[0].upper() cur = self.conn.cursor() cur.execute('SELECT * FROM computers WHERE ip LIKE ?', [ip]) ...
[ "def", "add_computer", "(", "self", ",", "ip", ",", "hostname", ",", "domain", ",", "os", ",", "dc", "=", "None", ")", ":", "domain", "=", "domain", ".", "split", "(", "'.'", ")", "[", "0", "]", ".", "upper", "(", ")", "cur", "=", "self", ".", ...
Check if this host has already been added to the database, if not add it in.
[ "Check", "if", "this", "host", "has", "already", "been", "added", "to", "the", "database", "if", "not", "add", "it", "in", "." ]
333f1c4e06884e85b2776459963ef85d182aba8e
https://github.com/byt3bl33d3r/CrackMapExec/blob/333f1c4e06884e85b2776459963ef85d182aba8e/cme/protocols/smb/database.py#L87-L108
train
Add a computer to the database.
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...
byt3bl33d3r/CrackMapExec
cme/protocols/smb/database.py
database.add_credential
def add_credential(self, credtype, domain, username, password, groupid=None, pillaged_from=None): """ Check if this credential has already been added to the database, if not add it in. """ domain = domain.split('.')[0].upper() user_rowid = None cur = self.conn.cursor() ...
python
def add_credential(self, credtype, domain, username, password, groupid=None, pillaged_from=None): """ Check if this credential has already been added to the database, if not add it in. """ domain = domain.split('.')[0].upper() user_rowid = None cur = self.conn.cursor() ...
[ "def", "add_credential", "(", "self", ",", "credtype", ",", "domain", ",", "username", ",", "password", ",", "groupid", "=", "None", ",", "pillaged_from", "=", "None", ")", ":", "domain", "=", "domain", ".", "split", "(", "'.'", ")", "[", "0", "]", "...
Check if this credential has already been added to the database, if not add it in.
[ "Check", "if", "this", "credential", "has", "already", "been", "added", "to", "the", "database", "if", "not", "add", "it", "in", "." ]
333f1c4e06884e85b2776459963ef85d182aba8e
https://github.com/byt3bl33d3r/CrackMapExec/blob/333f1c4e06884e85b2776459963ef85d182aba8e/cme/protocols/smb/database.py#L110-L147
train
Add a credential to the database.
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...
byt3bl33d3r/CrackMapExec
cme/protocols/smb/database.py
database.is_user_valid
def is_user_valid(self, userID): """ Check if this User ID is valid. """ cur = self.conn.cursor() cur.execute('SELECT * FROM users WHERE id=? LIMIT 1', [userID]) results = cur.fetchall() cur.close() return len(results) > 0
python
def is_user_valid(self, userID): """ Check if this User ID is valid. """ cur = self.conn.cursor() cur.execute('SELECT * FROM users WHERE id=? LIMIT 1', [userID]) results = cur.fetchall() cur.close() return len(results) > 0
[ "def", "is_user_valid", "(", "self", ",", "userID", ")", ":", "cur", "=", "self", ".", "conn", ".", "cursor", "(", ")", "cur", ".", "execute", "(", "'SELECT * FROM users WHERE id=? LIMIT 1'", ",", "[", "userID", "]", ")", "results", "=", "cur", ".", "fet...
Check if this User ID is valid.
[ "Check", "if", "this", "User", "ID", "is", "valid", "." ]
333f1c4e06884e85b2776459963ef85d182aba8e
https://github.com/byt3bl33d3r/CrackMapExec/blob/333f1c4e06884e85b2776459963ef85d182aba8e/cme/protocols/smb/database.py#L346-L354
train
Check if this User ID is valid.
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...
byt3bl33d3r/CrackMapExec
cme/protocols/smb/database.py
database.get_computers
def get_computers(self, filterTerm=None, domain=None): """ Return hosts from the database. """ cur = self.conn.cursor() # if we're returning a single host by ID if self.is_computer_valid(filterTerm): cur.execute("SELECT * FROM computers WHERE id=? LIMIT 1", ...
python
def get_computers(self, filterTerm=None, domain=None): """ Return hosts from the database. """ cur = self.conn.cursor() # if we're returning a single host by ID if self.is_computer_valid(filterTerm): cur.execute("SELECT * FROM computers WHERE id=? LIMIT 1", ...
[ "def", "get_computers", "(", "self", ",", "filterTerm", "=", "None", ",", "domain", "=", "None", ")", ":", "cur", "=", "self", ".", "conn", ".", "cursor", "(", ")", "# if we're returning a single host by ID", "if", "self", ".", "is_computer_valid", "(", "fil...
Return hosts from the database.
[ "Return", "hosts", "from", "the", "database", "." ]
333f1c4e06884e85b2776459963ef85d182aba8e
https://github.com/byt3bl33d3r/CrackMapExec/blob/333f1c4e06884e85b2776459963ef85d182aba8e/cme/protocols/smb/database.py#L384-L412
train
Return hosts from the database.
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...
byt3bl33d3r/CrackMapExec
cme/protocols/smb/database.py
database.is_group_valid
def is_group_valid(self, groupID): """ Check if this group ID is valid. """ cur = self.conn.cursor() cur.execute('SELECT * FROM groups WHERE id=? LIMIT 1', [groupID]) results = cur.fetchall() cur.close() logging.debug('is_group_valid(groupID={}) => {}'.fo...
python
def is_group_valid(self, groupID): """ Check if this group ID is valid. """ cur = self.conn.cursor() cur.execute('SELECT * FROM groups WHERE id=? LIMIT 1', [groupID]) results = cur.fetchall() cur.close() logging.debug('is_group_valid(groupID={}) => {}'.fo...
[ "def", "is_group_valid", "(", "self", ",", "groupID", ")", ":", "cur", "=", "self", ".", "conn", ".", "cursor", "(", ")", "cur", ".", "execute", "(", "'SELECT * FROM groups WHERE id=? LIMIT 1'", ",", "[", "groupID", "]", ")", "results", "=", "cur", ".", ...
Check if this group ID is valid.
[ "Check", "if", "this", "group", "ID", "is", "valid", "." ]
333f1c4e06884e85b2776459963ef85d182aba8e
https://github.com/byt3bl33d3r/CrackMapExec/blob/333f1c4e06884e85b2776459963ef85d182aba8e/cme/protocols/smb/database.py#L417-L427
train
Check if this group ID is valid.
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...
byt3bl33d3r/CrackMapExec
cme/protocols/smb/database.py
database.get_groups
def get_groups(self, filterTerm=None, groupName=None, groupDomain=None): """ Return groups from the database """ if groupDomain: groupDomain = groupDomain.split('.')[0].upper() cur = self.conn.cursor() if self.is_group_valid(filterTerm): cur.exec...
python
def get_groups(self, filterTerm=None, groupName=None, groupDomain=None): """ Return groups from the database """ if groupDomain: groupDomain = groupDomain.split('.')[0].upper() cur = self.conn.cursor() if self.is_group_valid(filterTerm): cur.exec...
[ "def", "get_groups", "(", "self", ",", "filterTerm", "=", "None", ",", "groupName", "=", "None", ",", "groupDomain", "=", "None", ")", ":", "if", "groupDomain", ":", "groupDomain", "=", "groupDomain", ".", "split", "(", "'.'", ")", "[", "0", "]", ".", ...
Return groups from the database
[ "Return", "groups", "from", "the", "database" ]
333f1c4e06884e85b2776459963ef85d182aba8e
https://github.com/byt3bl33d3r/CrackMapExec/blob/333f1c4e06884e85b2776459963ef85d182aba8e/cme/protocols/smb/database.py#L429-L453
train
Get groups from the database.
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...
byt3bl33d3r/CrackMapExec
cme/protocols/http/database.py
database.add_credential
def add_credential(self, url, username, password): """ Check if this credential has already been added to the database, if not add it in. """ cur = self.conn.cursor() cur.execute("SELECT * FROM credentials WHERE LOWER(username)=LOWER(?) AND password=?", [url, username, password]...
python
def add_credential(self, url, username, password): """ Check if this credential has already been added to the database, if not add it in. """ cur = self.conn.cursor() cur.execute("SELECT * FROM credentials WHERE LOWER(username)=LOWER(?) AND password=?", [url, username, password]...
[ "def", "add_credential", "(", "self", ",", "url", ",", "username", ",", "password", ")", ":", "cur", "=", "self", ".", "conn", ".", "cursor", "(", ")", "cur", ".", "execute", "(", "\"SELECT * FROM credentials WHERE LOWER(username)=LOWER(?) AND password=?\"", ",", ...
Check if this credential has already been added to the database, if not add it in.
[ "Check", "if", "this", "credential", "has", "already", "been", "added", "to", "the", "database", "if", "not", "add", "it", "in", "." ]
333f1c4e06884e85b2776459963ef85d182aba8e
https://github.com/byt3bl33d3r/CrackMapExec/blob/333f1c4e06884e85b2776459963ef85d182aba8e/cme/protocols/http/database.py#L24-L36
train
Add a credential to the database.
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...
byt3bl33d3r/CrackMapExec
cme/protocols/http/database.py
database.is_credential_valid
def is_credential_valid(self, credentialID): """ Check if this credential ID is valid. """ cur = self.conn.cursor() cur.execute('SELECT * FROM credentials WHERE id=? LIMIT 1', [credentialID]) results = cur.fetchall() cur.close() return len(results) > 0
python
def is_credential_valid(self, credentialID): """ Check if this credential ID is valid. """ cur = self.conn.cursor() cur.execute('SELECT * FROM credentials WHERE id=? LIMIT 1', [credentialID]) results = cur.fetchall() cur.close() return len(results) > 0
[ "def", "is_credential_valid", "(", "self", ",", "credentialID", ")", ":", "cur", "=", "self", ".", "conn", ".", "cursor", "(", ")", "cur", ".", "execute", "(", "'SELECT * FROM credentials WHERE id=? LIMIT 1'", ",", "[", "credentialID", "]", ")", "results", "="...
Check if this credential ID is valid.
[ "Check", "if", "this", "credential", "ID", "is", "valid", "." ]
333f1c4e06884e85b2776459963ef85d182aba8e
https://github.com/byt3bl33d3r/CrackMapExec/blob/333f1c4e06884e85b2776459963ef85d182aba8e/cme/protocols/http/database.py#L49-L57
train
Check if this credential ID is valid.
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...