def populate_project_info(attributes):
 if (('tenant_id' in attributes) and ('project_id' not in attributes)):
  attributes['project_id'] = attributes['tenant_id']
 elif (('project_id' in attributes) and ('tenant_id' not in attributes)):
  attributes['tenant_id'] = attributes['project_id']
 if (attributes.get('project_id') != attributes.get('tenant_id')):
  msg = _("'project_id' and 'tenant_id' do not match")
  raise webob.exc.HTTPBadRequest(msg)
 return attributes

def populate_project_info ( attributes ) : if ( ( 'tenant_id' in attributes ) and ( 'project_id' not in attributes ) ) : attributes [ 'project_id' ] = attributes [ 'tenant_id' ] elif ( ( 'project_id' in attributes ) and ( 'tenant_id' not in attributes ) ) : attributes [ 'tenant_id' ] = attributes [ 'project_id' ] if ( attributes . get ( 'project_id' ) != attributes . get ( 'tenant_id' ) ) : msg = _ ( "'project_id' and 'tenant_id' do not match" ) raise webob . exc . HTTPBadRequest ( msg ) return attributes
ensure that both project_id and tenant_id attributes are present .