Merge lp://qastaging/~brendan-donegan/checkbox/bug1019162_wireless_soft_unblock into lp://qastaging/checkbox

Proposed by Brendan Donegan
Status: Merged
Merged at revision: 1481
Proposed branch: lp://qastaging/~brendan-donegan/checkbox/bug1019162_wireless_soft_unblock
Merge into: lp://qastaging/checkbox
Diff against target: 112 lines (+33/-17) (has conflicts)
2 files modified
debian/changelog (+10/-0)
scripts/create_connection (+23/-17)
Text conflict in debian/changelog
To merge this branch: bzr merge lp://qastaging/~brendan-donegan/checkbox/bug1019162_wireless_soft_unblock
Reviewer Review Type Date Requested Status
Marc Tardif (community) Approve
Brendan Donegan (community) Needs Resubmitting
Review via email: mp+113007@code.qastaging.launchpad.net

Description of the change

Some Broadcom cards will have the soft-block engaged after loading the STA driver. This merge modifies the create_connection script to remove it after the connection is created. This seems cleaner than changing all the job descriptions to do it. I also did a little bit of refactoring to simplify the code (hopefully)

To post a comment you must log in.
Revision history for this message
Marc Tardif (cr3) wrote :

Unless you intend to do anything with the output of rfkill, I would avoid assigning it to a variable. If someone looks at the code, they might see that the variable is no longer used, so they might think that both the variable and the call are unnecessary. By removing the variable, this removes that potential risk.

review: Needs Fixing
1479. By Brendan Donegan

Removed assignment of result of check_call for rfkill.

Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

Good point, thanks

Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

Removed the assignment of the check_call result

review: Needs Resubmitting
Revision history for this message
Marc Tardif (cr3) wrote :

Thanks for the changes! I noticed a couple more things that we might want to consider:

1. Do you think we should take this opportunity to improve the output so that it's printed to stderr when exiting with non-zero:

print("Failed to activate %s." % connection, file=sys.stderr)
sys.exit(1)

2. Do you think that if the rfkill call fails, that the script should return non-zero:

    try:
        check_call(['rfkill','unblock','wlan','wifi'])
    except CalledProcessError:
        print("Could not unblock wireless devices with rfkill.", file=sys.stderr)
        sys.exit(1)

These are not regressions from before though, so I'm easy with your decision either way. Please let me know what you think.

review: Needs Information
Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

2. I'm reluctant to, without understanding how and when rfkill fails. If the unblock doesn't work it's going to exhibit as a test failure anyway.

1480. By Brendan Donegan

Send errors in create_connection to stderr

Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

Made errors output to stderr

review: Needs Resubmitting
Revision history for this message
Marc Tardif (cr3) wrote :

Thanks for making these changes!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches