Commit Graph

229 Commits

Author SHA1 Message Date
Dan Bungert c08fdab2f8 one-off format of long lines with black 2023-07-25 15:27:49 -06:00
Dan Bungert 34d40643ad format with black + isort 2023-07-25 15:27:42 -06:00
Dan Bungert e095d5040f network: use pyroute2 to manage default routes
The existing event based method of watching for has_network has a flaw.

The incoming route_change events from probert do not distinguish routes
on the same interface but a different metric, so if 2 routes on one
interface appear, we only get one event.  Then if one of those routes is
removed, we will inappropriately remove this route from the
default_routes list.

Aside from the code watching the event stream, the set of default routes
is an elaborate boolean value.

Simplify the code by passing around a boolean, and when we get a
route_change event, use that to go looking again at the list of default
routes.

LP: #2004659
2023-02-21 13:30:05 -07:00
Dan Bungert 9d12871f15 many: s/create_task/run_bg_task/
create_task has the following note:
  Important: Save a reference to the result of this function, to avoid a
  task disappearing mid-execution.

Convert existing usage of create_task to run_bg_task, if that
create_task is not actually storing the result.
2023-02-13 14:56:07 -07:00
Michael Hudson-Doyle 7aab0b5de4 rewrite Spinner to not require a loop parameter 2022-12-07 14:19:27 +13:00
Michael Hudson-Doyle 85b3cd0724 switch from loop.create_task to asyncio.create_task
mostly done with sed
2022-11-08 10:08:46 +13:00
Olivier Gayot 812bba1de1 Use logger names consistent with directory structure
Refreshed name of loggers to make them consistent with the directory
structure.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-02-25 17:35:45 +01:00
Michael Hudson-Doyle 83d076975d
Merge pull request #979 from mwhudson/install-wpasupplicant-on-demand
install wpasupplicant when a wifi nic is seen
2021-06-10 12:54:09 +12:00
Michael Hudson-Doyle ef008f4aea address review comments 2021-06-10 12:32:29 +12:00
Michael Hudson-Doyle 7b3bb0278b fix some more assorted small wlan problems 2021-06-09 15:28:06 +12:00
Michael Hudson-Doyle 907e7dd7b0 implement UI for tracking wpasupplicant install state
this should perhaps be in the subiquity package vs subiquitycore somehow
but that seems hard.
2021-06-09 13:00:43 +12:00
Michael Hudson-Doyle d14fd35330 move "enabling wifi turns on dhcp4" behaviour to controller from view 2021-06-02 12:40:50 +12:00
Michael Hudson-Doyle 902c57f7f7 move start_scan error handling into controller
report errors via scan_state field
2021-06-02 12:28:44 +12:00
Michael Hudson-Doyle 4850cee5ce NetworkConfigureWLANStretchy.update_link should only care about updates for its nic
this was very confusing to debug!
2021-06-02 12:28:44 +12:00
Michael Hudson-Doyle c325e76e9e fix the wlan view calls to controller methods to pass just the nic name 2021-06-02 12:28:42 +12:00
Michael Hudson-Doyle fac0eeed43 fix crash when trying to view nic info
fixes half of https://bugs.launchpad.net/subiquity/+bug/1912955
2021-01-27 09:35:09 +13:00
Michael Hudson-Doyle f4066d97d7 convert controller api methods to take strings and trigger updates for affected nics
this is going to work better in the client/server world
2020-09-03 22:52:31 +12:00
Michael Hudson-Doyle 04426cec15 make network view use a plain-old-data view of a nic
The network view code used to crawl all over the network model object,
which isn't really going to work with the upcoming client/server split.
So this adds a much better defined interface between the view and
controller.
2020-09-03 11:12:38 +12:00
Michael Hudson-Doyle 6b26b668be fix formatting of error message 2020-07-22 12:27:04 +12:00
Michael Hudson-Doyle a9dd3757f1
Merge pull request #761 from mwhudson/still-better-i18n
more work towards being able to provide good translations
2020-05-21 12:38:51 +12:00
Michael Hudson-Doyle 7bcfcba99b Merge branch 'master' into still-better-i18n 2020-05-21 11:15:32 +12:00
Michael Hudson-Doyle b85f8118b7 update the network view when wlan dialod is saved 2020-05-19 11:53:03 +12:00
Michael Hudson-Doyle 7236771d2f correctly enable dhcp4 when configuring a ssid for a wlan interface 2020-05-19 11:53:03 +12:00
Dimitri John Ledkov da1477ba01 network: fix wifi screen
WiFi screen was broken since NetDev refactor. Unbreak it.
2020-05-18 12:00:42 +01:00
Michael Hudson-Doyle 21ed91d7d3 add comments, contexts for some translatable strings
from scanning though about one third of subiquity.pot
2020-05-08 15:40:59 +12:00
Michael Hudson-Doyle 3060a03bd6 make some things slightly better 2020-05-08 15:06:24 +12:00
Michael Hudson-Doyle 2d65fe4f16 attempt to make providing a good translation easier
* annotate a few missed string literals with _()
 * try to consistently use named placeholders when formatting strings
   for display (i.e. _("frob the {thing}") not _("frob the {}")
 * run selector values, form captions and form help through _() before
   display
 * use ngettext in one place. not sure if there need to be more...
 * reduce cuteness about how strings are constructed in a few places
2020-05-06 21:16:24 +12:00
Michael Hudson-Doyle 3856a11186 fix deleting virtual network devices 2020-03-20 09:18:25 +13:00
Michael Hudson-Doyle cb52ab75a2 use the asyncio loop object rather than the urwid loop almost everywhere 2019-12-20 12:04:38 +13:00
Michael Hudson-Doyle 45478b68a4 add a way to change the default level of a context's children 2019-12-20 09:47:38 +13:00
Michael Hudson-Doyle a91dff2b14 add a way to log a dialog open/close, use it for network dialogs 2019-12-20 09:47:38 +13:00
Michael Hudson-Doyle eb228ab7f3 introduce a helper for a restartable task
(there are going to be a few of these)
2019-12-13 10:03:32 +13:00
Michael Hudson-Doyle 19f8f91d29 asyncify network controller 2019-12-13 09:39:13 +13:00
Michael Hudson-Doyle efed69ff7c some asyncifying of network 2019-12-13 09:37:36 +13:00
Steve Langasek d2f996732f Don't mark a dash as translatable 2019-10-02 11:45:34 -07:00
Steve Langasek 34034e4a79 Don't mark 'DHCPv{v}' as translatable 2019-10-02 11:40:58 -07:00
Michael Hudson-Doyle a2ccb0cd9e remove all remaining footer-related things 2019-09-30 09:32:23 +13:00
Michael Hudson-Doyle d0151deec0 some more logging statements to follow user around the ui a little more 2019-09-09 15:33:45 +12:00
Michael Hudson-Doyle 3384eb5c84 small fixes 2019-03-26 11:32:02 +13:00
Michael Hudson-Doyle b485cf487b make the re-dhcp on entry to the network screen a little more discreet 2019-03-26 10:59:50 +13:00
Michael Hudson-Doyle 099e658670 make applying changes less jarring for virtual devices 2019-03-26 10:59:50 +13:00
Michael Hudson-Doyle 23488a6f2e some fixes found in testing 2019-03-26 10:59:50 +13:00
Michael Hudson-Doyle b571b3d1a9 track and display DHCP status
Mark all devices with DHCP enabled as pending when the config is
applied, and mark them as timed out ten seconds later if they have not
received any addresses.
2019-03-26 10:57:36 +13:00
Michael Hudson-Doyle eae2497d41 auto disable inactive NICs
This disables any NIC that does not have a global address by the first
time the network screen is shown
2019-03-26 10:57:36 +13:00
Michael Hudson-Doyle 3bb9268974 apply network changes immediately, rather than when the "Done" is pressed
diff makes this change look more involved than really necessary :(
2019-03-26 10:57:33 +13:00
Michael Hudson-Doyle ff59de4a9c change "Done" button to "Continue without network" if there is no default route 2019-03-26 10:57:13 +13:00
Michael Hudson-Doyle c0f4a90179 refactor network view
The visible impact of this is that the addresses for a NIC are now
displayed underneath its name and a long "info line" (i.e. mac / model /
vendor) for a nic no longer distorts its table.

This lays the groundwork for better handling of NICs that fail to dhcp
and things like that.
2019-03-25 09:25:53 +13:00
Michael Hudson-Doyle 756d923424 remove long disabled views for setting default route
as and when we add route configuration to subiquity, we will need new
views anyway.
2019-03-07 14:13:37 +13:00
Michael Hudson-Doyle d0c41469a7 remove login model/controller/view from subiquitycore
long ago subsumed into other code
2019-03-07 14:01:52 +13:00
Michael Hudson-Doyle f25bb21c08 fix netdev info dialog 2019-02-19 14:40:19 +01:00