Skip to content

Commit a25c884

Browse files
Fix condition with usage_type and stitch provider (#89)
* Fix issues with usage_type and stitch provider * Replace DEFAULT_NETWORK With Network Name
1 parent 3ff8f3d commit a25c884

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

chi/lease.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,13 +1069,13 @@ def add_network_reservation(
10691069

10701070
if physical_network:
10711071
extra_constraints.append(["==", "$physical_network", physical_network])
1072-
if stitch_provider and stitch_provider != "fabric":
1072+
if stitch_provider == "fabric":
10731073
extra_constraints.append(["==", "$stitch_provider", stitch_provider])
1074-
else:
1074+
elif stitch_provider is not None:
10751075
raise CHIValueError("stitch_provider must be 'fabric' or None")
1076-
if usage_type and usage_type != "storage":
1076+
if usage_type == "storage":
10771077
extra_constraints.append(["==", "$usage_type", usage_type])
1078-
else:
1078+
elif usage_type is not None:
10791079
raise CHIValueError("usage_type must be 'storage' or None")
10801080

10811081
resource_properties = _format_resource_properties(

chi/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def submit(
191191
image=self.image_name,
192192
flavor=self.flavor_name,
193193
key=self.keypair.name,
194-
net_ids=[chi_network.get_network_id(DEFAULT_NETWORK)],
194+
net_ids=[chi_network.get_network_id(self.network_name)],
195195
**kwargs,
196196
)
197197

0 commit comments

Comments
 (0)