Skip to content

Commit 6cd4e38

Browse files
authored
Extend cisco_ios set_boot_options method (#311)
* Extend cisco_ios set_boot_options method * Fix test * refresh poetry.lock * black, pylint + fix test (setup, teardown) deprecated methods.
1 parent d72c53b commit 6cd4e38

File tree

15 files changed

+666
-573
lines changed

15 files changed

+666
-573
lines changed

poetry.lock

Lines changed: 645 additions & 566 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyntc/devices/asa_device.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def _get_ipv4_addresses(self, host: str) -> Dict[str, List[IPv4Address]]:
156156
elif host == "peer":
157157
command = "failover exec mate show ip address"
158158

159-
show_ip_address = self.show(command)
159+
show_ip_address = self.show(command) # pylint: disable=possibly-used-before-assignment
160160
re_ip_addresses = RE_SHOW_IP_ADDRESS.findall(show_ip_address)
161161

162162
results = {
@@ -188,7 +188,7 @@ def _get_ipv6_addresses(self, host: str) -> Dict[str, List[IPv6Address]]:
188188
elif host == "peer":
189189
command = "failover exec mate show ipv6 interface"
190190

191-
show_ipv6_interface = self.show(command)
191+
show_ipv6_interface = self.show(command) # pylint: disable=possibly-used-before-assignment
192192
show_ipv6_interface_lines: List[str] = show_ipv6_interface.strip().splitlines()
193193
first_line = show_ipv6_interface_lines.pop(0)
194194
interface: str = first_line.split()[0]

pyntc/devices/ios_device.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,6 +1029,11 @@ def set_boot_options(self, image_name, **vendor_specifics):
10291029
): # TODO: Update to CommandError when deprecating config_list
10301030
command = f"boot system switch all {file_system}{image_name}"
10311031
self.config(["no boot system", command])
1032+
1033+
# If boot system is not found in the running config, but it exists in show boot or show bootvar
1034+
elif self.boot_options["sys"]:
1035+
command = f"boot system {file_system}/{image_name}"
1036+
self.config(command)
10321037
else:
10331038
raise CommandError(
10341039
command=command,

pyntc/devices/iosxewlc_device.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Module for using a Cisco IOSXE WLC device over SSH."""
2+
23
import time
34

45
from pyntc import log

pyntc/devices/jnpr_device.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Module for using a Juniper junOS device."""
2+
23
import hashlib
34
import os
45
import re

pyntc/devices/nxos_device.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Module for using an NXOS device over NX-API."""
2+
23
import os
34
import re
45
import time

pyntc/devices/system_features/vlans/base_vlans.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Base Vlan checks."""
2+
23
from pyntc.errors import NTCError
34

45
from ..base_feature import BaseFeature

pyntc/errors.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""pyntc custom exceptions."""
2+
23
import warnings
34

45

pyntc/log.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Logging utilities for Pyntc."""
2+
23
import os
34
import logging
45

pyntc/utils/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""PyNTC Utilities."""
2+
23
from .templates import get_structured_data
34
from .converters import convert_dict_by_key, convert_list_by_key, recursive_key_lookup
45

0 commit comments

Comments
 (0)