@fw_handler_decorator<EOL><INDENT>def _fw_create(self, drvr_name, data, cache):<DEDENT>
fw = data.get('<STR_LIT>')<EOL>tenant_id = fw.get('<STR_LIT>')<EOL>fw_name = fw.get('<STR_LIT:name>')<EOL>fw_id = fw.get('<STR_LIT:id>')<EOL>fw_pol_id = fw.get('<STR_LIT>')<EOL>admin_state = fw.get('<STR_LIT>')<EOL>rtr_id = None<EOL>if '<STR_LIT>' in fw and len(fw.get('<STR_LIT>')) != <NUM_LIT:0>:<EOL><INDENT>rtr_id = fw.get('<STR_LIT>')[<NUM_LIT:0>]<EOL><DEDENT>if not admin_state:<EOL><INDENT>LOG.debug("<STR_LIT>")<EOL>return<EOL><DEDENT>name = dfa_dbm.DfaDBMixin.get_project_name(self, tenant_id)<EOL>rtr_name = '<STR_LIT:_>'.join([fw_constants.TENANT_EDGE_RTR, name])<EOL>fw_rtr_name = self.os_helper.get_rtr_name(rtr_id)<EOL>fw_type = None<EOL>if fw_rtr_name == rtr_name:<EOL><INDENT>fw_type = fw_constants.FW_TENANT_EDGE<EOL><DEDENT>if tenant_id not in self.fwid_attr:<EOL><INDENT>self.fwid_attr[tenant_id] = FwMapAttr(tenant_id)<EOL><DEDENT>tenant_obj = self.fwid_attr[tenant_id]<EOL>tenant_obj.create_fw(name, fw_pol_id, fw_id, fw_name, fw_type, rtr_id)<EOL>self.tenant_db.store_fw_tenant(fw_id, tenant_id)<EOL>if not cache:<EOL><INDENT>self._check_create_fw(tenant_id, drvr_name)<EOL><DEDENT>if fw_pol_id is not None and not (<EOL>tenant_obj.is_policy_present(fw_pol_id)):<EOL><INDENT>pol_data = self.os_helper.get_fw_policy(fw_pol_id)<EOL>if pol_data is not None:<EOL><INDENT>self.fw_policy_create(pol_data, cache=cache)<EOL><DEDENT><DEDENT>
Firewall create routine.

        This function updates its local cache with FW parameters.
        It checks if local cache has information about the Policy
        associated with the FW. If not, it means a restart has happened.
        It retrieves the policy associated with the FW by calling
        Openstack API's and calls t he policy create internal routine.