mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00
Fix lint issues after the pyyaml
package upgrade
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
parent
410e70bfda
commit
06504a4ec7
2 changed files with 8 additions and 9 deletions
|
@ -13,10 +13,9 @@ import logging
|
|||
import os
|
||||
import re
|
||||
|
||||
import yaml
|
||||
|
||||
import salt.utils.json
|
||||
import salt.utils.platform
|
||||
import salt.utils.yaml
|
||||
from salt.exceptions import CommandExecutionError, SaltInvocationError
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
@ -187,7 +186,7 @@ def _prepare_settings(pspath, settings):
|
|||
match = re.search(r"Collection\[(\{.*\})\]", setting["name"])
|
||||
if match:
|
||||
name = setting["name"][: match.start(1) - 1]
|
||||
match_dict = yaml.load(match.group(1))
|
||||
match_dict = salt.utils.yaml.load(match.group(1))
|
||||
index = _collection_match_to_index(
|
||||
pspath, setting["filter"], name, match_dict
|
||||
)
|
||||
|
|
|
@ -10,10 +10,10 @@ import time
|
|||
import traceback
|
||||
|
||||
import pytest
|
||||
import yaml
|
||||
|
||||
import salt.utils.files
|
||||
import salt.utils.win_runas
|
||||
import salt.utils.yaml
|
||||
from tests.support.case import ModuleCase
|
||||
from tests.support.helpers import with_system_user
|
||||
from tests.support.mock import Mock
|
||||
|
@ -658,7 +658,7 @@ class RunAsTest(ModuleCase):
|
|||
win32serviceutil.StartService("test service")
|
||||
wait_for_service("test service")
|
||||
with salt.utils.files.fopen(RUNAS_OUT, "r") as fp:
|
||||
ret = yaml.load(fp)
|
||||
ret = salt.utils.yaml.safe_load(fp)
|
||||
assert ret["retcode"] == 1, ret
|
||||
|
||||
@with_system_user(
|
||||
|
@ -676,7 +676,7 @@ class RunAsTest(ModuleCase):
|
|||
win32serviceutil.StartService("test service")
|
||||
wait_for_service("test service")
|
||||
with salt.utils.files.fopen(RUNAS_OUT, "r") as fp:
|
||||
ret = yaml.load(fp)
|
||||
ret = salt.utils.yaml.safe_load(fp)
|
||||
assert ret["retcode"] == 1, ret
|
||||
|
||||
@with_system_user(
|
||||
|
@ -698,7 +698,7 @@ class RunAsTest(ModuleCase):
|
|||
win32serviceutil.StartService("test service")
|
||||
wait_for_service("test service")
|
||||
with salt.utils.files.fopen(RUNAS_OUT, "r") as fp:
|
||||
ret = yaml.load(fp)
|
||||
ret = salt.utils.yaml.safe_load(fp)
|
||||
assert ret["retcode"] == 0, ret
|
||||
|
||||
@with_system_user(
|
||||
|
@ -720,7 +720,7 @@ class RunAsTest(ModuleCase):
|
|||
win32serviceutil.StartService("test service")
|
||||
wait_for_service("test service")
|
||||
with salt.utils.files.fopen(RUNAS_OUT, "r") as fp:
|
||||
ret = yaml.load(fp)
|
||||
ret = salt.utils.yaml.safe_load(fp)
|
||||
assert ret["retcode"] == 0, ret
|
||||
|
||||
def test_runas_service_system_user(self):
|
||||
|
@ -735,5 +735,5 @@ class RunAsTest(ModuleCase):
|
|||
win32serviceutil.StartService("test service")
|
||||
wait_for_service("test service")
|
||||
with salt.utils.files.fopen(RUNAS_OUT, "r") as fp:
|
||||
ret = yaml.load(fp)
|
||||
ret = salt.utils.yaml.safe_load(fp)
|
||||
assert ret["retcode"] == 0, ret
|
||||
|
|
Loading…
Add table
Reference in a new issue