BugFix: snap services always use systemd, even in trusty (#494)
* Unpin runtime requirements because the pinning occurs at charm-build time, not charm-install time. This gives downstream charmers the flexibilty to pin as they wish
* move specific version pinning to test_requirements.txt
* remove requirements.txt from test_requirements.txt... all runtime tests are installed
* Make charmhelpers.core.host.init_is_systemd depend on optional service_name so snap packages are always systemd regarless of the os-release
* Fix Linting issues
9e20a38...
by
Alex Kavanagh <email address hidden>
Fix directory /etc/nagios/nrpe.d/ issue (#492)
* Fix directory /etc/nagios/nrpe.d/ issue
Under certain deployment conditions, the charm can attempt to write to
the /etc/nagios/nrpe.d/ directory before it exists. This directory is
created by the nrpe charm, but if the hacluster gets installed first,
then it can be triggered to attempt to set up the nrpe entries before
the directory can be created by nrpe. This change (and the associated
charm-helpers change) ensures that the charm will delay the nrpe config
until the directory is available (and thus, the nrpe charm is fully
installed)
contrib/ovs: Fix deletion of virtual bridge ports (#491)
The OVS `del_bridge_port` helper currently assumes it will be used
with interfaces that actually exist in the system.
This is not always the case. Add arguments that allow the caller
to decide whether a interface link and promiscuous settings should
be touched after removing the port from a OVS bridge. Defaults to
being compatible with the current behaviour.
core.hookenv.Config: Handle invalid state files (#484)
When initialising core.hookenv.Config a blank or corrupt state file
(.juju-persistent-config) caused the following exception to be raised:
File "charmhelpers/core/hookenv.py", line 348, in load_previous
for k, v in copy.deepcopy(self._prev_dict).items():
AttributeError: 'NoneType' object has no attribute 'items'
Handle this situation and return a blank previous state instead to
recover from this situation.
A previous attempt to fix this was made in #166 (LP #1768018) however it
did not work because while it caught the error loading the JSON file, it
then tried to call .items() on the object copy which is set to None.
Fix that by returning from the function after catching the exception.
The test cases (test_init_empty_state_file,
test_init_invalid_state_file) were also incorrectly passing because they
wrote to the test state file after initialising the Config object when
it had already been read. Fix that by writing to the file before Config
is initialised instead.
Note that in such a case where the file was corrupt, we will log an
error but otherwise silently "fix" this by loading a blank dictionary
causing Config() to report that all config values have changed even
though they may not have. Even though the code already intended (but
failed) to do this, we should ensure that is acceptable when reviewing
this change. I have updated the logged error to make this explicit.
openstack/context: allow adding unmapped interface to bridge (#483)
We iterate over and map physical interfaces when building
the bridge port interface map.
If our user have put a virtual interface name in the config they
have most likely done so with a purpose, let's not force our users
hand and carry out their wish to be compatible with existing
neutron-openvswitch / neutron-gateway deployment topologies.