Merge lp:~nuclearbob/utah/no-virbr0-postinst-fix into lp:utah
Proposed by
Max Brustkern
Status: | Merged |
---|---|
Approved by: | Javier Collado |
Approved revision: | 722 |
Merged at revision: | 735 |
Proposed branch: | lp:~nuclearbob/utah/no-virbr0-postinst-fix |
Merge into: | lp:utah |
Diff against target: |
22 lines (+10/-2) 1 file modified
debian/utah.postinst (+10/-2) |
To merge this branch: | bzr merge lp:~nuclearbob/utah/no-virbr0-postinst-fix |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Javier Collado (community) | Approve | ||
Max Brustkern (community) | Needs Resubmitting | ||
Review via email:
|
Description of the change
If we install the utah package on a machine that has virbr0 configured as TAPBR by libvirt, but virbr0 is not actually up, the postinst will give a ValueError when trying to get through address through netifaces. This change wraps that in a try block and prints False in the case of a value error.
To post a comment you must log in.
What about checking the interface before trying to access its data with something like: interfaces( ): ifaddresses( '$TAPBR' )
if $TAPBR in netifaces.
print netifaces.AF_INET in netifaces.
else:
print False
I don't like much catching exceptions for conditions that can be checked before accessing
some invalid value.