Best Python code snippet using localstack_python
install.py
Source:install.py
...46# TODO: 2019-10-09: Temporarily overwriting DDB, as we're hitting a SIGSEGV JVM crash with the latest version47OVERWRITE_DDB_FILES_IN_DOCKER = False48# set up logger49LOG = logging.getLogger(__name__)50def get_elasticsearch_install_version(version=None):51 if config.SKIP_INFRA_DOWNLOADS:52 return ELASTICSEARCH_DEFAULT_VERSION53 return version or ELASTICSEARCH_DEFAULT_VERSION54def get_elasticsearch_install_dir(version=None):55 version = get_elasticsearch_install_version(version)56 if version == ELASTICSEARCH_DEFAULT_VERSION and not os.path.exists(MARKER_FILE_LIGHT_VERSION):57 # install the default version into a subfolder of the code base58 install_dir = os.path.join(INSTALL_DIR_INFRA, 'elasticsearch')59 else:60 install_dir = os.path.join(config.TMP_FOLDER, 'elasticsearch', version)61 return install_dir62def install_elasticsearch(version=None):63 version = get_elasticsearch_install_version(version)64 install_dir = get_elasticsearch_install_dir(version)65 installed_executable = os.path.join(install_dir, 'bin', 'elasticsearch')66 if not os.path.exists(installed_executable):67 log_install_msg('Elasticsearch (%s)' % version)68 es_url = ELASTICSEARCH_URLS.get(version)69 if not es_url:70 raise Exception('Unable to find download URL for Elasticsearch version "%s"' % version)71 install_dir_parent = os.path.dirname(install_dir)72 mkdir(install_dir_parent)73 # download and extract archive74 tmp_archive = os.path.join(config.TMP_FOLDER, 'localstack.%s' % os.path.basename(es_url))75 download_and_extract_with_retry(es_url, tmp_archive, install_dir_parent)76 elasticsearch_dir = glob.glob(os.path.join(install_dir_parent, 'elasticsearch*'))77 if not elasticsearch_dir:...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!