-
Notifications
You must be signed in to change notification settings - Fork 41
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
Fix i6pn main address being None (typo) #2351
Conversation
@prbot approve |
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.
Please request a reviewer to follow up with a post-merge review.
@prbot approve |
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.
Approved 👍. @thundergolfer will follow-up review this.
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.
LGTM, doh!
@@ -159,7 +159,7 @@ def wrapper(*args, **kwargs): | |||
|
|||
def get_i6pn(): | |||
"""Returns the ipv6 address assigned to this container.""" | |||
socket.getaddrinfo("i6pn.modal.local", None, socket.AF_INET6)[0][4][0] | |||
return socket.getaddrinfo("i6pn.modal.local", None, socket.AF_INET6)[0][4][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.
[0][4][0]
is very confusing to me. Could you create named variables? :)
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.
I think there was some discussion here about this. Personally I agree with Eric that [0][4][0]
is something that can just be black-boxed (which was sort of the goal of the get_i6pn()
function -- readers just need to know that the function returns the ipv6 address and don't need to know how it's done).
I'm open to other ideas though! In particular, I don't even know what to name the variables if I were to make each one a variable.
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.
Got it. Magic incantations without comments will likely trigger questions from every unfamiliar reader. Imo it's either "literate programming" or adding comments to the source.
I forgot to add a
return
statement.This wasn't caught in code review because I made the change after the PR was approved and somehow didn't catch the error myself :(
e2e tests failed on the main Modal repo, which is how I noticed this issue.