def stop_app_instance(app_name, port):
 if (not misc.is_app_name_valid(app_name)):
  logging.error(('Unable to kill app process %s on port %d because of invalid name for application' % (app_name, int(port))))
  return False
 logging.info(('Stopping application %s' % app_name))
 watch = ((('app___' + app_name) + '-') + str(port))
 if (not monit_interface.stop(watch, is_group=False)):
  logging.error('Unable to stop application server for app {0} on port {1}'.format(app_name, port))
  return False
 monit_config_file = '{}/appscale-{}.cfg'.format(MONIT_CONFIG_DIR, watch)
 try:
  os.remove(monit_config_file)
 except OSError as os_error:
  logging.error('Error deleting {0}'.format(monit_config_file))
 return True

def stop_app_instance ( app_name , port ) : if ( not misc . is_app_name_valid ( app_name ) ) : logging . error ( ( 'Unable to kill app process %s on port %d because of invalid name for application' % ( app_name , int ( port ) ) ) ) return False logging . info ( ( 'Stopping application %s' % app_name ) ) watch = ( ( ( 'app___' + app_name ) + '-' ) + str ( port ) ) if ( not monit_interface . stop ( watch , is_group = False ) ) : logging . error ( 'Unable to stop application server for app {0} on port {1}' . format ( app_name , port ) ) return False monit_config_file = '{}/appscale-{}.cfg' . format ( MONIT_CONFIG_DIR , watch ) try : os . remove ( monit_config_file ) except OSError as os_error : logging . error ( 'Error deleting {0}' . format ( monit_config_file ) ) return True
stops a google app engine application process instance on current machine .