Raw stdout selectors fail for dotted item keys such as VLAN interfaces
Describe the bug
Raw stdout selectors with a dot in the item key fail to parse. A common example is a VLAN interface named eth0.100: --stdout network.eth0.100.bytes_recv raises UnboundLocalError. If the selector follows another one, the previous selector is silently repeated instead.
Reproduction
On develop b3f1cf008e9ad28eb02e1bb63d74f980683fedf6, Glances 4.5.8.dev1, Python 3.12.13/macOS:
from types import SimpleNamespace
from glances.outputs.glances_stdout import GlancesStdout
GlancesStdout(args=SimpleNamespace(stdout='network.eth0.100.bytes_recv'))
# UnboundLocalError: cannot access local variable 'new' ...
output = GlancesStdout(args=SimpleNamespace(stdout='load,network.eth0.100.bytes_recv'))
print(output.plugins_list)
# [('load', None, None), ('load', None, None)]Expected behavior
Parse network as the plugin, eth0.100 as the item key, and bytes_recv as the attribute. The documented plugin/key/attribute syntax can retain its first and last components while allowing dots in the item key. Existing plugin-only and plugin.attribute selectors should behave as before.
This reproduces at selector parsing time without requiring a live VLAN interface.
Source: nicolargo/glances