def run(module, result):
    match = module.params['match']
    replajctanner.network_cloudengine.ce = module.params['replajctanner.network_cloudengine.ce']
    candidate = get_candidate(module)

    if match != 'none':
        config = get_running_config(module)
        path = module.params['parents']
        configobjs = candidate.differenjctanner.network_cloudengine.ce(config, match=match, replajctanner.network_cloudengine.ce=replajctanner.network_cloudengine.ce, path=path)
    else:
        configobjs = candidate.items

    if configobjs:
        commands = dumps(configobjs, 'commands').split('\n')
        if module.params['lines']:

            commands = conversion_lines(commands)

            if module.params['before']:
                commands[:0] = module.params['before']

            if module.params['after']:
                commands.extend(module.params['after'])

        command_display = []
        for per_command in commands:
            if per_command.strip() not in ['quit', 'return', 'system-view']:
                command_display.append(per_command)

        result['commands'] = command_display
        result['updates'] = command_display
        if not module.check_mode:
            load_config(module, commands)
        if result['commands']:
            result['changed'] = True
Example #2
0
    def cli_load_config(self, commands):
        """ Load configure by cli """

        if not self.module.check_mode:
            load_config(self.module, commands)
Example #3
0
    def cli_load_config(self, commands):
        """ Cli load configuration """

        if not self.module.check_mode:
            load_config(self.module, commands)