Skip to content

Commit 40a9473

Browse files
committed
Add check for sg/subnet existance in config and patch privateipsource
1 parent c5b07f5 commit 40a9473

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

cloudendure/cloudendure.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -491,9 +491,12 @@ def update_blueprint(self) -> bool:
491491
)
492492
blueprint["disks"] = new_disks
493493

494-
# Update launch subnets and SG IDs
495-
blueprint["subnetIDs"] = [self.subnet_id]
496-
blueprint["securityGroupIDs"] = [self.security_group_id]
494+
if self.subnet_id:
495+
# Update launch subnets and SG IDs
496+
blueprint["subnetIDs"] = [self.subnet_id]
497+
blueprint["privateIPAction"] = "CREATE_NEW"
498+
if self.security_group_id:
499+
blueprint["securityGroupIDs"] = [self.security_group_id]
497500

498501
# Update machine tags
499502
blueprint["tags"] = [

0 commit comments

Comments
 (0)