Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added random assignment for IP address for Vagrant local deployment #5288

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions deployability/modules/allocation/vagrant/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import platform, json
import subprocess
import boto3
import random

from jinja2 import Environment, FileSystemLoader
from pathlib import Path
Expand Down Expand Up @@ -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

Expand Down