lp:~yasha.bubnov/cloud-init

Owned by Yasha Bubnov
Get this repository:
git clone https://git.launchpad.net/~yasha.bubnov/cloud-init
Only Yasha Bubnov can upload to this repository. If you are Yasha Bubnov please log in for upload directions.

Branches

Name Last Modified Last Commit
master 2017-06-29 21:33:33 UTC 2017-06-29
read_dmi_data: always return None when inside a container.

Author: Scott Moser
Author Date: 2017-06-29 17:32:15 UTC

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

11 of 1 result
This repository contains Public information 
Everyone can see this information.

Subscribers