-
Notifications
You must be signed in to change notification settings - Fork 16
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
Fixes #18180: Make rtf handle network hostonly uniqueness #254
Fixes #18180: Make rtf handle network hostonly uniqueness #254
Conversation
lib/platform.py
Outdated
# update promises on the whole chain | ||
relays.append(server) | ||
relays.reverse() | ||
for h in relays: | ||
h.run("rudder agent run -u", quiet=False, live_output=True, fail_exit=fail_exit) | ||
host.run("rudder agent run -ui", quiet=False, live_output=True, fail_exit=fail_exit) | ||
|
||
def pf_id_to_network(self, pf_id): | ||
# Since the mask is always 255.255.255.0 this is reasonable | ||
return ("192.168.%s.0"%(pf_id), "255.255.255.0") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the base network can be defines in the Vagrantfile, so you shouldn't hardcode 192.168. here an the mask is also in the Vagrantfile (see $NETWORK)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use $NERWORK
PR updated with a new commit |
lib/platform.py
Outdated
base_subnet = "192.168.0.0/24" | ||
with open("Vagrantfile", "r+") as fd: | ||
for line in fd: | ||
m = re.match("^\$NETWORK=[\'\"](.*)[\'\"]", line) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\s* are needed around =
lib/platform.py
Outdated
print("Taking base network %s"%m.group(1)) | ||
base_subnet = m.group(1) | ||
subnet = ipaddress.ip_network(base_subnet) | ||
return (str(subnet.network_address + 256*pf_id), str(subnet.netmask)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
256 should be replaces by 2**(32-subnet.prefixlen)
PR updated with a new commit |
1 similar comment
PR updated with a new commit |
OK, squash merging this PR |
d806b7a
to
4ff36c9
Compare
https://issues.rudder.io/issues/18180