Merge ~bladernr/plainbox-provider-checkbox:1662724-fix-no-ip-traceback into plainbox-provider-checkbox:master
Proposed by
Jeff Lane
Status: | Merged |
---|---|
Approved by: | Pierre Equoy |
Approved revision: | ebb1f2b354f1ea4124e62a037fa7cfaa489111b0 |
Merged at revision: | 573fff67d94422a8b158859f4943881a0a7a2750 |
Proposed branch: | ~bladernr/plainbox-provider-checkbox:1662724-fix-no-ip-traceback |
Merge into: | plainbox-provider-checkbox:master |
Diff against target: |
61 lines (+16/-7) 1 file modified
bin/network (+16/-7) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Pierre Equoy | Approve | ||
Review via email: mp+318157@code.launchpad.net |
Description of the change
Fixes bug where a traceback is thrown if the network device under test has no IP address. Now when that happens, error messages are generated and the script aborts and exits with a 1.
To post a comment you must log in.
Testing on my device.
Before this MP:
% ./network test -i eno1 exit(main( )) targets_ list = make_target_ list(args. interface, test_targets, True) python3. 5/ipaddress. py", line 1525, in __init__ network_ address = IPv4Address( self._ip_ int_from_ string( addr[0] )) python3. 5/ipaddress. py", line 1118, in _ip_int_from_string or("Expected 4 octets in %r" % ip_str) AddressValueErr or: Expected 4 octets in '1'
ERROR:root:No IP address for eno1
ERROR:root:No netmask for eno1
Traceback (most recent call last):
File "./network", line 727, in <module>
sys.
File "./network", line 723, in main
return args.func(args)
File "./network", line 457, in interface_test
test_
File "./network", line 421, in make_target_list
False)
File "/usr/lib/
self.
File "/usr/lib/
raise AddressValueErr
ipaddress.
After:
% ./network test -i eno1
ERROR:root:No IP address for eno1
ERROR:root:No netmask for eno1
ERROR:root:Device eno1: Invalid IP Address
ERROR:root: Expected 4 octets in 'None'
ERROR:root:Aborting test now
Much more elegant! Both return 1 so this shouldn't change the outcome of the jobs in the test plans, only the ugly traceback shown in the logs :)