collection 교체

This commit is contained in:
정훈 변
2024-02-23 16:37:40 +09:00
parent b494779b5b
commit 3fd554eee9
38862 changed files with 220204 additions and 6600073 deletions

View File

@@ -1,24 +1,11 @@
#
# (c) 2017 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
#
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = """
@@ -43,17 +30,14 @@ options:
import json
from ansible.module_utils._text import to_text
from ansible_collections.ansible.netcommon.plugins.plugin_utils.netconf_base import (
NetconfBase,
)
from ansible_collections.ansible.netcommon.plugins.plugin_utils.netconf_base import NetconfBase
class Netconf(NetconfBase):
def get_text(self, ele, tag):
try:
return to_text(
ele.find(tag).text, errors="surrogate_then_replace"
).strip()
return to_text(ele.find(tag).text, errors="surrogate_then_replace").strip()
except AttributeError:
pass
@@ -70,7 +54,5 @@ class Netconf(NetconfBase):
result["server_capabilities"] = list(self.m.server_capabilities)
result["client_capabilities"] = list(self.m.client_capabilities)
result["session_id"] = self.m.session_id
result["device_operations"] = self.get_device_operations(
result["server_capabilities"]
)
result["device_operations"] = self.get_device_operations(result["server_capabilities"])
return json.dumps(result)