Code review comment for lp:~andreserl/maas/packaging_dbc_go

Revision history for this message
Christian Reis (kiko) wrote :

On Fri, Jun 17, 2016 at 02:27:26PM -0000, Andres Rodriguez wrote:
> - maas-region local_config_set \
> - --maas-url "http://${ipaddr}/MAAS"
> + local port=$(echo "$1" | cut -d":" -f2)
> + if [ -z "$port" ]; then
> + # MAAS bind's to port 5240. If no port specified as part of

binds, not bind's.

> + # 'ipaddr', we set as such.
> + maas-region local_config_set \
> + --maas-url "http://${ipaddr}:5240/MAAS"
> + else
> + maas-region local_config_set \
> + --maas-url "http://${ipaddr}/MAAS"
> + fi

Also, a nit, but why not:

    [...]

    if [ -z "$local_port" ]; then
        # Ensure MAAS binds to port 5240 by default
        ipaddr=${ipaddr}:5240
    fi

    maas-region local_config_set \
            --maas-url "http://${ipaddr}/MAAS"

« Back to merge proposal