|
24 | 24 | ) |
25 | 25 |
|
26 | 26 |
|
27 | | -RE_FILENAME_FIND_VERSION = re.compile(r"^\S+?-[A-Za-z]{2}\d+-(?:\S+-?)?(?:K9-)?(?P<version>\d+-\d+-\d+-\d+)", re.M) |
| 27 | +RE_FILENAME_FIND_VERSION = re.compile(r"^.+?(?P<version>\d+(?:-|_)\d+(?:-|_)\d+(?:-|_)\d+)\.", re.M) |
28 | 28 | RE_AP_IMAGE_COUNT = re.compile(r"^[Tt]otal\s+number\s+of\s+APs\.+\s+(?P<count>\d+)\s*$", re.M) |
29 | 29 | RE_AP_IMAGE_DOWNLOADED = re.compile(r"^\s*[Cc]ompleted\s+[Pp]redownloading\.+\s+(?P<downloaded>\d+)\s*$", re.M) |
30 | 30 | RE_AP_IMAGE_UNSUPPORTED = re.compile(r"^\s*[Nn]ot\s+[Ss]upported\.+\s+(?P<unsupported>\d+)\s*$", re.M) |
@@ -58,7 +58,7 @@ def convert_filename_to_version(filename): |
58 | 58 | """ |
59 | 59 | version_match = RE_FILENAME_FIND_VERSION.match(filename) |
60 | 60 | version_string = version_match.groupdict()["version"] |
61 | | - version = version_string.replace("-", ".") |
| 61 | + version = re.sub("-|_", ".", version_string) |
62 | 62 | return version |
63 | 63 |
|
64 | 64 |
|
@@ -97,17 +97,17 @@ def _ap_images_match_expected(self, image_option, image, ap_boot_options=None): |
97 | 97 | Args: |
98 | 98 | image_option (str): The boot_option dict key ("primary", "backup") to validate. |
99 | 99 | image (str): The image that the ``image_option`` should match. |
100 | | - ap_boot_options (dict): The results from |
| 100 | + ap_boot_options (dict): The results from ``self.ap_boot_options``. |
101 | 101 |
|
102 | 102 | Returns: |
103 | 103 | bool: True if all APs have ``image_option`` equal to ``image``, else False. |
104 | 104 |
|
105 | 105 | Example: |
106 | 106 | >>> device = AIREOSDevice(**connection_args) |
107 | | - >>> device.ap_boot_options() |
| 107 | + >>> device.ap_boot_options |
108 | 108 | { |
109 | | - 'ap1': {'primary': {'8.10.105.0', 'secondary': '8.10.103.0'}, |
110 | | - 'ap2': {'primary': {'8.10.105.0', 'secondary': '8.10.103.0'}, |
| 109 | + 'ap1': {'primary': '8.10.105.0', 'secondary': '8.10.103.0'}, |
| 110 | + 'ap2': {'primary': '8.10.105.0', 'secondary': '8.10.103.0'}, |
111 | 111 | } |
112 | 112 | >>> device._ap_images_match_expected("primary", "8.10.105.0") |
113 | 113 | True |
|
0 commit comments