Proxy the 'netplan generate' CLI via DBus, if called from within a snap,
to work around the strict AppArmor confinement.
see: snapcore/snapd#10212
COMMITS:
* dbus:cli: implement io.netplan.Netplan.Generate()
Proxy the 'netplan generate' CLI via DBus, if called from within a snap,
to work around the strict AppArmor confinement.
see: https://github.com/snapcore/snapd/pull/10212
* doc: mention Netplan.Generate() DBus method
Using os.replace() leads to "Invalid cross-device link" errors on Core20 setups, due to having different mounts.
Use shutil.copy2() & os.remove() instead.
* cli:set: Fix netplan-set on Core20
* cli:set: use shutil.copy2()