* [Flent-users] Re: [tohojo/flent] runners: Bracket IPv6 addresses before passing to irtt (#239)
2021-09-29 12:32 [Flent-users] [tohojo/flent] runners: Bracket IPv6 addresses before passing to irtt (#239) Pete Heist
@ 2021-09-29 21:51 ` Toke Høiland-Jørgensen
2021-09-30 6:38 ` Pete Heist
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Toke Høiland-Jørgensen @ 2021-09-29 21:51 UTC (permalink / raw)
To: tohojo/flent; +Cc: Subscribed
[-- Attachment #1: Type: text/plain, Size: 824 bytes --]
@tohojo requested changes on this pull request.
> @@ -1682,7 +1683,13 @@ def check(self):
if self.ip_version is not None:
args.append("-{}".format(self.ip_version))
- args.append(self.host)
+ try:
+ ipaddress.IPv6Address(self.host)
+ host = "[{}]".format(self.host)
+ except ValueError:
+ host = self.host
Using the ipaddress module for parsing is fine, but let's move this into the normalise_host() utility function. Simply adding a second argument 'bracket_v6' which defaults to 'False' to that should do the trick :)
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/tohojo/flent/pull/239#pullrequestreview-767221497
[-- Attachment #2: Type: text/html, Size: 2285 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Flent-users] Re: [tohojo/flent] runners: Bracket IPv6 addresses before passing to irtt (#239)
2021-09-29 12:32 [Flent-users] [tohojo/flent] runners: Bracket IPv6 addresses before passing to irtt (#239) Pete Heist
2021-09-29 21:51 ` [Flent-users] " Toke Høiland-Jørgensen
@ 2021-09-30 6:38 ` Pete Heist
2021-09-30 6:40 ` Pete Heist
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Pete Heist @ 2021-09-30 6:38 UTC (permalink / raw)
To: tohojo/flent; +Cc: Push
[-- Attachment #1: Type: text/plain, Size: 347 bytes --]
@heistp pushed 1 commit.
7d7a6ac0c5aeef4206d6d43afe735d92adeb18bc util: Add optional bracket_v6 parameter to normalise_host
--
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/tohojo/flent/pull/239/files/1ac5b086854e5b0fe8a6b944b12aa03aa5ed0257..7d7a6ac0c5aeef4206d6d43afe735d92adeb18bc
[-- Attachment #2: Type: text/html, Size: 1967 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Flent-users] Re: [tohojo/flent] runners: Bracket IPv6 addresses before passing to irtt (#239)
2021-09-29 12:32 [Flent-users] [tohojo/flent] runners: Bracket IPv6 addresses before passing to irtt (#239) Pete Heist
2021-09-29 21:51 ` [Flent-users] " Toke Høiland-Jørgensen
2021-09-30 6:38 ` Pete Heist
@ 2021-09-30 6:40 ` Pete Heist
2021-09-30 7:12 ` Pete Heist
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Pete Heist @ 2021-09-30 6:40 UTC (permalink / raw)
To: tohojo/flent; +Cc: Subscribed
[-- Attachment #1: Type: text/plain, Size: 656 bytes --]
@heistp commented on this pull request.
> @@ -1682,7 +1683,13 @@ def check(self):
if self.ip_version is not None:
args.append("-{}".format(self.ip_version))
- args.append(self.host)
+ try:
+ ipaddress.IPv6Address(self.host)
+ host = "[{}]".format(self.host)
+ except ValueError:
+ host = self.host
Ah, I didn't notice that, that's a much better solution. :)
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/tohojo/flent/pull/239#discussion_r719101580
[-- Attachment #2: Type: text/html, Size: 2105 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Flent-users] Re: [tohojo/flent] runners: Bracket IPv6 addresses before passing to irtt (#239)
2021-09-29 12:32 [Flent-users] [tohojo/flent] runners: Bracket IPv6 addresses before passing to irtt (#239) Pete Heist
` (2 preceding siblings ...)
2021-09-30 6:40 ` Pete Heist
@ 2021-09-30 7:12 ` Pete Heist
2021-09-30 7:15 ` Pete Heist
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Pete Heist @ 2021-09-30 7:12 UTC (permalink / raw)
To: tohojo/flent; +Cc: Push
[-- Attachment #1: Type: text/plain, Size: 344 bytes --]
@heistp pushed 1 commit.
d4f2adf4663fdef1781413b4392d18edd9cc47d8 irtt: pass bracket_v6 as an explicitly named parameter
--
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/tohojo/flent/pull/239/files/7d7a6ac0c5aeef4206d6d43afe735d92adeb18bc..d4f2adf4663fdef1781413b4392d18edd9cc47d8
[-- Attachment #2: Type: text/html, Size: 1964 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Flent-users] Re: [tohojo/flent] runners: Bracket IPv6 addresses before passing to irtt (#239)
2021-09-29 12:32 [Flent-users] [tohojo/flent] runners: Bracket IPv6 addresses before passing to irtt (#239) Pete Heist
` (3 preceding siblings ...)
2021-09-30 7:12 ` Pete Heist
@ 2021-09-30 7:15 ` Pete Heist
2021-09-30 11:12 ` Toke Høiland-Jørgensen
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Pete Heist @ 2021-09-30 7:15 UTC (permalink / raw)
To: tohojo/flent; +Cc: Subscribed
[-- Attachment #1: Type: text/plain, Size: 955 bytes --]
@heistp commented on this pull request.
> @@ -1682,7 +1683,13 @@ def check(self):
if self.ip_version is not None:
args.append("-{}".format(self.ip_version))
- args.append(self.host)
+ try:
+ ipaddress.IPv6Address(self.host)
+ host = "[{}]".format(self.host)
+ except ValueError:
+ host = self.host
It just occurred to me that when adding optional parameters, it might be good practice to specify them by name in calls to those functions, so I updated that. I don't know what normal python practice is. I guess as long as the parameter positions don't change it's not critical, but this might also make it more apparent what you're doing in the call itself.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/tohojo/flent/pull/239#discussion_r719123312
[-- Attachment #2: Type: text/html, Size: 2404 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Flent-users] Re: [tohojo/flent] runners: Bracket IPv6 addresses before passing to irtt (#239)
2021-09-29 12:32 [Flent-users] [tohojo/flent] runners: Bracket IPv6 addresses before passing to irtt (#239) Pete Heist
` (4 preceding siblings ...)
2021-09-30 7:15 ` Pete Heist
@ 2021-09-30 11:12 ` Toke Høiland-Jørgensen
2021-09-30 13:27 ` Pete Heist
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Toke Høiland-Jørgensen @ 2021-09-30 11:12 UTC (permalink / raw)
To: tohojo/flent; +Cc: Subscribed
[-- Attachment #1: Type: text/plain, Size: 300 bytes --]
@tohojo approved this pull request.
LGTM, but could you please squash the changes into a single commit? :)
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/tohojo/flent/pull/239#pullrequestreview-767718801
[-- Attachment #2: Type: text/html, Size: 1597 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Flent-users] Re: [tohojo/flent] runners: Bracket IPv6 addresses before passing to irtt (#239)
2021-09-29 12:32 [Flent-users] [tohojo/flent] runners: Bracket IPv6 addresses before passing to irtt (#239) Pete Heist
` (5 preceding siblings ...)
2021-09-30 11:12 ` Toke Høiland-Jørgensen
@ 2021-09-30 13:27 ` Pete Heist
2021-09-30 13:56 ` Toke Høiland-Jørgensen
2021-09-30 13:59 ` Toke Høiland-Jørgensen
8 siblings, 0 replies; 10+ messages in thread
From: Pete Heist @ 2021-09-30 13:27 UTC (permalink / raw)
To: tohojo/flent; +Cc: Subscribed
[-- Attachment #1: Type: text/plain, Size: 312 bytes --]
> LGTM, but could you please squash the changes into a single commit? :)
Squashed and force pushed, so hopefully that's fine.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/tohojo/flent/pull/239#issuecomment-931322575
[-- Attachment #2: Type: text/html, Size: 1610 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Flent-users] Re: [tohojo/flent] runners: Bracket IPv6 addresses before passing to irtt (#239)
2021-09-29 12:32 [Flent-users] [tohojo/flent] runners: Bracket IPv6 addresses before passing to irtt (#239) Pete Heist
` (6 preceding siblings ...)
2021-09-30 13:27 ` Pete Heist
@ 2021-09-30 13:56 ` Toke Høiland-Jørgensen
2021-09-30 13:59 ` Toke Høiland-Jørgensen
8 siblings, 0 replies; 10+ messages in thread
From: Toke Høiland-Jørgensen @ 2021-09-30 13:56 UTC (permalink / raw)
To: tohojo/flent; +Cc: Subscribed
[-- Attachment #1: Type: text/plain, Size: 204 bytes --]
Merged #239 into master.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/tohojo/flent/pull/239#event-5387927802
[-- Attachment #2: Type: text/html, Size: 1812 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Flent-users] Re: [tohojo/flent] runners: Bracket IPv6 addresses before passing to irtt (#239)
2021-09-29 12:32 [Flent-users] [tohojo/flent] runners: Bracket IPv6 addresses before passing to irtt (#239) Pete Heist
` (7 preceding siblings ...)
2021-09-30 13:56 ` Toke Høiland-Jørgensen
@ 2021-09-30 13:59 ` Toke Høiland-Jørgensen
8 siblings, 0 replies; 10+ messages in thread
From: Toke Høiland-Jørgensen @ 2021-09-30 13:59 UTC (permalink / raw)
To: tohojo/flent; +Cc: Subscribed
[-- Attachment #1: Type: text/plain, Size: 206 bytes --]
Awesome - thanks! :)
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/tohojo/flent/pull/239#issuecomment-931348708
[-- Attachment #2: Type: text/html, Size: 1473 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread