Skip to content
Snippets Groups Projects
Commit 7a5344c9 authored by israelad's avatar israelad
Browse files

Update deprecated methods

The `set_state` and `remove_state` methods have been deprecated in
favour of `set_flag` and `clear_flag`. This updates the references to
those methods.
parent 00a2233f
No related branches found
No related tags found
No related merge requests found
......@@ -18,15 +18,14 @@
import sys
sys.path.append('lib')
from charms.reactive import main
from charms.reactive import set_state
from charms.reactive import main, set_flag
from charmhelpers.core.hookenv import action_fail, action_name
"""
`set_state` only works here because it's flushed to disk inside the `main()`
loop. remove_state will need to be called inside the action method.
"""
set_state('actions.{}'.format(action_name()))
set_flag('actions.{}'.format(action_name()))
try:
main()
......
......@@ -5,8 +5,8 @@ from charmhelpers.core.hookenv import (
status_set,
)
from charms.reactive import (
remove_state as remove_flag,
set_state as set_flag,
clear_flag,
set_flag,
when,
when_not,
)
......@@ -41,4 +41,4 @@ def touch():
else:
action_set({'outout': result})
finally:
remove_flag('actions.touch')
clear_flag('actions.touch')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment