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