def remove_datacenter(module, profitbricks):
 name = module.params.get('name')
 changed = False
 if uuid_match.match(name):
  _remove_datacenter(module, profitbricks, name)
  changed = True
 else:
  datacenters = profitbricks.list_datacenters()
  for d in datacenters['items']:
   vdc = profitbricks.get_datacenter(d['id'])
   if (name == vdc['properties']['name']):
    name = d['id']
    _remove_datacenter(module, profitbricks, name)
    changed = True
 return changed

def remove_datacenter ( module , profitbricks ) : name = module . params . get ( 'name' ) changed = False if uuid_match . match ( name ) : _remove_datacenter ( module , profitbricks , name ) changed = True else : datacenters = profitbricks . list_datacenters ( ) for d in datacenters [ 'items' ] : vdc = profitbricks . get_datacenter ( d [ 'id' ] ) if ( name == vdc [ 'properties' ] [ 'name' ] ) : name = d [ 'id' ] _remove_datacenter ( module , profitbricks , name ) changed = True return changed
removes a datacenter .