def copy_modified_jars(app_name):
 appscale_home = constants.APPSCALE_HOME
 app_dir = (('/var/apps/' + app_name) + '/app/')
 lib_dir = locate_dir(app_dir, 'lib')
 if (not lib_dir):
  web_inf_dir = locate_dir(app_dir, 'WEB-INF')
  lib_dir = ((web_inf_dir + os.sep) + 'lib')
  logging.info('Creating lib directory at: {0}'.format(lib_dir))
  mkdir_result = subprocess.call(('mkdir ' + lib_dir), shell=True)
  if (mkdir_result != 0):
   logging.error('Failed to create missing lib directory in: {0}.'.format(web_inf_dir))
   return False
 try:
  copy_files_matching_pattern(((appscale_home + '/AppServer_Java/') + 'appengine-java-sdk-repacked/lib/user/*.jar'), lib_dir)
  copy_files_matching_pattern(((appscale_home + '/AppServer_Java/') + 'appengine-java-sdk-repacked/lib/impl/appscale-*.jar'), lib_dir)
  copy_files_matching_pattern('/usr/share/appscale/ext/*', lib_dir)
 except IOError as io_error:
  logging.error(((('Failed to copy modified jar files to lib directory of ' + app_name) + ' due to:') + str(io_error)))
  return False
 return True

def copy_modified_jars ( app_name ) : appscale_home = constants . APPSCALE_HOME app_dir = ( ( '/var/apps/' + app_name ) + '/app/' ) lib_dir = locate_dir ( app_dir , 'lib' ) if ( not lib_dir ) : web_inf_dir = locate_dir ( app_dir , 'WEB-INF' ) lib_dir = ( ( web_inf_dir + os . sep ) + 'lib' ) logging . info ( 'Creating lib directory at: {0}' . format ( lib_dir ) ) mkdir_result = subprocess . call ( ( 'mkdir ' + lib_dir ) , shell = True ) if ( mkdir_result != 0 ) : logging . error ( 'Failed to create missing lib directory in: {0}.' . format ( web_inf_dir ) ) return False try : copy_files_matching_pattern ( ( ( appscale_home + '/AppServer_Java/' ) + 'appengine-java-sdk-repacked/lib/user/*.jar' ) , lib_dir ) copy_files_matching_pattern ( ( ( appscale_home + '/AppServer_Java/' ) + 'appengine-java-sdk-repacked/lib/impl/appscale-*.jar' ) , lib_dir ) copy_files_matching_pattern ( '/usr/share/appscale/ext/*' , lib_dir ) except IOError as io_error : logging . error ( ( ( ( 'Failed to copy modified jar files to lib directory of ' + app_name ) + ' due to:' ) + str ( io_error ) ) ) return False return True
copies the changes made to the java sdk for appscale into the apps lib folder .