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
b3da7266b9
do not show wlan interfaces in server installer
2018-03-21 09:35:21 +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
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
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
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
Michael Hudson-Doyle
67f2ee4cda
include nameservers in device config
2016-10-20 21:59:34 +13:00
Michael Hudson-Doyle
baf05ac5ad
render gateway4/gateway6 in network config
...
See https://bugs.launchpad.net/ubuntu/+source/subiquity/+bug/1634540
2016-10-20 11:04:18 +13:00
Michael Hudson-Doyle
dad0e10912
completely separate menu -> signal and signal -> method mappings
...
and put the signal -> method mapping into the controller
this breaks the subiquity part even more than before, but it's pretty broken
already.
2016-09-27 20:53:17 +13:00
Mathieu Trudel-Lapierre
ba51edff75
models/network: don't render wifi devices that have no addresses and no DHCP.
...
Otherwise netplan, seeing the device half-rendered, also expects to set a
SSID we haven't set.
Signed-off-by: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>
2016-09-23 15:21:32 -04:00
Michael Hudson-Doyle
cbc6e97af7
use is_connected from probert
2016-09-19 11:27:12 +12:00
Michael Hudson-Doyle
f78cae64bd
Show if a link is not connected.
...
At least as well as ip(8) does it.
2016-09-16 14:28:40 +12:00
Michael Hudson-Doyle
682c81c289
Really probe (i.e. call into probert) every time we load the network screen.
...
Connected-ness of a link is something that can plausibly change over short
timescales.
2016-09-16 14:27:37 +12:00
Michael Hudson-Doyle
36967e2309
Do not write any config for a wlan device that has not been given a ESSID
...
See https://bugs.launchpad.net/ubuntu/+source/subiquity/+bug/1623756
2016-09-15 21:30:41 +12:00
Mathieu Trudel-Lapierre
e608362b34
Merge pull request #154 from CanonicalLtd/mwhudson/wifi-ui
...
Add a basic UI for entering wifi config details.
2016-09-09 15:33:48 -04:00
Michael Hudson-Doyle
bfbb876855
version from PPA
2016-09-05 21:21:05 +12:00
Michael Hudson-Doyle
9451d69076
actually do something with the inputted data
2016-09-05 16:25:45 +12:00
Michael Hudson-Doyle
f9668b8802
more low quality UI work
2016-09-05 15:36:59 +12:00
Michael Hudson-Doyle
bf3384596e
a start a configure-wifi ui
2016-09-05 12:03:06 +12:00
Michael Hudson-Doyle
0214912151
hide bonding UI
...
As the version of netplan we are currently using does not support it.
2016-08-31 11:16:36 +12:00
Michael Hudson-Doyle
0a2546b3bd
do not probe network on returning from network sub-screen
...
otherwise we overwrite our settings with the probed data!
2016-08-23 12:47:55 +12:00
Michael Hudson-Doyle
7679296653
split NETDEV_IGNORED_IFACES into NETDEV_IGNORED_IFACE_NAMES and NETDEV_IGNORED_IFACE_TYPES
2016-08-22 16:06:35 +12:00
Michael Hudson-Doyle
aef546b8f0
make Networkdev devices eagerly
...
the flow is that get_all_interface_names is always called immediately after
probe_network, so being lazy does not save anything.
2016-08-19 11:34:46 +12:00
Michael Hudson-Doyle
f8db1314ad
simplify get_all_interfaces
2016-08-19 11:21:19 +12:00
Michael Hudson-Doyle
bcfce74a12
kill off NetworkModel.network_devices
...
it is redundant with .info
2016-08-19 11:18:08 +12:00
Mathieu Trudel-Lapierre
ade3c8b93d
Only render dhcp if set to True
2016-08-16 22:23:39 -04:00
Mathieu Trudel-Lapierre
410ddf74d7
Drop 'match' for yaml rendering: it's unnecessary while we don't provide a way to rename interfaces.
2016-08-16 14:32:23 -04:00
Mathieu Trudel-Lapierre
682181ae62
We shouldn't render empty bits; also add rendering for IPv6 default route
2016-08-16 12:59:52 -04:00
Mathieu Trudel-Lapierre
11782ced12
Improve handling of the default routes.
2016-08-16 12:59:19 -04:00
Mathieu Trudel-Lapierre
df5e0fcb4c
Try to do something sane to set a default gateway
2016-08-16 01:09:28 -04:00
Mathieu Trudel-Lapierre
cac89c30e9
Do bonding, dhcp toggle, and segregate IPv4 and IPv6 again.
2016-08-16 00:48:15 -04:00
Mathieu Trudel-Lapierre
0f82a12208
Allow setting IPs and rendering as yaml
2016-08-15 17:05:19 -04:00
Mathieu Trudel-Lapierre
18c7e93cc2
WIP: Remove actions, port to an approximation of network yaml v2.
2016-08-13 00:13:22 -04:00
Mathieu Trudel-Lapierre
1980c4e483
fake-merge mwhudson/network
2016-08-12 22:31:31 -04:00
Mathieu Trudel-Lapierre
d73ef34774
Display IPv6 addresses.
2016-08-12 17:55:03 -04:00
Mathieu Trudel-Lapierre
6754a15c93
Allow more than one IPv4 address on an interface, and leave room for IPv6.
2016-08-09 15:11:02 -04:00
Michael Hudson-Doyle
553cb3b8da
sketches
2016-08-09 11:03:10 +12:00
Michael Hudson-Doyle
809034728c
rename ModelPolicy to BaseModel
2016-07-26 14:20:10 +12:00
Mathieu Trudel-Lapierre
0205423133
Do a slightly better job at showing default gateways.
2016-07-06 18:14:13 -04:00
Mathieu Trudel-Lapierre
73d73dff94
NetworkView: rework layout for network info based on review.
...
Signed-off-by: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>
2016-06-30 17:24:31 -04:00
Mathieu Trudel-Lapierre
e1970b6477
Rename subiquity to subiquitycore -- will serve as base classes for everything
...
Signed-off-by: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>
2016-06-30 14:17:01 -04:00