Commit Graph

98 Commits

Author SHA1 Message Date
Michael Hudson-Doyle cab565304a write netplan directly to the target
rather than via curtin and then cloud-init
2020-04-01 19:37:02 +13:00
Michael Hudson-Doyle b155d3eff0 have apply_config task exit as soon as all dhcp NICs have an address 2019-12-13 10:04:31 +13:00
Dimitri John Ledkov 962fd3ebd3 NetDev: bring back actual_global_ip_addresses used by console_conf. 2019-08-08 15:02:39 +01:00
Dimitri John Ledkov e755bf4b5f console_conf/subiquity: split identitymodel, as it is not the same at all. 2019-08-08 15:02:39 +01: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 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 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 c571f58dcc fix saving static network data with search domains 2019-02-21 08:35:19 +01:00
Michael Hudson-Doyle aebb0b2e2e fill identity fields if you go back to that form 2018-12-13 14:49:55 +13:00
Michael Hudson-Doyle 15b6bb1114 Major refactor of network model
The main thrust of this is to not create virtual interfaces until
applying the config.

This meant that the network model has to change a bit to be able to
represent interfaces that do not yet exist on the system. I did this
by ripping out most of the existing network device code: now a
NetworkDev is really just a wrapper for the config for a device and (if
it exists) the netlink data too. A few places had to adjust to checking
if the netlink info is available before accessing it but all in all it
was not that painful.

There are a few other refactorings in this commit that perhaps should be
split out (how the bond parameters are handled, some stuff about
resizing the table rows when interfaces are edited) but it doesn't
really seem worth it.
2018-10-31 09:58:56 +13:00
Michael Hudson-Doyle f19a453e0e mark interfaces that have dhcp enabled but did not get an address as optional 2018-07-12 14:17:20 +12:00
Michael Hudson-Doyle 46c0d598ad first cut at a bond form that handles devices too 2018-07-11 22:02:52 +12:00
Michael Hudson-Doyle 5e683dcc1f add create bond button 2018-07-11 22:02:52 +12:00
Dimitri John Ledkov 87558f0074 lint 2018-07-11 22:02:52 +12:00
Dimitri John Ledkov 88b64ca7fd Fix up bond netplan. 2018-07-11 22:02:52 +12:00
Dimitri John Ledkov 87ef3749e6 Finish bond master/slaves. 2018-07-11 22:02:52 +12:00
Dimitri John Ledkov e0d231f5d7 Create bond 2018-07-11 22:02:52 +12:00
Michael Hudson-Doyle 53a14e30ad make updates to network screen in response to netlink events more finegrained 2018-07-10 13:25:05 +12:00
Michael Hudson-Doyle b3636cfcd9 refactor how netdev action menu gets populated 2018-07-10 12:30:01 +12:00
Michael Hudson-Doyle db042eafa6 read vlan config from netlink
using support i just added to probert
2018-07-08 14:16:22 +12:00
Dimitri John Ledkov 92c53b29ae Vlan ui 2018-07-06 14:31:42 +01:00
Dimitri John Ledkov 173eac79a5 models/network: use same NetDev in both dictionaries
One can lookup interfaces by ifindex and by name. Ensure, both
dictionaries use the same NetDev object. This way, when config of
NetDev is updated, it is correctly reflected whichever way the NetDev
is accessed.
2018-07-06 14:30:42 +01:00
Michael Hudson-Doyle 7d15727b74 add wlan editing 2018-07-06 13:36:53 +12:00
Michael Hudson-Doyle 2e281d00d4 delete gobs of old code 2018-07-06 13:36:53 +12:00
Michael Hudson-Doyle 2251cac4ba trim back to existing functionality 2018-07-06 13:36:53 +12:00
Scott Moser 3e69673501 Fix writing of netplan configs
When user configures network with subiquity, it's rendered
netplan should be wholly definitive.  So, we remove the other files
that may have config.  This fixes a bug where running in an instance
when running on a system where cloud-init had rendered a 'match' with
'macaddress'.

