canonical / canonical/layer-basic
config states use hookenv.Config.changed, which can fail
- Lenguaje dominante
- Python
- Estrellas
- 10
- Forks
- 42
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
The config states detect if a configuration item has changed using hookenv.config() and its changed method. This was designed assuming the only thing running in a hook context is a hook, which is now untrue. It is possible for an action to be invoked, which can check charm configuration using hookenv.config() and will flag changed config items as seen. If this action happens to be called between the config being changed and an actual hook being called (such as config-changed), then the configuration changed states will be lost.
The solution is for the base layer to cache the config itself in unitdata.kv(), so the cache only gets updated in charms.layer.basic.init_config_states()
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Comienza en charms.layer.basic.init_config_states() e inspecciona cómo se detectan actualmente los cambios de configuración mediante hookenv.config(). Lee el uso de unitdata.kv() alrededor de la capa base y verifica después que la caché solo se actualiza durante init_config_states() y que los cambios no se pierden cuando se ejecuta una action antes de un hook de configuración.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- tooling
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bien especificado
- Aptitud para principiantes
- 45/100