[docker]: get hostname from config db instead of minigraph (#3004)
minigraph may not be always available on the some system configuration. Should use config db as the source of truth.
This commit is contained in:
parent
383fc0fa4b
commit
8f6ae90cba
@ -130,8 +130,8 @@ start() {
|
||||
{%- else %}
|
||||
# Obtain our HWSKU as we will mount directories with these names in each docker
|
||||
HWSKU=`sonic-cfggen -d -v 'DEVICE_METADATA["localhost"]["hwsku"]'`
|
||||
HOSTNAME=`sonic-cfggen -d -v 'DEVICE_METADATA["localhost"]["hostname"]'`
|
||||
{%- endif %}
|
||||
HOSTNAME=`sonic-cfggen -m -v 'DEVICE_METADATA["localhost"]["hostname"]'`
|
||||
if [ -z "$HOSTNAME" ] || ! [[ $HOSTNAME =~ ^[a-zA-Z0-9.\-]*$ ]]; then
|
||||
HOSTNAME=`hostname`
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user