When writing netplan we keep 'macaddress' match in place but drop
others.  The others may just wildcard from the installer environment,
but macaddress are likely by cloud-init or otherwise intentionally
written.

Also add an atomic write in subiquitycore/file_util and move the
netplan code into subiquitycore/netplan.py, and add some unit test
helpers from cloud-init.
2018-06-07 11:46:34 -04:00
Ryan Harper 40caacaca3 pep8 fixes for subiquitycore.models.network 2018-05-24 16:51:51 -05:00
Ryan Harper a0bf68f3c4 pyflakes3 fixes
Add and enable pyflakes3 on console_conf, subiquity, subiquitycore and tests.
Replace NOQA markers with __all__ declarations for module imports.
Replace some obvious deadcode that voilates flake8, separate pass for removing
dead code rather than commenting will be handled later.
2018-05-24 16:51:51 -05:00
Ryan Harper 3c9b2e28c7 Drop commented out / dead code 2018-05-23 18:53:12 -05:00
Michael Hudson-Doyle 80fffc723c some self review 2018-05-18 13:53:51 +12:00
Michael Hudson-Doyle 7df7a4c1fa fetch ssh keys in the identity screen, all a bit happy path though 2018-05-18 13:53:51 +12:00
Michael Hudson-Doyle bdf3861e5c some simplifications 2018-05-18 13:53:51 +12:00
Michael Hudson-Doyle b3da7266b9 do not show wlan interfaces in server installer 2018-03-21 09:35:21 +13:00
Michael Hudson-Doyle d15565bdf1 console_conf does not pass a hostname here 2018-03-08 18:06:34 +13:00
Michael Hudson-Doyle b215ceaf7d do not log wifi password when an interface appears
This can happen in particular when netplan re-plugs an interface.
2018-02-26 22:29:41 +13:00
Michael Hudson-Doyle 36bcc539c3 move curtin config rendering to a method on SubiquityModel
this moves to curtin's native netplan support as a side effect
2017-11-20 13:45:58 +13:00
Michael Hudson-Doyle 8086d5df81 move to a unified model instance
and stop having the controllers construct each model instance for itself
2017-11-16 12:48:20 +13:00
Michael Hudson-Doyle 947a65a3bb changes following changes in probert
the only really visible effect of all this is to make --dry-run
--machine-config foo show the network config from foo, not the machine
running subiquity. (The existing configs won't work, though)
2017-11-15 14:27:24 +13:00
Michael Hudson-Doyle 19ec2b5c41 only suggest the user logs in via scope global addresses 2017-02-17 14:21:54 +13:00
Michael Hudson-Doyle 8af0639dd4 cope with probert API changes 2017-02-17 12:37:47 +13:00
Michael Hudson-Doyle d75cbabb61 move subiquity welcome stuff out of subiquitycore 2017-01-17 12:04:15 +13:00
Michael Hudson-Doyle ac7e7cd08b remove BaseModel as it no longer does anything 2017-01-13 15:08:31 +13:00
Mathieu Trudel-Lapierre 87eb961586 Re-add get_configured_interfaces() for subiquity. 2016-12-20 15:42:37 -05:00
Michael Hudson-Doyle 38c600528b remove some of the ip-version-in-method-name methods 2016-12-12 15:58:41 +13:00
Michael Hudson-Doyle 4de99bd41e use the ip version as a parameter a bunch more 2016-12-12 15:54:33 +13:00
Michael Hudson-Doyle 1efaed7648 add network model interfaces that take ip version as a parameter 2016-12-12 15:34:59 +13:00
Michael Hudson-Doyle 19081d53bc reparse netplan configs after writing config
'netplan apply' can re-plug network interfaces, so it looked like we
forgot how an interface had been configured
2016-11-09 12:21:06 +13:00