Skip to content

Commit

Permalink
Fixed: running on CentOS 7 out of box.
Browse files Browse the repository at this point in the history
- lspci missing is not fatal now
- server-info-collect doesn't break if there is only 1 disk drive in system

#107
  • Loading branch information
strizhechenko committed Jun 29, 2017
1 parent 3d41e8c commit 3e6e2b6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
7 changes: 2 additions & 5 deletions netutils_linux_hardware/parsers.py
Expand Up @@ -80,11 +80,8 @@ def parse(text):
types = ['SSD', 'HDD']
if not text:
return dict()
return dict((k, types[v]) for k, v in iteritems(yaml.load(text
.replace(":", ": ")
.replace("/sys/block/", "")
.replace("/queue/rotational", ""))
))
data = yaml.load(text.replace(":", ": ").replace("/sys/block/", "").replace("/queue/rotational", ""))
return dict((k, types[v]) for k, v in iteritems(data))

class DiskSizeInfo(Parser):

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -14,7 +14,7 @@ def read(*paths):

setuptools.setup(
name='netutils-linux',
version='2.0.9',
version='2.0.10',
author='Oleg Strizhechenko',
author_email='oleg.strizhechenko@gmail.com',
license='MIT',
Expand Down
4 changes: 2 additions & 2 deletions utils/server-info-collect
Expand Up @@ -16,10 +16,10 @@ server_info() {
cat /proc/scsi/scsi > $TMPDIR/scsi
LANG= lsblk -d --output=NAME,MODEL > $TMPDIR/lsblk_models
LANG= lsblk -nlb --output SIZE,MOUNTPOINT,NAME > $TMPDIR/lsblk_sizes
LANG= lspci > $TMPDIR/lspci
LANG= lspci > $TMPDIR/lspci || true
LANG= lscpu > $TMPDIR/lscpu_info
LANG= lscpu -p | grep -v '^#' | awk -F ',' '{print $1" "$3}' > $TMPDIR/lscpu_layout
fgrep '' /sys/block/*/queue/rotational | egrep -v '[0-9]+/' > $TMPDIR/disks_types || true
fgrep -H '' /sys/block/*/queue/rotational | egrep -v '[0-9]+/' > $TMPDIR/disks_types || true
}

network_info() {
Expand Down

0 comments on commit 3e6e2b6

Please sign in to comment.