mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix Salt failure after merge of #34683
This commit is contained in:
parent
7bda166e9d
commit
b4cfebb107
1 changed files with 3 additions and 2 deletions
|
@ -47,6 +47,7 @@ try:
|
|||
HAS_PSUTIL = True
|
||||
except ImportError:
|
||||
HAS_PSUTIL = False
|
||||
import platform
|
||||
import salt.grains.core
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
@ -80,8 +81,8 @@ def _gather_buffer_space():
|
|||
# Oh good, we have psutil. This will be quick.
|
||||
total_mem = psutil.virtual_memory().total
|
||||
else:
|
||||
# We need to load up some grains. This will be slow.
|
||||
os_data = salt.grains.core.os_data()
|
||||
# We need to load up ``mem_total`` grain. Let's mimic required OS data.
|
||||
os_data = {'kernel': platform.system()}
|
||||
grains = salt.grains.core._memdata(os_data)
|
||||
total_mem = grains['mem_total']
|
||||
# Return the higher number between 5% of the system memory and 100MB
|
||||
|
|
Loading…
Add table
Reference in a new issue