Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace deprecated tostring() call with tobytes() #90

Merged
merged 2 commits into from Mar 2, 2021

Conversation

waveform80
Copy link
Member

On booting a fresh hirsute daily image on a Raspberry Pi, the following appears in the MOTD:

=> There were exceptions while processing one or more plugins. See
/var/log/landscape/sysinfo.log for more information.

The log mentioned contains the following:

2021-02-19 15:27:28,062 ERROR    Network plugin raised an exception.
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/landscape/sysinfo/sysinfo.py", line 99, in run
    result = plugin.run()
  File "/usr/lib/python3/dist-packages/landscape/sysinfo/network.py", line 36, in run
    device_info = self._get_device_info()
  File "/usr/lib/python3/dist-packages/landscape/lib/network.py", line 163, in get_active_device_info
    speed, duplex = get_network_interface_speed(
  File "/usr/lib/python3/dist-packages/landscape/lib/network.py", line 249, in get_network_interface_speed
    res = status_cmd.tostring()
AttributeError: 'array.array' object has no attribute 'tostring'

Simply replacing the deprecated tostring() call with tobytes() fixes the issue and the MOTD message disappears.

LP: #1911050

Copy link
Contributor

@simpoir simpoir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 LGTM

@simpoir simpoir merged commit dc8dbce into canonical:master Mar 2, 2021
@waveform80 waveform80 deleted the netspeed-tostring-fix branch July 14, 2021 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants