diff options
author | Scott Moser <smoser@brickies.net> | 2017-06-29 13:32:15 -0400 |
---|---|---|
committer | Scott Moser <smoser@brickies.net> | 2017-06-29 17:33:33 -0400 |
commit | 4d9f24f5c385cb7fa21d87a097ccd9a297613a75 (patch) | |
tree | bd40b67fddf420cac5631e18dc7b85420b73f225 /doc/rtd/topics/datasources/nocloud.rst | |
parent | 17bad421b79c3e18978f942321e9865379b09321 (diff) | |
download | vyos-cloud-init-4d9f24f5c385cb7fa21d87a097ccd9a297613a75.tar.gz vyos-cloud-init-4d9f24f5c385cb7fa21d87a097ccd9a297613a75.zip |
read_dmi_data: always return None when inside a container.
This fixes stacktrace and warning message that would be printed
to the log if running inside a container and read_dmi_data tried
to access a key that was not present.
In a container, the /sys/class/dmi/id data is not relevant to the
but to the host. Additionally an unpriviledged container might see
strange behavior:
# cd /sys/class/dmi/id/
# id -u
0
# ls -l chassis_serial
-r-------- 1 nobody nogroup 4096 Jun 29 16:49 chassis_serial
# cat chassis_serial
cat: /sys/class/dmi/id/chassis_serial: Permission denied
The solution here is to just always return None when running in a
container.
LP: #1701325
Diffstat (limited to 'doc/rtd/topics/datasources/nocloud.rst')
0 files changed, 0 insertions, 0 deletions