diff --git a/sapl/legacy/migracao_usuarios.py b/sapl/legacy/migracao_usuarios.py index 6fa9cc7ea..fade2cbea 100644 --- a/sapl/legacy/migracao_usuarios.py +++ b/sapl/legacy/migracao_usuarios.py @@ -71,7 +71,7 @@ def migrar_usuarios(dir_repo): ARQUIVO_USUARIOS = Path(dir_repo).child('usuarios.yaml') with open(ARQUIVO_USUARIOS, 'r') as f: - usuarios = yaml.load(f, yaml.Loader) + usuarios = yaml.load(f, yaml.SafeLoader) # conferimos de que só há um nome de usuário assert all(nome == dados['name'] for nome, dados in usuarios.items()) usuarios = [ diff --git a/sapl/legacy/scripts/ressuscita_dependencias.py b/sapl/legacy/scripts/ressuscita_dependencias.py index e45143567..7564e6a02 100644 --- a/sapl/legacy/scripts/ressuscita_dependencias.py +++ b/sapl/legacy/scripts/ressuscita_dependencias.py @@ -198,7 +198,7 @@ Para facilitar sua conferência, seguem os links para as proposições envolvida def get_dependencias_a_ressuscitar(slug): ocorrencias = yaml.load( Path(DIR_REPO.child('ocorrencias.yaml').read_file()), - yaml.Loader + yaml.SafeLoader ) fks_faltando = ocorrencias.get('fk') if not fks_faltando: @@ -414,7 +414,7 @@ def get_ressuscitar(slug): def get_slug(): arq = DIR_DADOS_MIGRACAO.child('siglas_para_slugs.yaml') with open(arq, 'r') as arq: - siglas_para_slugs = yaml.load(arq, yaml.Loader) + siglas_para_slugs = yaml.load(arq, yaml.SafeLoader) sigla = NOME_BANCO_LEGADO[-3:] return siglas_para_slugs[sigla] diff --git a/sapl/legacy_migration_settings.py b/sapl/legacy_migration_settings.py index 463fbb7a6..4ddf2d162 100644 --- a/sapl/legacy_migration_settings.py +++ b/sapl/legacy_migration_settings.py @@ -54,7 +54,7 @@ match = re.match('sapl_cm_(.*)', NOME_BANCO_LEGADO) SIGLA_CASA = match.group(1) _PATH_TABELA_TIMEZONES = DIR_DADOS_MIGRACAO.child('tabela_timezones.yaml') with open(_PATH_TABELA_TIMEZONES, 'r') as arq: - tabela_timezones = yaml.load(arq, yaml.Loader) + tabela_timezones = yaml.load(arq, yaml.SafeLoader) municipio, uf, nome_timezone = tabela_timezones[SIGLA_CASA] if nome_timezone: PYTZ_TIMEZONE = pytz.timezone(nome_timezone) diff --git a/sapl/test_crispy_layout_mixin.py b/sapl/test_crispy_layout_mixin.py index a643d5083..35441092f 100644 --- a/sapl/test_crispy_layout_mixin.py +++ b/sapl/test_crispy_layout_mixin.py @@ -18,7 +18,7 @@ ModelName: - highlander ''' with mock.patch('sapl.crispy_layout_mixin.read_yaml_from_file') as ryff: - ryff.return_value = yaml.load(stub_content, yaml.Loader) + ryff.return_value = yaml.load(stub_content, yaml.SafeLoader) assert read_layout_from_yaml('....', 'ModelName') == [ ['Cool Legend', [('name', 9), ('place', 2), ('tiny', 1)],