Skip to content

Change to detect Vmware and Virutal Box - #314

Closed
wags007 wants to merge 1 commit into
saltstack:developfrom
wags007:develop
Closed

wags007 wants to merge 1 commit into
saltstack:developfrom
wags007:develop

Conversation

@wags007

@wags007 wags007 commented Dec 4, 2011

Copy link
Copy Markdown

Sorry I am a newbie this is the first thing I have ever uploaded to a project. The version I have downloaded doesn't detect VirtualBox or Vmware. I have been trying to figure out the best way to do that detection. I would rather be collaborative and I don't want to step on anyone's toes if I missed someone else working on this. I could also use some help detecting this on BSD systems since I am not currently using any. What I am proposing might/should also work for Zen and other Virtual Systems as long as the OS has dmidecode.

if osdata['kernel'] == 'Linux' and os.path.isfile('/usr/sbin/dmidecode'):
    vbios = subprocess.Popen(
            '/usr/sbin/dmidecode --type 1|grep -i "Product Name" ',
            shell=True,
            stdout=subprocess.PIPE
            ).communicate()[0].split(':')[1].split(' ')[1]

@thatch45

thatch45 commented Dec 4, 2011

Copy link
Copy Markdown
Contributor

Hmm, I definitely want to support, but would like to avoid having to fall back to dmidecode because it would need to be added as a dep.

I think that we can get this info with lspci, could I persuade you to take a look at lspci on your virtual machines to verify?

@wags007

wags007 commented Dec 4, 2011

Copy link
Copy Markdown
Author

Yes actually I used lspci at first but thought this looked easier to read. When I went to redo it though I think I found a better way to do it that may work for others. I don't have KVM or Zen setup anywhere to test it though. Let me test the change I just made and I will upload a new version with lspci.

@wags007 wags007 closed this Dec 4, 2011
meaksh pushed a commit to meaksh/salt that referenced this pull request Apr 13, 2021
* Fix virtual network generated DNS XML for SRV records

libvirt network's srv element doesn't take a `name` property but a
`service` one.

* Add missing property in virt.network_define dns srv doc

* virt: convert spice generation tests to pytests

* virt: don't add spicevmc channel to Xen VMs

Xen fully virtualized VMs with spicevmc channel fail to start, so better
not write it out in such cases.

* virt: inverse the remaining asserts in pytests

openSUSE 3000 spicevmc backport (saltstack#315)

* Revert "3002.2 Xen spicevmc, DNS SRV records backports (saltstack#314)"

This reverts commit 6d71be52432bcf0089acd851a05cdfca834a3642.

* virt: convert spice generation tests to pytests

* virt: don't add spicevmc channel to Xen VMs

Xen fully virtualized VMs with spicevmc channel fail to start, so better
not write it out in such cases.
agraul pushed a commit to agraul/salt that referenced this pull request Jun 25, 2021
* Fix virtual network generated DNS XML for SRV records

libvirt network's srv element doesn't take a `name` property but a
`service` one.

* Add missing property in virt.network_define dns srv doc

* virt: convert spice generation tests to pytests

* virt: don't add spicevmc channel to Xen VMs

Xen fully virtualized VMs with spicevmc channel fail to start, so better
not write it out in such cases.

* virt: inverse the remaining asserts in pytests
dwoz pushed a commit to dwoz/salt that referenced this pull request Jun 21, 2022
[3002.9] Update build scripts to use pyenv
dwoz added a commit to dwoz/salt that referenced this pull request Aug 1, 2026
pip 26.2 added a script_executable kwarg to
InstallRequirement.install(); the wrapper the shipped relenv (0.22.14)
monkey-patches over that method has fixed positional signatures and
rejects the new kwarg with

  TypeError: InstallRequirement.install() got an unexpected keyword
  argument 'script_executable'

The prior PIP_CONSTRAINT fix only affected what pip *installed*, not
what pip *was*. Nox creates its venvs via virtualenv, which seeds
whatever pip the ambient virtualenv bundles (26.2 on py3.14). Set
VIRTUALENV_PIP=25.2 at noxfile import time so every nox-created venv
starts with the compatible pip, and stays there until relenv PR saltstack#314
lands in a shipped relenv.
dwoz added a commit to dwoz/salt that referenced this pull request Aug 3, 2026
Cherry-picked from 3006.x (649ada8 / PR saltstack#69929). Relenv 0.22.18
includes the pip 26.2 InstallRequirement.install/install_wheel wrapper
fix (relenv PR saltstack#314) that the four preceding revert commits were
working around.
lkubb pushed a commit to lkubb/salt that referenced this pull request Aug 4, 2026
Cherry-picked from 3006.x (649ada8 / PR saltstack#69929). Relenv 0.22.18
includes the pip 26.2 InstallRequirement.install/install_wheel wrapper
fix (relenv PR saltstack#314) that the four preceding revert commits were
working around.
lkubb pushed a commit to lkubb/salt that referenced this pull request Aug 5, 2026
Cherry-picked from 3006.x (649ada8 / PR saltstack#69929). Relenv 0.22.18
includes the pip 26.2 InstallRequirement.install/install_wheel wrapper
fix (relenv PR saltstack#314) that the four preceding revert commits were
working around.
twangboy pushed a commit to twangboy/salt that referenced this pull request Aug 11, 2026
Cherry-picked from 3006.x (649ada8 / PR saltstack#69929). Relenv 0.22.18
includes the pip 26.2 InstallRequirement.install/install_wheel wrapper
fix (relenv PR saltstack#314) that the four preceding revert commits were
working around.
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