def run_on_app_servers(command):
 log.info(('Running %s on app servers' % command))
 ret_val = 0
 if getattr(settings, 'MULTIPLE_APP_SERVERS', None):
  for server in settings.MULTIPLE_APP_SERVERS:
   ret = os.system(('ssh %s@%s %s' % (SYNC_USER, server, command)))
   if (ret != 0):
    ret_val = ret
  return ret_val
 else:
  ret = os.system(command)
  return ret

def run_on_app_servers ( command ) : log . info ( ( 'Running %s on app servers' % command ) ) ret_val = 0 if getattr ( settings , 'MULTIPLE_APP_SERVERS' , None ) : for server in settings . MULTIPLE_APP_SERVERS : ret = os . system ( ( 'ssh %s@%s %s' % ( SYNC_USER , server , command ) ) ) if ( ret != 0 ) : ret_val = ret return ret_val else : ret = os . system ( command ) return ret
a helper to copy a single file across app servers .