def check_environment():
 options = type('Options', (object,), {})()
 options.ci_flags = os.getenv('CI_FLAGS', '')
 options.aws_region = os.getenv('DEFAULT_AWS_REGION', 'eu-central-1')
 options.gateway = os.getenv('DCOS_ADVANCED_GATEWAY', None)
 options.vpc = os.getenv('DCOS_ADVANCED_VPC', None)
 options.private_subnet = os.getenv('DCOS_ADVANCED_PRIVATE_SUBNET', None)
 options.public_subnet = os.getenv('DCOS_ADVANCED_PUBLIC_SUBNET', None)
 options.host_os = os.getenv('DCOS_HOST_OS', 'coreos')
 options.agents = int(os.environ.get('AGENTS', '2'))
 options.public_agents = int(os.environ.get('PUBLIC_AGENTS', '1'))
 options.ssh_key_path = os.getenv('DCOS_SSH_KEY_PATH', 'default_ssh_key')
 options.stack_name = os.getenv('DCOS_STACK_NAME', None)
 options.template_url = os.getenv('DCOS_TEMPLATE_URL', None)
 if (not options.template_url):
  assert (options.stack_name is not None), 'if DCOS_TEMPLATE_URL is not provided, then DCOS_STACK_NAME must be specified'
  advanced = os.getenv('DCOS_ADVANCED_TEMPLATE', None)
  assert (advanced is not None), 'if using DCOS_STACK_NAME, then DCOS_ADVANCED_TEMPLATE=[true/false] must be specified'
  options.advanced = (advanced == 'true')
 else:
  options.advanced = ((not options.template_url.endswith('single-master.cloudformation.json')) and (not options.template_url.endswith('multi-master.cloudformation.json')))
 options.aws_access_key_id = calculate_environment_variable('AWS_ACCESS_KEY_ID')
 options.aws_secret_access_key = calculate_environment_variable('AWS_SECRET_ACCESS_KEY')
 add_env = []
 prefix = 'TEST_ADD_ENV_'
 for (k, v) in os.environ.items():
  if k.startswith(prefix):
   add_env.append(((k.replace(prefix, '') + '=') + v))
 options.test_cmd = os.getenv('DCOS_PYTEST_CMD', ((' '.join(add_env) + ' py.test -vv -s -rs ') + options.ci_flags))
 return options

def check_environment ( ) : options = type ( 'Options' , ( object , ) , { } ) ( ) options . ci_flags = os . getenv ( 'CI_FLAGS' , '' ) options . aws_region = os . getenv ( 'DEFAULT_AWS_REGION' , 'eu-central-1' ) options . gateway = os . getenv ( 'DCOS_ADVANCED_GATEWAY' , None ) options . vpc = os . getenv ( 'DCOS_ADVANCED_VPC' , None ) options . private_subnet = os . getenv ( 'DCOS_ADVANCED_PRIVATE_SUBNET' , None ) options . public_subnet = os . getenv ( 'DCOS_ADVANCED_PUBLIC_SUBNET' , None ) options . host_os = os . getenv ( 'DCOS_HOST_OS' , 'coreos' ) options . agents = int ( os . environ . get ( 'AGENTS' , '2' ) ) options . public_agents = int ( os . environ . get ( 'PUBLIC_AGENTS' , '1' ) ) options . ssh_key_path = os . getenv ( 'DCOS_SSH_KEY_PATH' , 'default_ssh_key' ) options . stack_name = os . getenv ( 'DCOS_STACK_NAME' , None ) options . template_url = os . getenv ( 'DCOS_TEMPLATE_URL' , None ) if ( not options . template_url ) : assert ( options . stack_name is not None ) , 'if DCOS_TEMPLATE_URL is not provided, then DCOS_STACK_NAME must be specified' advanced = os . getenv ( 'DCOS_ADVANCED_TEMPLATE' , None ) assert ( advanced is not None ) , 'if using DCOS_STACK_NAME, then DCOS_ADVANCED_TEMPLATE=[true/false] must be specified' options . advanced = ( advanced == 'true' ) else : options . advanced = ( ( not options . template_url . endswith ( 'single-master.cloudformation.json' ) ) and ( not options . template_url . endswith ( 'multi-master.cloudformation.json' ) ) ) options . aws_access_key_id = calculate_environment_variable ( 'AWS_ACCESS_KEY_ID' ) options . aws_secret_access_key = calculate_environment_variable ( 'AWS_SECRET_ACCESS_KEY' ) add_env = [ ] prefix = 'TEST_ADD_ENV_' for ( k , v ) in os . environ . items ( ) : if k . startswith ( prefix ) : add_env . append ( ( ( k . replace ( prefix , '' ) + '=' ) + v ) ) options . test_cmd = os . getenv ( 'DCOS_PYTEST_CMD' , ( ( ' ' . join ( add_env ) + ' py.test -vv -s -rs ' ) + options . ci_flags ) ) return options
check what environment this is running in .