Virt: re-write and refactor of cpu_vendor() utility function
commitff79e7642c1f66b7cc05e6f5444457648c07b2fa
authorlmr <lmr@592f7852-d20e-0410-864c-8624ca9c26a4>
Wed, 29 Jun 2011 00:56:03 +0000 (29 00:56 +0000)
committerlmr <lmr@592f7852-d20e-0410-864c-8624ca9c26a4>
Wed, 29 Jun 2011 00:56:03 +0000 (29 00:56 +0000)
tree9736bb3f156e67053054768ea1a038ae6ae920b2
parentc513fbabc9e5036550e1bc41330926713478e9c9
Virt: re-write and refactor of cpu_vendor() utility function

The current version of cpu_vendor() works by calling out an external 'grep'
process. This is rather unecessary. Also, having it in virt_utils make
more sense IMHO. Finally, renaming it to get_cpu_vendor() makes the API
more consistent with other functions such as get_vendor_from_pci_id().

Also attached is a unittest for virt_utils, that initially tests only
get_cpu_vendor() behaviour.

Changes from v1:
 * Properly remove cpu_vendor() from virt_installer.py
 * Fix typo in name of test_vendor_unknown() method

Signed-off-by: Cleber Rosa <crosa@redhat.com>
git-svn-id: svn://test.kernel.org/autotest/trunk@5467 592f7852-d20e-0410-864c-8624ca9c26a4
client/virt/kvm_installer.py
client/virt/virt_installer.py
client/virt/virt_utils.py
client/virt/virt_utils_unittest.py [new file with mode: 0755]