Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I want to call the relation-changed hook whenever there is a config-change and config-change hook is called. Can i directly call relation-changed from config-change hook. My config-change hook is written in bash.

config-change:
#!/bin/bash
...
relation-changed

Is it the right way to call it. Appreciate your response. Thanks in advance.

share|improve this question
add comment

2 Answers

You can but I would recommend putting any shared code in a shared utils script and then call that from both your relation-changed hook and your config-change hook.

share|improve this answer
    
If you're satisfied with the answer, please mark it as accepted. –  dimitern Feb 15 at 17:33
add comment

Assuming your relation is called foo, you should always be able to call:

$CHARM_DIR/hooks/foo-relation-changed

...but hatch's suggestion that you write library code, and use that directly, is a good one.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.