def remove_conflicting_jars(app_name):
 app_dir = (('/var/apps/' + app_name) + '/app/')
 lib_dir = locate_dir(app_dir, 'lib')
 if (not lib_dir):
  logging.warn('Lib directory not found in app code while updating.')
  return
 logging.info('Removing jars from {0}'.format(lib_dir))
 conflicting_jars_pattern = ['appengine-api-1.0-sdk-*.jar', 'appengine-api-stubs-*.jar', 'appengine-api-labs-*.jar', 'appengine-jsr107cache-*.jar', 'jsr107cache-*.jar', 'appengine-mapreduce*.jar', 'appengine-pipeline*.jar', 'appengine-gcs-client*.jar']
 for file in os.listdir(lib_dir):
  for pattern in conflicting_jars_pattern:
   if fnmatch.fnmatch(file, pattern):
    os.remove(((lib_dir + os.sep) + file))

def remove_conflicting_jars ( app_name ) : app_dir = ( ( '/var/apps/' + app_name ) + '/app/' ) lib_dir = locate_dir ( app_dir , 'lib' ) if ( not lib_dir ) : logging . warn ( 'Lib directory not found in app code while updating.' ) return logging . info ( 'Removing jars from {0}' . format ( lib_dir ) ) conflicting_jars_pattern = [ 'appengine-api-1.0-sdk-*.jar' , 'appengine-api-stubs-*.jar' , 'appengine-api-labs-*.jar' , 'appengine-jsr107cache-*.jar' , 'jsr107cache-*.jar' , 'appengine-mapreduce*.jar' , 'appengine-pipeline*.jar' , 'appengine-gcs-client*.jar' ] for file in os . listdir ( lib_dir ) : for pattern in conflicting_jars_pattern : if fnmatch . fnmatch ( file , pattern ) : os . remove ( ( ( lib_dir + os . sep ) + file ) )
removes jars uploaded which may conflict with appscale jars .