projects
/
osm
/
N2VC.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add Juju Public Key
[osm/N2VC.git]
/
tests
/
charms
/
layers
/
simple
/
reactive
/
simple.py
diff --git
a/tests/charms/layers/simple/reactive/simple.py
b/tests/charms/layers/simple/reactive/simple.py
index
802d60c
..
af6644b
100644
(file)
--- a/
tests/charms/layers/simple/reactive/simple.py
+++ b/
tests/charms/layers/simple/reactive/simple.py
@@
-11,6
+11,7
@@
from charms.reactive import (
when_not,
)
import charms.sshproxy
when_not,
)
import charms.sshproxy
+import os
@when('sshproxy.configured')
@when('sshproxy.configured')
@@
-31,6
+32,10
@@
def install_simple_proxy_charm():
@when('actions.touch')
def touch():
@when('actions.touch')
def touch():
+ if not in_action_context():
+ clear_flag('actions.touch')
+ return
+
err = ''
try:
filename = action_get('filename')
err = ''
try:
filename = action_get('filename')
@@
-42,3
+47,8
@@
def touch():
action_set({'output': result})
finally:
clear_flag('actions.touch')
action_set({'output': result})
finally:
clear_flag('actions.touch')
+
+
+def in_action_context():
+ """Determine whether we're running on an action context."""
+ return 'JUJU_ACTION_UUID' in os.environ