DHCPAgentContext for Neutron Plugin API charms (#422)
* DHCPAgentContext for Neutron Plugin API charms
Generalize the DHCPAgentContext for Neutron Plugin API charms,
neutron-gateway and neutron-openvswitch.
Primarily to handle the ovs-use-veth setting problem. Get the right
value from config or existing dhcp_agent.ini file. Existing has
precedence. Attempt to default to "False" without disrupting existing
deployments. Handle existing deployments and upgrades safely. See LP
Partial-Bug: #1831935
* More unit tests from neutron-openvswitch
* Parse early and use Bools for ovs-use-veth
Responses to review requests:
* Parse config value into bools early
* Use static methods
Add get_managed_services_and_ports. This is generalised version of
the keystone specific method that recently landed *1. Adding
a generalised version to reduce duplicate code when rolling out
across the OpenStack API charms.
Commit d2ea1b8 replaced the original apt_pkg module with a custom
implementation. This new implementation, however, has a few differences
with how the original module handled some of its calls. It is also
missing the 'config' submodule which is needed by the apt hardening
modules.
This commit implements the 'config' functionality and fixes the
compatibility issues with this new implementation.
HostInfoContext: Fix retrieval of a hosts primary FQDN (#415)
* HostInfoContext: Fix retrieval of a hosts primary FQDN
The implementation of ``socket.getfqdn()`` in the standard Python
library does not exhaust all methods of getting the official name
of a host ref Python issue https://bugs.python.org/issue5004
Add a hint to the context based on local unit state for whether
fqdn should be used or not.
* HostInfoContext: use callback for charm controlled hint
Instead of forcing the charm authors hand as to how the
`use_fqdn_hint` is passed, provide a optional callback to let charm
author implement whichever way suits their charm.