| Adam Israel | 32e2fa5 | 2016-12-14 22:50:51 -0500 | [diff] [blame] | 1 | #!/usr/bin/env python3 |
| 2 | import sys |
| 3 | sys.path.append('lib') |
| 4 | |
| 5 | from charms.reactive import main |
| 6 | from charms.reactive import set_state |
| 7 | from charmhelpers.core.hookenv import action_fail |
| 8 | |
| 9 | """ |
| 10 | `set_state` only works here because it's flushed to disk inside the `main()` |
| 11 | loop. remove_state will need to be called inside the action method. |
| 12 | """ |
| Philip Joseph | 71d56bb | 2017-01-05 18:54:15 +0530 | [diff] [blame^] | 13 | set_state('actions.start-traffic') |
| Adam Israel | 32e2fa5 | 2016-12-14 22:50:51 -0500 | [diff] [blame] | 14 | |
| 15 | try: |
| 16 | main() |
| 17 | except Exception as e: |
| 18 | action_fail(repr(e)) |