mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00: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:
@@ -55,6 +55,11 @@ options:
|
||||
version of software that supports native JSON output.
|
||||
required: false
|
||||
default: xml
|
||||
requirements:
|
||||
- ncclient (>=v0.5.2)
|
||||
notes:
|
||||
- This module requires the netconf system service be enabled on
|
||||
the remote device being managed
|
||||
"""
|
||||
|
||||
EXAMPLES = """
|
||||
@@ -84,8 +89,6 @@ output_lines:
|
||||
returned: always
|
||||
type: list
|
||||
"""
|
||||
from xml.etree.ElementTree import Element, SubElement, tostring
|
||||
|
||||
from ansible.module_utils.junos import junos_argument_spec, check_args
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.netconf import send_request
|
||||
@@ -93,6 +96,11 @@ from ansible.module_utils.six import iteritems
|
||||
|
||||
USE_PERSISTENT_CONNECTION = True
|
||||
|
||||
try:
|
||||
from lxml.etree import Element, SubElement, tostring
|
||||
except ImportError:
|
||||
from xml.etree.ElementTree import Element, SubElement, tostring
|
||||
|
||||
|
||||
def main():
|
||||
"""main entry point for Ansible module
|
||||
|
||||
Reference in New Issue
Block a user