RFC4173_TARGET_REGEX = re.compile(r'''^
- (?P<host>[^@]*): # greedy so ipv6 IPs are matched
+ (?P<host>[^@:]*): # greedy so ipv6 IPs are matched
(?P<proto>[^:]*):
(?P<port>[^:]*):
(?P<lun>[^:]*):
But will break it for IPv6. I think the IPv6 matching will need to be improved to require the IP address to be wrapped in '[', ']'. The target name is allowed to have ':' and its actual quite common.
Since MAAS discovers already composed machines in RSD with ISCSI, target names without ':' cannot be enforced so this must be supported.
This patch fixes the issue with IPv4:
=== modified file 'curtin/ block/iscsi. py' block/iscsi. py 2017-02-18 00:33:38 +0000 block/iscsi. py 2017-04-03 15:54:03 +0000
--- curtin/
+++ curtin/
@@ -37,7 +37,7 @@
''', re.VERBOSE)
RFC4173_ TARGET_ REGEX = re.compile(r'''^ P<proto> [^:]*): P<port> [^:]*): P<lun>[ ^:]*):
- (?P<host>[^@]*): # greedy so ipv6 IPs are matched
+ (?P<host>[^@:]*): # greedy so ipv6 IPs are matched
(?
(?
(?
But will break it for IPv6. I think the IPv6 matching will need to be improved to require the IP address to be wrapped in '[', ']'. The target name is allowed to have ':' and its actual quite common.
Since MAAS discovers already composed machines in RSD with ISCSI, target names without ':' cannot be enforced so this must be supported.