mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Merge pull request #13676 from basepi/cherrypick
Do not unnecessarily recompile OpenVZ envId pattern
This commit is contained in:
commit
4ea4995388
@ -530,8 +530,8 @@ def _virtual(osdata):
|
|||||||
# Provide additional detection for OpenVZ
|
# Provide additional detection for OpenVZ
|
||||||
if os.path.isfile('/proc/self/status'):
|
if os.path.isfile('/proc/self/status'):
|
||||||
with salt.utils.fopen('/proc/self/status') as status_file:
|
with salt.utils.fopen('/proc/self/status') as status_file:
|
||||||
|
vz_re = re.compile(r'^envID:\s+(\d+)$')
|
||||||
for line in status_file:
|
for line in status_file:
|
||||||
vz_re = re.compile(r'^envID:\s+(\d+)$')
|
|
||||||
vz_match = vz_re.match(line.rstrip('\n'))
|
vz_match = vz_re.match(line.rstrip('\n'))
|
||||||
if vz_match and int(vz_match.groups()[0]) != 0:
|
if vz_match and int(vz_match.groups()[0]) != 0:
|
||||||
grains['virtual'] = 'openvzve'
|
grains['virtual'] = 'openvzve'
|
||||||
|
Loading…
Reference in New Issue
Block a user