Skip to content

Commit 8fbb4f1

Browse files
committed
bugfixes for (#63) and (#61)
- (#63) Fix path to cut(1) command - (#61) add filter to prevent df reporting "No such device or address" from breaking the script
1 parent a521a6f commit 8fbb4f1

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Tue, 17 Aug 2022 18:37:21 -0600 v1.6.2
2+
3+
- (#63) Fix path to cut(1) command
4+
- (#61) add filter to prevent df reporting "No such device or address" from breaking the script
5+
16
Tue, 02 Aug 2022 18:37:21 -0600 v1.6.1
27

38
- Fix 'bullseye' name determination - remove extra sources output

ISP-RPi-mqtt-daemon.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ def getDeviceModel():
397397

398398
def getLinuxRelease():
399399
global rpi_linux_release
400-
out = subprocess.Popen("/bin/cat /etc/apt/sources.list | /bin/egrep -v '#' | /usr/bin/awk '{ print $3 }' | /bin/sed -e 's/-/ /g' | /bin/cut -f1 -d' ' | /bin/grep . | /usr/bin/sort -u",
400+
out = subprocess.Popen("/bin/cat /etc/apt/sources.list | /bin/egrep -v '#' | /usr/bin/awk '{ print $3 }' | /bin/sed -e 's/-/ /g' | /usr/bin/cut -f1 -d' ' | /bin/grep . | /usr/bin/sort -u",
401401
shell=True,
402402
stdout=subprocess.PIPE,
403403
stderr=subprocess.STDOUT)
@@ -651,8 +651,17 @@ def getFileSystemDrives():
651651
# /dev/mmcblk0p1 253 55 198 22% /boot
652652
# tmpfs 340 0 340 0% /run/user/1000
653653

654+
# FAILING Case v1.6.x (issue #61)
655+
# [[/bin/df: /mnt/sabrent: No such device or address',
656+
# '/dev/root 119756 19503 95346 17% /',
657+
# '/dev/sda1 953868 882178 71690 93% /media/usb0',
658+
# '/dev/sdb1 976761 93684 883078 10% /media/pi/SSD']]
659+
654660
tmpDrives = []
655661
for currLine in trimmedLines:
662+
if 'no such device' in currLine.lower():
663+
print_line('BAD LINE FORMAT, Skipped=[{}]'.format(currLine), debug=True, warning=True)
664+
continue
656665
lineParts = currLine.split()
657666
print_line('lineParts({})=[{}]'.format(
658667
len(lineParts), lineParts), debug=True)

0 commit comments

Comments
 (0)