From: Adam Israel Date: Thu, 21 Jun 2018 19:57:00 +0000 (-0400) Subject: Update deprecated methods X-Git-Tag: BUILD_v4.0.1_1~11 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=7a5344c988e3a9c11a2db896fd080659e16d3f59;p=osm%2Fdevops.git 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. --- diff --git a/juju-charms/layers/simple/actions/touch b/juju-charms/layers/simple/actions/touch index d85d3fac..7e30af4c 100755 --- a/juju-charms/layers/simple/actions/touch +++ b/juju-charms/layers/simple/actions/touch @@ -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() diff --git a/juju-charms/layers/simple/reactive/simple.py b/juju-charms/layers/simple/reactive/simple.py index 2a55a5c7..8355bf30 100644 --- a/juju-charms/layers/simple/reactive/simple.py +++ b/juju-charms/layers/simple/reactive/simple.py @@ -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')