Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue preventing non-root salt master running in VSCode integrated terminal #67085

Open
wants to merge 1 commit into
base: 3007.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/67083.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ubuntu can run salt-master without root
11 changes: 8 additions & 3 deletions salt/grains/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1105,9 +1105,14 @@ def _virtual(osdata):
if os.path.isdir("/sys/bus/xen/drivers/xenconsole"):
# An actual DomU will have the xenconsole driver
grains["virtual_subtype"] = "Xen PV DomU"
elif "xen:" in __salt__["cmd.run"]("dmesg").lower():
# Fallback to parsing dmesg, might not be successful
grains["virtual_subtype"] = "Xen PV DomU"
else:
try:
if "xen:" in __salt__["cmd.run"]("dmesg").lower():
# Fallback to parsing dmesg, might not be successful
grains["virtual_subtype"] = "Xen PV DomU"
except salt.exceptions.CommandExecutionError as e:
msg = f"Could not detect virtual_subtype with dmesg: {e}"
log.debug(msg)
# If a Dom0 or DomU was detected, obviously this is xen
if "dom" in grains.get("virtual_subtype", "").lower():
grains["virtual"] = "xen"
Expand Down
Loading