Skip to content

Commit

Permalink
Merge pull request #9 from rdobson/local_fixes
Browse files Browse the repository at this point in the history
Local fixes
  • Loading branch information
rdobson committed Jul 15, 2014
2 parents 330ae5c + 9876257 commit 567be16
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
18 changes: 18 additions & 0 deletions hwinfo/pci/tests/test_lspci.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion hwinfo/tools/inspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
name='python-hwinfo',
author='Rob Dobson',
author_email = '[email protected]',
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': [
Expand Down

0 comments on commit 567be16

Please sign in to comment.