Skip to content

Commit f49fe51

Browse files
committed
bump to 0.9.1
1 parent 03cdaa6 commit f49fe51

File tree

7 files changed

+38
-32
lines changed

7 files changed

+38
-32
lines changed

docs/norfab_changelog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 0.9.1
2+
3+
### BUGS
4+
5+
1. Fixing list and dict annotations to also allow None values for workers tasks.
6+
7+
---
18

29
## 0.9.0
310

norfab/core/inventory.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
"""
2-
Simple Local Inventory is an inventory plugin to load
2+
Simple Local Inventory is an inventory plugin to load
33
inventory data from locally stored files.
44
55
Sample inventory file
66
77
```yaml
88
broker:
99
endpoint: "tcp://127.0.0.1:5555"
10-
10+
1111
logging:
1212
handlers:
1313
terminal:
1414
level: CRITICAL
15-
file:
15+
file:
1616
level: DEBUG
1717
1818
workers:
1919
nornir-*:
20-
- nornir/common.yaml
20+
- nornir/common.yaml
2121
nornir-worker-1:
2222
- nornir/nornir-worker-1.yaml
23-
23+
2424
topology:
2525
broker: True
2626
workers:
@@ -34,7 +34,7 @@
3434
broker_endpoint: "tcp://127.0.0.1:5555"
3535
runner:
3636
plugin: RetryRunner
37-
options:
37+
options:
3838
num_workers: 100
3939
num_connectors: 10
4040
connect_retry: 3
@@ -50,7 +50,7 @@
5050
and `nornir/nornir-worker-1.yaml` contains
5151
5252
```yaml
53-
hosts:
53+
hosts:
5454
csr1000v-1:
5555
hostname: sandbox-1.lab.com
5656
platform: cisco_ios
@@ -66,7 +66,7 @@
6666
```
6767
6868
Whenever inventory queried to provide data for worker with name `nornir-worker-1`
69-
Simple Inventory iterates over `workers` dictionary and recursively merges
69+
Simple Inventory iterates over `workers` dictionary and recursively merges
7070
data for keys (glob patterns) that matched worker name.
7171
"""
7272

