Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lxd/init: Differentiate managed and unmanaged network (canonical#14119)
When using `lxd init` to configure default profile with an existing network, differentiate between managed and unmanaged networks by first trying to retrieve an existing network (and checking if it is managed). Unamanaged network: ```sh ... Would you like to configure LXD to use an existing bridge or host interface? (yes/no) [default=no]: yes Name of the existing bridge or host interface: tmpbr0 ... Would you like a YAML "lxd init" preseed to be printed? (yes/no) [default=no]: y config: {} networks: [] storage_pools: [] storage_volumes: [] profiles: - config: {} description: "" devices: eth0: name: eth0 nictype: bridged # <-- parent: tmpbr0 # <-- type: nic name: default projects: [] cluster: null ``` Managed network: ```sh ... Would you like to configure LXD to use an existing bridge or host interface? (yes/no) [default=no]: yes Name of the existing bridge or host interface: lxdbr0 ... Would you like a YAML "lxd init" preseed to be printed? (yes/no) [default=no]: y config: {} networks: [] storage_pools: [] storage_volumes: [] profiles: - config: {} description: "" devices: eth0: name: eth0 network: lxdbr0 # <-- type: nic name: default projects: [] cluster: null ``` Closes canonical#13468
- Loading branch information