1 from charmhelpers
.core
.hookenv
import (
7 from charms
.reactive
import (
13 import charms
.sshproxy
16 @when('sshproxy.configured')
17 @when_not('simple.installed')
18 def install_simple_proxy_charm():
19 """Post-install actions.
21 This function will run when two conditions are met:
22 1. The 'sshproxy.configured' state is set
23 2. The 'simple.installed' state is not set
25 This ensures that the workload status is set to active only when the SSH
26 proxy is properly configured.
28 set_flag('simple.installed')
29 status_set('active', 'Ready!')
32 @when('actions.touch')
34 raise Exception("I am broken.")
37 filename
= action_get('filename')
38 cmd
= ['touch {}'.format(filename
)]
39 result
, err
= charms
.sshproxy
._run
(cmd
)
41 action_fail('command failed:' + err
)
43 action_set({'output': result
})
45 clear_flag('actions.touch')