def force_release(hosts_to_release, username=None):
 hosts = models.Host.smart_get_bulk(hosts_to_release)
 if (not hosts):
  raise Exception('At least one host must be specified')
 user = get_user(username)
 if (not user.is_superuser()):
  raise Exception('Must be super user to force release')
 acls = models.AclGroup.objects.all()
 for user_acl in acls:
  user_acl.hosts.remove(*hosts)
  user_acl.on_host_membership_change()

def force_release ( hosts_to_release , username = None ) : hosts = models . Host . smart_get_bulk ( hosts_to_release ) if ( not hosts ) : raise Exception ( 'At least one host must be specified' ) user = get_user ( username ) if ( not user . is_superuser ( ) ) : raise Exception ( 'Must be super user to force release' ) acls = models . AclGroup . objects . all ( ) for user_acl in acls : user_acl . hosts . remove ( * hosts ) user_acl . on_host_membership_change ( )
force release a collection of hosts from user this will remove all acls from the hosts .