I'm not sure if I'm using this the correct way. I have one class defining the required_keys
and the provide_data
for the same relationship. The following code excecutes provide_data
on a relation join/change, but doesn't relation-set namenode_sshkey
. If I remove the required_keys
line, the code suddenly works (but then I can't use this class to specify the required-data for the relationship).
[...]
{
'service': 'namenode',
'ports': [9000, 50070], # ports to open after start
'provided_data': [
NamenodeRelation()
],
'required_data': [
NamenodeRelation(),
{'role' : 'namenode', 'command' : 'hadoop-daemon.sh'}
],
'data_ready': [
configure_namenode,
helpers.render_template(
source='upstart.conf',
target='/etc/init/namenode.conf')
],
},
[...]
class NamenodeRelation(RelationContext):
name = 'namenode'
interface = 'dfs'
def __init__(self, *args, **kwargs):
self.required_keys = ['slave_IP', 'private-address']
RelationContext.__init__(self,name=self.name, *args, **kwargs)
def provide_data(self):
return {'namenode_sshkey' : get_ssh_key() }
Is this behaviour intended or is this a bug?