def pre_create_security_group(self, resource, event, trigger, payload): session = payload.context.session sg = payload.desired_state stateful = sg.get('stateful', True) payload.request_body['security_group']['id'] = sg_id = \ sg.get('id') or uuidutils.generate_uuid() if not stateful: nuagedb.set_nuage_sg_parameter(session, sg_id, 'STATEFUL', '0')
def _update_stateful_parameter(session, sg_id, stateful): if stateful: nuagedb.delete_nuage_sg_parameter(session, sg_id, 'STATEFUL') else: nuagedb.set_nuage_sg_parameter(session, sg_id, 'STATEFUL', '0')