Skip to content

Commit

Permalink
17397 FIX Agent plugin 'lnx_container_host_if.linux': ValueError
Browse files Browse the repository at this point in the history
Change-Id: I8732752afe894adb393d62ae8237a64671751632
Closes: #733
Co-Authored-By: Moritz Kiemer <[email protected]>
  • Loading branch information
schmidax and mo-ki committed Nov 13, 2024
1 parent fe13e5f commit f547f51
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
15 changes: 15 additions & 0 deletions .werks/17397.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[//]: # (werk v2)
# Agent plugin 'lnx_container_host_if.linux': ValueError

key | value
---------- | ---
date | 2024-11-13T08:48:53+00:00
version | 2.3.0p21
class | fix
edition | cre
component | checks
level | 1
compatible | no

This affects some users of the agent plugin 'lnx_container_host_if.linux'.
On systems with empty folders below `${HOST_PATH_PREFIX}/sys/class/net`, the parsing fail with `ValueError (not enough values to unpack (expected 2, got 1))`.
6 changes: 4 additions & 2 deletions agents/plugins/lnx_container_host_if.linux
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@ section_lnx_container_host_if() {

for if_path in "${interface_filepath}"/*; do

# Directory does not exist or is empty
[ -e "${if_path}" ] || continue
# Check if Path is a directory, if not continue
[ -d "${if_path}" ] || continue
# Check if directory is empty, if true continue
[ -n "$(ls -A "${if_path}")" ] || continue

printf "name\v%s\t" "$(basename "${if_path}")"
__read_network_interface_files "${if_path}" "${network_interface_metadata}"
Expand Down

0 comments on commit f547f51

Please sign in to comment.