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:
Ganesh Nalawade
2017-06-22 09:34:50 +05:30
committed by GitHub
parent dd07d11ae5
commit b2f46753ec
29 changed files with 1075 additions and 96 deletions

View File

@@ -59,9 +59,13 @@ options:
default: text
choices: ['xml', 'set', 'text', 'json']
version_added: "2.3"
requirements:
- ncclient (>=v0.5.2)
notes:
- Ensure I(config_format) used to retrieve configuration from device
is supported by junos version running on device.
- This module requires the netconf system service be enabled on
the remote device being managed
"""
EXAMPLES = """
@@ -79,16 +83,18 @@ ansible_facts:
returned: always
type: dict
"""
from xml.etree.ElementTree import Element, SubElement, tostring
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.pycompat24 import get_exception
from ansible.module_utils.six import iteritems
from ansible.module_utils.junos import junos_argument_spec, check_args, get_param
from ansible.module_utils.junos import command, get_configuration
from ansible.module_utils.junos import get_configuration
from ansible.module_utils.netconf import send_request
try:
from lxml.etree import Element, SubElement, tostring
except ImportError:
from xml.etree.ElementTree import Element, SubElement, tostring
try:
from jnpr.junos import Device
from jnpr.junos.exception import ConnectError