def add_project(self):
g = self.gitlab<EOL>url = g['<STR_LIT:url>'] + "<STR_LIT>" + g['<STR_LIT>']<EOL>query = {'<STR_LIT>': g['<STR_LIT>']}<EOL>if (requests.get(url, params=query).status_code == requests.codes.ok):<EOL><INDENT>log.debug("<STR_LIT>" + url + "<STR_LIT>")<EOL>return None<EOL><DEDENT>else:<EOL><INDENT>log.info("<STR_LIT>" + g['<STR_LIT>'])<EOL>url = g['<STR_LIT:url>'] + "<STR_LIT>"<EOL>query['<STR_LIT>'] = '<STR_LIT:true>'<EOL>query['<STR_LIT>'] = g['<STR_LIT>']<EOL>query['<STR_LIT:name>'] = g['<STR_LIT:name>']<EOL>result = requests.post(url, params=query)<EOL>if result.status_code != requests.codes.created:<EOL><INDENT>raise ValueError(result.text)<EOL><DEDENT>log.debug("<STR_LIT>" + g['<STR_LIT>'] + "<STR_LIT>" +<EOL>result.text)<EOL>return result.json()<EOL><DEDENT>
Create project in gitlab if it does not exist