Commit Graph

89 Commits

Author SHA1 Message Date
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
Michael Hudson-Doyle 8a44befe2a remove UI for customizing default route, not supported by netplan
Yet, anyway.
2016-11-08 10:39:05 +13:00
Michael Hudson-Doyle 31b21799b7 remove dependency on netifaces 2016-11-07 16:56:36 +13:00
Michael Hudson-Doyle c4fdf5cb72 allow choosing from visible networks when configuring wifi 2016-11-07 16:56:36 +13:00
Michael Hudson-Doyle cacd456a6a Adapt to netlink event driven version of probert. 2016-11-07 16:56:32 +13:00
Michael Hudson-Doyle 82b11dbd69 reorganize the network model and make the UI a bit more consistent
The main change here is to separate the state a network device is in and the
state we want it to be in. So it now parses the netplan config on a system as
well as probing the state of via probert.

The UI is changed to make this distintion too, and be IMO a bit more
consistent. Somewhere in this I've removed the display of whether the
probed address was found via DHCP or not, possibly that should be put
back if it doesn't make things too cluttered.

In dry-run mode, we now still write the config and feed it to netplan, but
in a way that doesn't affect the system we are running it on.
2016-11-07 15:15:46 +13:00
Michael Hudson-Doyle d48a70973e restore escape key behaviour 2016-11-02 12:44:04 +13:00
Michael Hudson-Doyle 6318de27cf make sure selecting dhcp after manual configuration clears out gateway & nameserver config 2016-10-21 08:59:34 +13:00
Mathieu Trudel-Lapierre 0ef1ec679b models/network: move nameservers rendering to the interface rather than being global
Signed-off-by: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>
2016-10-20 15:18:19 -04:00
Michael Hudson-Doyle 7edcf3bcb7 UI for entering name servers/domains 2016-10-20 22:31:10 +13:00