mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 04:40:22 -07:00
Add junos_system declartive module and other related change (#25859)
* Add junos_system declartive module and other related change * junos_system declartive module * integration test for junos_system * integration test for net_system (junos platform) * pep8 fixes for junos modules * move to lxml from elementree for xml parsing as it support complete set of xpath api's * other minor changes * Fix CI and doc changes * Fix unit test failures * Fix typo in import * Fix import issue for py2.6 * Add missed Element in import
This commit is contained in:
parent
dd07d11ae5
commit
b2f46753ec
29 changed files with 1075 additions and 96 deletions
|
@ -105,11 +105,13 @@ def map_obj_to_commands(updates, module):
|
|||
|
||||
return commands
|
||||
|
||||
|
||||
def parse_port(config):
|
||||
match = re.search(r'port (\d+)', config)
|
||||
if match:
|
||||
return int(match.group(1))
|
||||
|
||||
|
||||
def map_config_to_obj(module):
|
||||
cmd = 'show configuration system services netconf'
|
||||
rc, out, err = exec_command(module, cmd)
|
||||
|
@ -130,6 +132,7 @@ def validate_netconf_port(value, module):
|
|||
if not 1 <= value <= 65535:
|
||||
module.fail_json(msg='netconf_port must be between 1 and 65535')
|
||||
|
||||
|
||||
def map_params_to_obj(module):
|
||||
obj = {
|
||||
'netconf_port': module.params['netconf_port'],
|
||||
|
@ -144,6 +147,7 @@ def map_params_to_obj(module):
|
|||
|
||||
return obj
|
||||
|
||||
|
||||
def load_config(module, config, commit=False):
|
||||
|
||||
exec_command(module, 'configure')
|
||||
|
@ -164,6 +168,7 @@ def load_config(module, config, commit=False):
|
|||
|
||||
return str(diff).strip()
|
||||
|
||||
|
||||
def main():
|
||||
"""main entry point for module execution
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue