if yamlfile is None:
return None
- dict = yaml.load(tar.extractfile(yamlfile))
+ dict = yaml.safe_load(tar.extractfile(yamlfile))
result = {}
for k1, v1 in list(dict.items()):
if not k1.endswith('-catalog'):
raise ClientException('in absence of descriptor file, option "--vim_account" is mandatory (at least once)')
else:
with open(descriptor_file, 'r') as df:
- pdu = yaml.load(df.read())
+ pdu = yaml.safe_load(df.read())
if name: pdu["name"] = name
if pdu_type: pdu["type"] = pdu_type
if description: pdu["description"] = description
op_data['vdu_count_index'] = vdu_count
op_data['primitive'] = action_name
if params:
- op_data['primitive_params'] = yaml.load(params)
+ op_data['primitive_params'] = yaml.safe_load(params)
else:
op_data['primitive_params'] = {}
ctx.obj.ns.exec_op(ns_name, op_name='action', op_data=op_data, wait=wait)
with open(pubkeyfile, 'r') as f:
ns['ssh_keys'].append(f.read())
if config:
- ns_config = yaml.load(config)
+ ns_config = yaml.safe_load(config)
if "vim-network-name" in ns_config:
ns_config["vld"] = ns_config.pop("vim-network-name")
if "vld" in ns_config:
with open(pubkeyfile, 'r') as f:
nsi['ssh_keys'].append(f.read())
if config:
- nsi_config = yaml.load(config)
+ nsi_config = yaml.safe_load(config)
if "netslice-vld" in nsi_config:
for vld in nsi_config["netslice-vld"]:
if vld.get("vim-network-name"):
role = {"name": name}
if permissions:
- role_permissions = yaml.load(permissions)
+ role_permissions = yaml.safe_load(permissions)
if not isinstance(role_permissions, dict):
raise ClientException('Role permissions should be provided in a key-value fashion')
new_role_obj["name"] = new_name
if permissions:
- role_definition = yaml.load(permissions)
+ role_definition = yaml.safe_load(permissions)
if not isinstance(role_definition, dict):
raise ClientException('Role permissions should be provided in a key-value fashion')
new_role_obj["permissions"] = role_definition
else:
if remove:
- keys_from_remove = yaml.load(remove)
+ keys_from_remove = yaml.safe_load(remove)
if not isinstance(keys_from_remove, list):
raise ClientException('Keys should be provided in a list fashion')
new_role_obj["permissions"][key] = None
if add:
- add_roles = yaml.load(add)
+ add_roles = yaml.safe_load(add)
if not isinstance(add_roles, dict):
raise ClientException('Add should be provided in a key-value fashion')
ns_config = {}
if config:
- ns_config = yaml.load(config)
+ ns_config = yaml.safe_load(config)
if ns_config and 'vim-network-name' in ns_config:
for network in ns_config['vim-network-name']:
vim_config = {}
if 'config' in vim_access and vim_access['config'] is not None:
- vim_config = yaml.load(vim_access['config'])
+ vim_config = yaml.safe_load(vim_access['config'])
if vim_config:
vim_account['datacenter']['config'] = vim_config