def __init__(self): CompositeType.__init__(self, ifc_key = 'bootstrap_config', asa_key = 'cluster group', asa_gen_template = "cluster group %(group_name)s", response_parser = cluster_response_parser) self.register_child(ConnectionRebalance()) self.register_child(ConsoleReplicate()) self.register_child(HealthCheck()) self.register_child(SecretKey()) self.register_child(LocalUnit()) self.register_child(Priority()) self.register_child(Clacp()) self.register_child(ClusterInterface()) self.register_child(EnableCluster())
def ifc2asa(self, no_asa_cfg_stack, asa_cfg_list): '''Generate ASA configuration from IFC configuration delta. @see DMObject.ifc2asa for parameter details ''' CompositeType.ifc2asa(self, no_asa_cfg_stack, asa_cfg_list) if not self.has_ifc_delta_cfg(): return action = self.get_action() if action == State.NOCHANGE: return if action == State.DESTROY and self.is_removable: # when removing cluster group, disable the cluster first no_asa_cfg_stack.append(CLIInteraction('no enable', mode_command=self.get_cli()))
def diff_ifc_asa(self, cli): 'Take care of the case where the field is empty, which means delete operation here' if self.get_cli().strip() == self.asa_key and cli != self.asa_key and self.has_ifc_delta_cfg(): del self.delta_ifc_key del self.delta_ifc_cfg_value return CompositeType.diff_ifc_asa(self, cli)