def openstack_upgrade():
    """Upgrade packages to config-set Openstack version.

    If the charm was installed from source we cannot upgrade it.
    For backwards compatibility a config flag must be set for this
    code to run, otherwise a full service level upgrade will fire
    on config-changed."""

    resolve_CONFIGS()
    if do_action_openstack_upgrade('openstack-dashboard', do_openstack_upgrade,
                                   CONFIGS):
        config_changed()
 def test_resolve_CONFIGS_existing_configs_force(self, _register_configs):
     _register_configs.return_value = 'new configs from force'
     hooks.CONFIGS = 'existing stuff'
     self.assertEqual(
         hooks.resolve_CONFIGS(force_update=True),
         'new configs from force')
     _register_configs.assert_called_once_with()
 def test_resolve_CONFIGS_existing_configs(self, _register_configs):
     hooks.CONFIGS = 'existing stuff'
     self.assertEqual(
         hooks.resolve_CONFIGS(),
         'existing stuff')
     self.assertFalse(_register_configs.called)
 def test_resolve_CONFIGS(self, _register_configs):
     _register_configs.return_value = 'new configs'
     self.assertEqual(
         hooks.resolve_CONFIGS(),
         'new configs')
     _register_configs.assert_called_once_with()