def multi_file_load_config(*filenames):
 configs = []
 profiles = []
 for filename in filenames:
  try:
   loaded = load_config(filename)
  except botocore.exceptions.ConfigNotFound:
   continue
  profiles.append(loaded.pop('profiles'))
  configs.append(loaded)
 merged_config = _merge_list_of_dicts(configs)
 merged_profiles = _merge_list_of_dicts(profiles)
 merged_config['profiles'] = merged_profiles
 return merged_config

def multi_file_load_config ( * filenames ) : configs = [ ] profiles = [ ] for filename in filenames : try : loaded = load_config ( filename ) except botocore . exceptions . ConfigNotFound : continue profiles . append ( loaded . pop ( 'profiles' ) ) configs . append ( loaded ) merged_config = _merge_list_of_dicts ( configs ) merged_profiles = _merge_list_of_dicts ( profiles ) merged_config [ 'profiles' ] = merged_profiles return merged_config
load and combine multiple ini configs with profiles .