nbforager 0.1.14__py3-none-any.whl → 0.1.15__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,11 +2,12 @@
2
2
 
3
3
  """NbCustom."""
4
4
  import re
5
+ import string
5
6
 
6
7
  from vhelpers import vlist, vre
7
8
 
8
9
  from nbforager.branch.nb_value import NbValue, RE_PREFIX
9
- from nbforager.types_ import SStr, T2Str
10
+ from nbforager.types_ import SStr, T2Str, LStr
10
11
 
11
12
 
12
13
  class NbCustom(NbValue):
@@ -36,7 +37,12 @@ class NbCustom(NbValue):
36
37
  self.strict = True
37
38
  _ = self.is_dcim("devices")
38
39
  _ = self.primary_ip4()
39
- device_type = super().platform_slug()
40
+ device_type = self.str("platform", "name")
41
+ required: str = string.ascii_lowercase + "_-"
42
+ chars_invalid: LStr = [s for s in device_type if s not in required]
43
+ if chars_invalid:
44
+ device_type = super().platform_slug()
45
+ device_type = device_type.replace("-", "_")
40
46
  self.strict = strict_actual
41
47
  return device_type
42
48
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nbforager
3
- Version: 0.1.14
3
+ Version: 0.1.15
4
4
  Summary: Python package designed to assist in working with the Netbox REST API. The filter parameters are identical to those in the Web UI filter form. It replaces brief data with full information, and Netbox objects are represented as a recursive multidimensional dictionary.
5
5
  Home-page: https://github.com/vladimirs-git/nbforager
6
6
  License: Apache-2.0
@@ -25,7 +25,7 @@ Requires-Dist: requests (>=2,<3)
25
25
  Requires-Dist: tomli (==2.0.1)
26
26
  Requires-Dist: vhelpers (>=0.1,<0.2)
27
27
  Project-URL: Bug Tracker, https://github.com/vladimirs-git/nbforager/issues
28
- Project-URL: Download URL, https://github.com/vladimirs-git/nbforager/archive/refs/tags/0.1.14.tar.gz
28
+ Project-URL: Download URL, https://github.com/vladimirs-git/nbforager/archive/refs/tags/0.1.15.tar.gz
29
29
  Project-URL: Repository, https://github.com/vladimirs-git/nbforager
30
30
  Description-Content-Type: text/x-rst
31
31
 
@@ -18,7 +18,7 @@ nbforager/api/virtualization.py,sha256=72Di0Z-NHtGqkXgslp6X9DqGcVq7GSxQSw84ElqZ4
18
18
  nbforager/api/wireless.py,sha256=mz6xgnAzPhyqbw68ZjQgqZSE33DpXFfvhMt4iWn4YpA,782
19
19
  nbforager/branch/__init__.py,sha256=FmfEtNWzIei1Bym3gA6H7A7Aw2ppoSwe1tn9yWpe2hA,15
20
20
  nbforager/branch/nb_branch.py,sha256=Wvg_dFwcX1wFOeYpXLeqjc5GeVIpHLV8s-guwSCEEmU,8717
21
- nbforager/branch/nb_custom.py,sha256=6Ghwcpv8v0yiY-nN2ruD8QkIQW3j_rqD0v9zMdbgbPg,3888
21
+ nbforager/branch/nb_custom.py,sha256=gT6Qj-k293DWo0_IJO8YTssH9nu1FGhaj1exJ5JD3E4,4177
22
22
  nbforager/branch/nb_value.py,sha256=9U4bOM9Dc-2eVomq8rUoNM1sn7RAYpnG5yj0_x-9Fvs,9533
23
23
  nbforager/exceptions.py,sha256=kA3Ji3mZjx3tLyqTmZVKwkQrfnV86rOGdiQE-YdW6nc,175
24
24
  nbforager/foragers/__init__.py,sha256=ToOyJ-Jw8-mdFbg-8BfrTWohKLZRTkdqoP-w6QcKzLs,17
@@ -45,6 +45,6 @@ nbforager/nb_tree.py,sha256=fQFH5aLThk-Lwph_DXwc0tjUdrCDPrPFmc0pPTySjaw,10914
45
45
  nbforager/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
46
46
  nbforager/types_.py,sha256=gfmzdiCuPvtznvtmHRvbZJHxSH5gbP3NLWDQJTXX0ng,1726
47
47
  nbforager/wrappers.py,sha256=J-pkT5siqhGd8tWtfRcyI6GfDxY0ufGztNDleahK-b8,736
48
- nbforager-0.1.14.dist-info/METADATA,sha256=5xco-qZr-mlDnYNfsRf1nbINumR3ZGgtGjVsRx3NkmQ,8603
49
- nbforager-0.1.14.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
50
- nbforager-0.1.14.dist-info/RECORD,,
48
+ nbforager-0.1.15.dist-info/METADATA,sha256=AHVfd_OoGrfaYjNALw8RNgmr8b-VZzZADx4UcNT2MPw,8603
49
+ nbforager-0.1.15.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
50
+ nbforager-0.1.15.dist-info/RECORD,,