+def __create_snaps_env_yaml(var_config_values, vm_dict):
+ """
+ Creates a yaml file containing an OpenStack pod's credentials with a list
+ of server IDs that can be used for obtaining SNAPS-OO instances for
+ manipulation such as rebooting
+ :param var_config_values: the configuration dictionary
+ :param os_creds: the admin credentials for accessing OpenStack
+ :param vm_dict: the dictionary containing all vm creators where the
+ key is the name
+ :return: the name of the generated file
+ """
+ out_dict = dict()
+ out_dict['vms'] = list()
+
+ for name, vm_creator in vm_dict.items():
+ vm_inst = vm_creator.get_vm_inst()
+ inst_creds = vm_creator._os_creds
+ if vm_inst:
+ out_dict['vms'].append({
+ 'name': str(vm_inst.name),
+ 'id': str(vm_inst.id),
+ 'os_creds': {
+ 'username': inst_creds.username,
+ 'password': inst_creds.password,
+ 'auth_url': inst_creds.auth_url,
+ 'project_name': inst_creds.project_name,
+ 'identity_api_version': inst_creds.identity_api_version,
+ }
+ })
+
+ out_file = file_utils.persist_dict_to_yaml(
+ out_dict, var_config_values.get('file_name'))
+
+ if out_file:
+ return out_file.name
+
+