diff --git a/changelog/67083.fixed.md b/changelog/67083.fixed.md new file mode 100644 index 000000000000..d869517e68c5 --- /dev/null +++ b/changelog/67083.fixed.md @@ -0,0 +1 @@ +Ubuntu can run salt-master without root diff --git a/salt/grains/core.py b/salt/grains/core.py index 4c8e969ceec6..a5cd2643c6f3 100644 --- a/salt/grains/core.py +++ b/salt/grains/core.py @@ -1105,9 +1105,15 @@ 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: + log.debug( + f"Could not detect virtual_subtype with dmesg: {e}" + ) # If a Dom0 or DomU was detected, obviously this is xen if "dom" in grains.get("virtual_subtype", "").lower(): grains["virtual"] = "xen"