def project_create_func(self, proj_id, proj=None):
if self.get_project_name(proj_id):<EOL><INDENT>LOG.info("<STR_LIT>", proj_id)<EOL>return<EOL><DEDENT>if not proj:<EOL><INDENT>try:<EOL><INDENT>proj = self.keystone_event._service.projects.get(proj_id)<EOL><DEDENT>except Exception:<EOL><INDENT>LOG.error("<STR_LIT>", proj_id)<EOL>return<EOL><DEDENT><DEDENT>proj_name, dci_id = self._get_dci_id_and_proj_name(proj.name)<EOL>if proj_name in reserved_project_name:<EOL><INDENT>proj_name = "<STR_LIT:_>".join((proj_name, self.cfg.dcnm.orchestrator_id))<EOL><DEDENT>part_name = self.cfg.dcnm.default_partition_name<EOL>if len('<STR_LIT::>'.join((proj_name, part_name))) > <NUM_LIT:32>:<EOL><INDENT>LOG.error('<STR_LIT>'<EOL>'<STR_LIT>',<EOL>len('<STR_LIT::>'.join((proj_name, part_name))))<EOL>return<EOL><DEDENT>try:<EOL><INDENT>self.dcnm_client.create_project(self.cfg.dcnm.orchestrator_id,<EOL>proj_name, part_name, dci_id,<EOL>proj.description)<EOL><DEDENT>except dexc.DfaClientRequestFailed:<EOL><INDENT>self.update_project_info_cache(proj_id, name=proj_name,<EOL>dci_id=dci_id,<EOL>result=constants.CREATE_FAIL)<EOL>LOG.error("<STR_LIT>", proj_name)<EOL><DEDENT>else:<EOL><INDENT>self.update_project_info_cache(proj_id, name=proj_name,<EOL>dci_id=dci_id)<EOL>LOG.debug('<STR_LIT>', (<EOL>{'<STR_LIT:name>': proj_name, '<STR_LIT>': dci_id, '<STR_LIT>': proj.description}))<EOL><DEDENT>self.project_create_notif(proj_id, proj_name)<EOL>
Create project given project uuid