diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2020-12-07 21:06:38 -0600 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2020-12-07 21:06:38 -0600 |
commit | 0f5425767964262062a6ef3791e9c797c653ef36 (patch) | |
tree | 1584e887458f82e5028b16c58d913e5d27302066 /ncserver | |
parent | 40bef71eb9d32c786b333bd75217a4367da3dd01 (diff) | |
download | netconfapk-0f5425767964262062a6ef3791e9c797c653ef36.tar.gz netconfapk-0f5425767964262062a6ef3791e9c797c653ef36.tar.bz2 netconfapk-0f5425767964262062a6ef3791e9c797c653ef36.tar.xz netconfapk-0f5425767964262062a6ef3791e9c797c653ef36.zip |
ietf-interfaces: Simplyify logic a bit
Since we process the <NAME/> tag already, just remove it from the
interface node entirely. This means we don't have to 'filter' on it
later in the for loop, saving cycles during iteration.
Diffstat (limited to 'ncserver')
-rw-r--r-- | ncserver/module/interfaces.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/ncserver/module/interfaces.py b/ncserver/module/interfaces.py index 62aa91c..299a000 100644 --- a/ncserver/module/interfaces.py +++ b/ncserver/module/interfaces.py @@ -14,7 +14,7 @@ import logging import pathlib import subprocess -from lxml import etree +from lxml.etree import QName # pylint: disable=E0611 from netconf import error, util from ncserver.base.log import log_config_change @@ -23,9 +23,6 @@ from ncserver.base.util import _, node_operation, yang_dt_for_timestamp from ncserver.util import maybe_raise_on_invalid_node -QName = etree.QName # pylint: disable=I1101 - - LOGGER = logging.getLogger(__name__) """The object used for logging informational messages.""" @@ -303,6 +300,7 @@ def edit(session, rpc, node, def_op): if name_node is None: raise error.MissingElementAppError(rpc, interface) iface = name_node.text + interface.remove(name_node) operation = node_operation(interface, def_op) if operation in ('create', 'delete', 'remove'): @@ -329,7 +327,5 @@ def edit(session, rpc, node, def_op): name = QName(candidate.tag).localname if name in methods: methods[name](session, rpc, candidate, operation, iface) - elif name == 'name': - continue else: maybe_raise_on_invalid_node(M_NS, rpc, candidate) |