def publish_config(self, filename, version, content): if filename != self.index_key: self.log_debug("Publishing configuration " + filename + " (v" + str(version) + ")") message = Message(self) message.recipient = "*/*" message.command = "CONF" message.args = filename message.config_schema = version message.set_data(content) # configuration is retained so when a module connects, immediately get the latest config message.retain = True self.send(message)
def clear_config(self, filename, version): # send a null so to cancel retention if filename != self.index_key: self.log_debug("Unpublishing configuration "+filename+" (v"+str(version)+")") message = Message(self) message.recipient = "*/*" message.command = "CONF" message.args = filename message.config_schema = version # remove the retained message message.set_null() message.retain = True self.send(message)