Comment 2 for bug 1714546

Revision history for this message
Stuart Bishop (stub) wrote :

Recommended fix would be to not use the @hook('install') decorator, and instead use normal states.

Instead of:

@when('prometheus.do-install')
def install_packages():
   [...]
   reactive.remove_state('prometheus.do-install')

Have instead:

@when_not('prometheus.installed')
def install_packages():
    [...]
    reactive.set_state('prometheus.installed')

You can then remove the @hook('install') handler entirely, and the install_packages handler will run in the first hook (even if it is a storage hook).