You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datalab.apache.org by lf...@apache.org on 2021/04/06 14:40:54 UTC

[incubator-datalab] 02/05: [DATALAB-2091]: fixed subnet creation error

This is an automated email from the ASF dual-hosted git repository.

lfrolov pushed a commit to branch DATALAB-2091
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git

commit d43aaf18e7f0540faf02c8139e06e024da381d20
Author: leonidfrolov <fr...@gmail.com>
AuthorDate: Tue Apr 6 16:56:17 2021 +0300

    [DATALAB-2091]: fixed subnet creation error
---
 .../src/general/scripts/aws/common_create_subnet.py                   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/infrastructure-provisioning/src/general/scripts/aws/common_create_subnet.py b/infrastructure-provisioning/src/general/scripts/aws/common_create_subnet.py
index 47df768..80cffb8 100644
--- a/infrastructure-provisioning/src/general/scripts/aws/common_create_subnet.py
+++ b/infrastructure-provisioning/src/general/scripts/aws/common_create_subnet.py
@@ -52,7 +52,7 @@ if __name__ == "__main__":
             private_subnet_size = ipaddress.ip_network(u'0.0.0.0/{}'.format(args.prefix)).num_addresses
             vpc = ec2.Vpc(args.vpc_id)
             vpc_cidr = vpc.cidr_block
-            first_vpc_ip = int(ipaddress.IPv4Address(vpc_cidr.split('/')[0].decode("utf-8")))
+            first_vpc_ip = int(ipaddress.IPv4Address(vpc_cidr.split('/')[0]))
             subnets = list(vpc.subnets.all())
             subnets_cidr = []
             for subnet in subnets:
@@ -68,7 +68,7 @@ if __name__ == "__main__":
             last_ip = first_vpc_ip
             previous_subnet_size = private_subnet_size
             for cidr in sorted_subnets_cidr:
-                first_ip = int(ipaddress.IPv4Address(cidr.split('/')[0].decode("utf-8")))
+                first_ip = int(ipaddress.IPv4Address(cidr.split('/')[0]))
                 if first_ip - last_ip < private_subnet_size or previous_subnet_size < private_subnet_size:
                     subnet_size = ipaddress.ip_network(u'{}'.format(cidr)).num_addresses
                     last_ip = first_ip + subnet_size - 1

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datalab.apache.org
For additional commands, e-mail: commits-help@datalab.apache.org