From 0c747a8d50796167ee3c80cc1d576a63e36c581c Mon Sep 17 00:00:00 2001 From: Rob Dobson Date: Tue, 15 Jul 2014 18:36:16 +0100 Subject: [PATCH 1/2] Fixes to local_command which was failing to join arguments in a list. Signed-off-by: Rob Dobson --- hwinfo/pci/tests/test_lspci.py | 18 ++++++++++++++++++ hwinfo/tools/inspector.py | 3 ++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/hwinfo/pci/tests/test_lspci.py b/hwinfo/pci/tests/test_lspci.py index 82d1483..73e4b35 100644 --- a/hwinfo/pci/tests/test_lspci.py +++ b/hwinfo/pci/tests/test_lspci.py @@ -255,6 +255,24 @@ class BroadcomNetDeviceParse(TestSingleDeviceNNMMParse): } +class IntelNetDeviceParser(TestSingleDeviceNNMMParse): + + SAMPLE_DATA = '00:19.0 "Ethernet controller [0200]" "Intel Corporation [8086]" "82579LM Gigabit Network Connection [1502]" -r06 "Dell [1028]" "Device [05d2]"' + + DEVICE_REC = { + 'pci_device_bus_id': '00:19.0', + 'pci_device_class': '0200', + 'pci_device_class_name': 'Ethernet controller', + 'pci_vendor_name': 'Intel Corporation', + 'pci_vendor_id': '8086', + 'pci_device_id': '1502', + 'pci_device_name': '82579LM Gigabit Network Connection', + 'pci_subvendor_name': 'Dell', + 'pci_subvendor_id': '1028', + 'pci_subdevice_name': 'Device', + 'pci_subdevice_id': '05d2', + } + class TestMultiDeviceNNMMParse(unittest.TestCase): SAMPLE_FILE = '%s/lspci-nnmm' % DATA_DIR diff --git a/hwinfo/tools/inspector.py b/hwinfo/tools/inspector.py index 43ebc89..97b981b 100644 --- a/hwinfo/tools/inspector.py +++ b/hwinfo/tools/inspector.py @@ -27,7 +27,8 @@ def remote_command(host, username, password, cmd): return ''.join(output) def local_command(cmd): - process = subprocess.Popen(cmd, stdout=subprocess.PIPE) + cmdstr = ' '.join(cmd) + process = subprocess.Popen(cmdstr, stdout=subprocess.PIPE, shell=True) stdout, stderr = process.communicate() if process.returncode == 0: return str(stdout).strip() From 9876257535619acd1256709809f0c741a774a6ff Mon Sep 17 00:00:00 2001 From: Rob Dobson Date: Tue, 15 Jul 2014 18:36:56 +0100 Subject: [PATCH 2/2] Reving version on PyPi. Signed-off-by: Rob Dobson --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 198788d..0e7bfef 100644 --- a/setup.py +++ b/setup.py @@ -6,10 +6,10 @@ name='python-hwinfo', author='Rob Dobson', author_email = 'rob@rdobson.co.uk', - version = '0.1', + version = '0.1.1', description = 'Library for parsing hardware info on Linux/Unix OSes.', url = 'https://github.com/rdobson/python-hwinfo', - download_url = 'https://github.com/rdobson/python-hwinfo/tarball/0.1', + download_url = 'https://github.com/rdobson/python-hwinfo/tarball/0.1.1', packages=find_packages(), entry_points = { 'console_scripts': [