Moved down container check code below hypervisors to validate containers type running in virtual environment.

Fixes #46754 & #43405
This commit is contained in:
Nageswar 2018-04-04 19:09:05 +00:00
parent 710f74c4a6
commit 7e704c0e81
No known key found for this signature in database
GPG Key ID: CC09EC69D666E568

View File

@ -763,6 +763,7 @@ def _virtual(osdata):
# If a Dom0 or DomU was detected, obviously this is xen
if 'dom' in grains.get('virtual_subtype', '').lower():
grains['virtual'] = 'xen'
# Check container type after hypervisors, to avoid variable overwrite on containers running in virtual environment.
if os.path.isfile('/proc/1/cgroup'):
try:
with salt.utils.fopen('/proc/1/cgroup', 'r') as fhr: