Comment 1 for bug 1717287

Revision history for this message
Witold Krecicki (wpk) wrote :

The fix is a proper api_url regex:

--- maas-enlist~ 2017-09-14 17:24:38.000000000 +0200
+++ maas-enlist 2017-09-14 23:16:38.574202964 +0200
@@ -185,7 +185,7 @@
 if echo "$serverurl" | egrep -q '(^[a-z]+://|^)[a-z0-9\.]+($|/$)'; then
  api_url="MAAS/api/1.0/nodes/"
 else
- api_url=`echo $serverurl | sed 's#^\(\|[a-z]\+://\)[a-zA-Z0-9\.]\+\(\|\:[0-9]\+\)/##'`
+ api_url=`echo $serverurl | sed 's#^\(\|[a-z]\+://\)\([a-zA-Z0-9\.]\+\|\(\[[0-9a-fA-F:]\+\]\)\)\(\|\:[0-9]\+\)/##'`
 fi

 #TODO: Auto-detect hostname?