def unregister_distributed_server():
 if settings.CENTRAL_SERVER:
  raise CommandError("'Unregister' does not make sense for a central server.  Aborting!")
 own_device = Device.get_own_device()
 (tmp, settings.DEBUG_ALLOW_DELETIONS) = (settings.DEBUG_ALLOW_DELETIONS, True)
 DeviceZone.objects.filter(device=own_device).delete()
 Zone.objects.all().delete()
 Device.objects.filter(devicemetadata__is_trusted=True).delete()
 settings.DEBUG_ALLOW_DELETIONS = tmp

def unregister_distributed_server ( ) : if settings . CENTRAL_SERVER : raise CommandError ( "'Unregister' does not make sense for a central server.  Aborting!" ) own_device = Device . get_own_device ( ) ( tmp , settings . DEBUG_ALLOW_DELETIONS ) = ( settings . DEBUG_ALLOW_DELETIONS , True ) DeviceZone . objects . filter ( device = own_device ) . delete ( ) Zone . objects . all ( ) . delete ( ) Device . objects . filter ( devicemetadata__is_trusted = True ) . delete ( ) settings . DEBUG_ALLOW_DELETIONS = tmp
all local steps necessary for unregistering a server with a central server .