Skip to content

Commit

Permalink
Merge pull request #18 from brianread108/main
Browse files Browse the repository at this point in the history
Correct awk call in get_total_memory
  • Loading branch information
fabriziosalmi authored Dec 11, 2024
2 parents ab29f56 + 8c35b82 commit 9af66e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lxc_autoscale/lxc_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def get_total_cores():
def get_total_memory():
"""Calculate available memory after reserving fixed amount."""
try:
command_output = run_command("free -m | awk '/^MemTotal:/ {print $2}'")
command_output = run_command("free -m | awk '/^Mem:/ {print $2}'")
total_memory = int(command_output.strip()) if command_output else 0
except (ValueError, subprocess.CalledProcessError) as e:
logging.error("Failed to get total memory: %s", str(e))
Expand Down

0 comments on commit 9af66e2

Please sign in to comment.