Skip to content

address #246#247

Merged
Szubie merged 2 commits intomasterfrom
getRamUsage
Oct 30, 2023
Merged

address #246#247
Szubie merged 2 commits intomasterfrom
getRamUsage

Conversation

@idroz
Copy link
Contributor

@idroz idroz commented Oct 25, 2023

The issue seems to be caused by commands in line 610-611 of platform/multipass.go

totalMemCmd := "cat /proc/meminfo | grep MemTotal | awk '{print $2}'"

The commands do not return complex strings that required splitting on ":" and instead seem to return the desired integer values.

The change requires testing locally of the two commands in lines 610-611 of the platform/multipass.go file to ensure they do not return any special characters.

Will merge when all tests confirm.

…re compatability between old and new multipass instances by using -m flag to configure memory.
@Szubie
Copy link
Collaborator

Szubie commented Oct 30, 2023

Made a few changes to ensure that the memory retrieval works on both Mac and Windows.

The issue seems to have been that the awk command failed on Windows due to Powershell attempting to expand $2 into a variable. This made further processing of the string necessary on Windows.

Also switched to configuring memory via shorthand "-m" to maintain compatibility with older Multipass versions.

Tested on both Windows and Mac, so now merging.

@Szubie Szubie merged commit 2fcf4ee into master Oct 30, 2023
@Szubie Szubie deleted the getRamUsage branch October 30, 2023 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants