openvcloud / 0-templates

Apache License 2.0
1 stars 5 forks source link

Service's state.yaml is not updated when another action is executed #24

Closed john-kheir closed 6 years ago

john-kheir commented 6 years ago

1- Run a blueprint to create an account with action install 2- Run it again to uninstall the account 3- Check the state.yaml file under the account's service folder

Actual Result

state.yaml is still having the install result.


acitons:
    install: ok```

Note: this file needs to be updated with any action status for all templates.
muhamadazmy commented 6 years ago

@katia-e as per scrum, we can solve this issue by doing the following:

so for example, if we have install and uninstall actions install, should make sure uninstall state is deleted, then set install to ok uninstall, should make sure install state is deleted, then set uninstall to ok

Hint: I will personally add some helper methods for this (may be a decorator in zrobot) to help with stat management, because this can really go out of hand if we have many state for the service.

zaibon commented 6 years ago

I don't think you need to have a uninstall state. What we usually do is, once service is installed, you have a state actions:install:ok when you uninstall the service, you just delete this state. Then you know is it not installed.

john-kheir commented 6 years ago

@zaibon What if something go wrong with the uninstall ?

zaibon commented 6 years ago

Then you endup in a degraded state where you can't really rely on anything I would say.

zaibon commented 6 years ago

from #48:

@john-kheir the state and data of a service are only dump on the filesystem at a periodic interval. So could be you looked before the dump happens. You should not take the filesystem as source of truce. Only reposnse from the API as assured to always have last state.