def stop_app(app_name):
 if (not misc.is_app_name_valid(app_name)):
  logging.error(('Unable to kill app process %s on because of invalid name for application' % app_name))
  return False
 logging.info(('Stopping application %s' % app_name))
 watch = ('app___' + app_name)
 monit_result = monit_interface.stop(watch)
 if (not monit_result):
  logging.error(('Unable to shut down monit interface for watch %s' % watch))
  return False
 config_files = glob.glob('{}/appscale-{}-*.cfg'.format(MONIT_CONFIG_DIR, watch))
 for config_file in config_files:
  try:
   os.remove(config_file)
  except OSError:
   logging.exception('Error removing {}'.format(config_file))
 if (not remove_logrotate(app_name)):
  logging.error('Error while setting up log rotation for application: {}'.format(app_name))
 return True

def stop_app ( app_name ) : if ( not misc . is_app_name_valid ( app_name ) ) : logging . error ( ( 'Unable to kill app process %s on because of invalid name for application' % app_name ) ) return False logging . info ( ( 'Stopping application %s' % app_name ) ) watch = ( 'app___' + app_name ) monit_result = monit_interface . stop ( watch ) if ( not monit_result ) : logging . error ( ( 'Unable to shut down monit interface for watch %s' % watch ) ) return False config_files = glob . glob ( '{}/appscale-{}-*.cfg' . format ( MONIT_CONFIG_DIR , watch ) ) for config_file in config_files : try : os . remove ( config_file ) except OSError : logging . exception ( 'Error removing {}' . format ( config_file ) ) if ( not remove_logrotate ( app_name ) ) : logging . error ( 'Error while setting up log rotation for application: {}' . format ( app_name ) ) return True
stops all process instances of a google app engine application on this machine .