From 656a1174c4ff49dad4cb6f289eb71633e2c9dd6a Mon Sep 17 00:00:00 2001 From: c-bordon Date: Tue, 23 Apr 2024 16:38:22 -0300 Subject: [PATCH] Added random assignment for IP address for Vagrant local deployment --- deployability/modules/allocation/vagrant/provider.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/deployability/modules/allocation/vagrant/provider.py b/deployability/modules/allocation/vagrant/provider.py index d08f5f9d3b..38f64678e1 100644 --- a/deployability/modules/allocation/vagrant/provider.py +++ b/deployability/modules/allocation/vagrant/provider.py @@ -6,6 +6,7 @@ import platform, json import subprocess import boto3 +import random from jinja2 import Environment, FileSystemLoader from pathlib import Path @@ -244,8 +245,8 @@ def check_ip(ip): if response != 0: return ip - for i in range(2, 254): - ip = f"192.168.57.{i}" + for i in range(254): + ip = f"192.168.57.{random.randint(2, 253)}" if check_ip(ip): return ip