sonic-buildimage/platform/vs/docker-sonic-vs
Joe LeVeque 890e1f38cc [sonic-py-common] get_platform(): Refactor method of retrieving platform identifier (#5094)
Applications running in the host OS can read the platform identifier from /host/machine.conf. When loading configuration, sonic-config-engine *needs* to read the platform identifier from machine.conf, as it it responsible for populating the value in Config DB.

When an application is running inside a Docker container, the machine.conf file is not accessible, as the /host directory is not mounted. So we need to retrieve the platform identifier from Config DB if get_platform() is called from inside a Docker 
container. However, we can't simply check that we're running in a Docker container because the host OS of the SONiC virtual switch is running inside a Docker container. So I refactored `get_platform()` to:
    1. Read from the `PLATFORM` environment variable if it exists (which is defined in a virtual switch Docker container)
    2. Read from machine.conf if possible (works in the host OS of a standard SONiC image, critical for sonic-config-engine at boot)
    3. Read the value from Config DB (needed for Docker containers running in SONiC, as machine.conf is not accessible to them)

- Also fix typo in daemon_base.py
- Also changes to align `get_hwsku()` with `get_platform()`
2020-08-09 10:40:20 -07:00
..
50-default.conf [virtualswitch]: build docker-sonic-vs docker based on SAI virtual switch (#1065) 2017-10-23 22:01:42 -07:00
database_config.json [multiDB] add database_config.json into vs images (#3757) 2019-11-20 10:40:19 -08:00
Dockerfile.j2 [vs] Add dependencies for NAT to docker-sonic-vs (#4259) 2020-03-22 23:01:21 -07:00
orchagent.sh [orchagent] Use mac address from config_db instead of from eth0 (#4166) 2020-02-24 10:26:19 -08:00
sonic-dev.gpg.key [vs]: add vlan configuration support in virtual switch (#1200) 2017-11-30 14:59:25 -08:00
start.sh [sonic-py-common] get_platform(): Refactor method of retrieving platform identifier (#5094) 2020-08-09 10:40:20 -07:00
supervisord.conf Changes in sonic-buildimage to support the NAT feature (#3494) 2020-02-03 15:30:39 -08:00