norfab/workers/containerlab_worker.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def run_containerlab_command(
174174
cwd: str = None,
175175
timeout: int = None,
176176
ret: Result = None,
177-
env: dict = None,
177+
env: Union[None, dict] = None,
178178
) -> Tuple:
179179
"""
180180
Executes a containerlab command using subprocess and processes its output.
@@ -533,7 +533,7 @@ def get_nornir_inventory(
533533
job: Job,
534534
lab_name: Union[None, str] = None,
535535
timeout: int = None,
536-
groups: list = None,
536+
groups: Union[None, list] = None,
537537
use_default_credentials: bool = True,
538538
) -> Result:
539539
"""
@@ -666,8 +666,8 @@ def deploy_netbox(
666666
job: Job,
667667
lab_name: str = None,
668668
tenant: str = None,
669-
filters: list = None,
670-
devices: list = None,
669+
filters: Union[None, list] = None,
670+
devices: Union[None, list] = None,
671671
instance: str = None,
672672
image: str = None,
673673
ipv4_subnet: str = "172.100.100.0/24",

norfab/workers/netbox_worker.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
# ----------------------------------------------------------------------
2929

3030

31-
def _form_query_v4(obj, filters, fields, alias=None):
31+
def _form_query_v4(obj, filters, fields, alias=None) -> str:
3232
"""
3333
Helper function to form graphql query for Netbox version 4.
3434
@@ -61,7 +61,7 @@ def _form_query_v4(obj, filters, fields, alias=None):
6161
return query
6262

6363

64-
def _form_query_v3(obj, filters, fields, alias=None):
64+
def _form_query_v3(obj, filters, fields, alias=None) -> str:
6565
"""
6666
Helper function to form graphql query for Netbox version 3.
6767
@@ -579,9 +579,9 @@ def graphql(
579579
instance: Union[None, str] = None,
580580
dry_run: bool = False,
581581
obj: Union[str, dict] = None,
582-
filters: dict = None,
583-
fields: list = None,
584-
queries: dict = None,
582+
filters: Union[None, dict] = None,
583+
fields: Union[None, list] = None,
584+
queries: Union[None, dict] = None,
585585
query_string: str = None,
586586
) -> Result:
587587
"""
@@ -731,10 +731,10 @@ def rest(
731731
def get_devices(
732732
self,
733733
job: Job,
734-
filters: list = None,
734+
filters: Union[None, list] = None,
735735
instance: Union[None, str] = None,
736736
dry_run: bool = False,
737-
devices: list = None,
737+
devices: Union[None, list] = None,
738738
cache: Union[bool, str] = None,
739739
) -> Result:
740740
"""
@@ -907,7 +907,7 @@ def get_interfaces(
907907
self,
908908
job: Job,
909909
instance: Union[None, str] = None,
910-
devices: list = None,
910+
devices: Union[None, list] = None,
911911
ip_addresses: bool = False,
912912
inventory_items: bool = False,
913913
dry_run: bool = False,
@@ -1383,7 +1383,7 @@ def get_circuits(
13831383
self,
13841384
job: Job,
13851385
devices: list,
1386-
cid: list = None,
1386+
cid: Union[None, list] = None,
13871387
instance: Union[None, str] = None,
13881388
dry_run: bool = False,
13891389
cache: Union[bool, str] = True,
@@ -1574,8 +1574,8 @@ def get_circuits(
15741574
def get_nornir_inventory(
15751575
self,
15761576
job: Job,
1577-
filters: list = None,
1578-
devices: list = None,
1577+
filters: Union[None, list] = None,
1578+
devices: Union[None, list] = None,
15791579
instance: Union[None, str] = None,
15801580
interfaces: Union[dict, bool] = False,
15811581
connections: Union[dict, bool] = False,
@@ -1738,7 +1738,7 @@ def update_device_facts(
17381738
dry_run: bool = False,
17391739
datasource: str = "nornir",
17401740
timeout: int = 60,
1741-
devices: list = None,
1741+
devices: Union[None, list] = None,
17421742
batch_size: int = 10,
17431743
**kwargs,
17441744
) -> Result:
@@ -1845,7 +1845,7 @@ def update_device_interfaces(
18451845
dry_run: bool = False,
18461846
datasource: str = "nornir",
18471847
timeout: int = 60,
1848-
devices: list = None,
1848+
devices: Union[None, list] = None,
18491849
create: bool = True,
18501850
batch_size: int = 10,
18511851
**kwargs,
@@ -2053,7 +2053,7 @@ def update_device_ip(
20532053
dry_run: bool = False,
20542054
datasource: str = "nornir",
20552055
timeout: int = 60,
2056-
devices: list = None,
2056+
devices: Union[None, list] = None,
20572057
create: bool = True,
20582058
batch_size: int = 10,
20592059
**kwargs,
@@ -2198,7 +2198,7 @@ def get_next_ip(
21982198
device: str = None,
21992199
interface: str = None,
22002200
vrf: str = None,
2201-
tags: list = None,
2201+
tags: Union[None, list] = None,
22022202
dns_name: str = None,
22032203
tenant: str = None,
22042204
comments: str = None,
@@ -2241,12 +2241,12 @@ def get_containerlab_inventory(
22412241
lab_name: str = None,
22422242
tenant: Union[None, str] = None,
22432243
filters: Union[None, list] = None,
2244-
devices: list = None,
2244+
devices: Union[None, list] = None,
22452245
instance: Union[None, str] = None,
22462246
image: Union[None, str] = None,
22472247
ipv4_subnet: str = "172.100.100.0/24",
22482248
ports: tuple = (12000, 15000),
2249-
ports_map: dict = None,
2249+
ports_map: Union[None, dict] = None,
22502250
progress: bool = False,
22512251
cache: Union[bool, str] = False,
22522252
) -> Result:

norfab/workers/nornir_worker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ def nornir_inventory_load_containerlab(
523523
self,
524524
job: Job,
525525
lab_name: str = None,
526-
groups: list = None,
526+
groups: Union[None, list] = None,
527527
clab_workers: str = "all",
528528
use_default_credentials: bool = True,
529529
progress: bool = False,

poetry.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "norfab"
33

44
[tool.poetry]
55
name = "norfab"
6-
version = "0.9.0"
6+
version = "0.9.1"
77
description = "Network Automations Fabric [NorFab] - communication networks automations"
88
authors = ["Denis Mulyalin <d.mulyalin@gmail.com>"]
99
maintainers = ["Denis Mulyalin <d.mulyalin@gmail.com>"]

0 commit comments

Comments
 (0)