summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGanesh Nalawade <ganesh634@gmail.com>2017-04-27 13:35:21 +0530
committerGitHub <noreply@github.com>2017-04-27 13:35:21 +0530
commit43c39c0e92d0f006ba32805f787ddf58fa293ef4 (patch)
tree2a6fd1c83b253377e03ae4a5a7a6c1c95b05a879
parent7d710882a8103436d11f84da90bbac3e8d195399 (diff)
downloadansible-revert-24049-junos_config_expection_issue.tar.gz
Revert "Fix exception issue in junos_config (#24049)"revert-24049-junos_config_expection_issue
This reverts commit 7d710882a8103436d11f84da90bbac3e8d195399.
-rw-r--r--lib/ansible/modules/network/junos/junos_config.py9
1 files changed, 1 insertions, 8 deletions
diff --git a/lib/ansible/modules/network/junos/junos_config.py b/lib/ansible/modules/network/junos/junos_config.py
index a335e1e318..9f49e14d38 100644
--- a/lib/ansible/modules/network/junos/junos_config.py
+++ b/lib/ansible/modules/network/junos/junos_config.py
@@ -185,7 +185,6 @@ backup_path:
"""
import re
import json
-import sys
from xml.etree import ElementTree
@@ -196,12 +195,6 @@ from ansible.module_utils.junos import check_args as junos_check_args
from ansible.module_utils.netconf import send_request
from ansible.module_utils.six import string_types
-if sys.version < (2, 7):
- from xml.parsers.expat import ExpatError
- ParseError = ExpatError
-else:
- ParseError = ElementTree.ParseError
-
USE_PERSISTENT_CONNECTION = True
DEFAULT_COMMENT = 'configured by junos_config'
@@ -224,7 +217,7 @@ def guess_format(config):
try:
ElementTree.fromstring(config)
return 'xml'
- except ParseError:
+ except ElementTree.ParseError:
pass
if config.startswith('set') or config.startswith('delete'):