From 5e4f36a6ed114989a64564c09793a4e01b1a3c74 Mon Sep 17 00:00:00 2001 From: William Cannon Date: Wed, 26 Jul 2017 15:16:54 -0700 Subject: [PATCH] removing use of salt.utils --- salt/modules/saltcheck.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/salt/modules/saltcheck.py b/salt/modules/saltcheck.py index b233b5ecc7..02656b0a6d 100644 --- a/salt/modules/saltcheck.py +++ b/salt/modules/saltcheck.py @@ -7,9 +7,8 @@ import logging import os import time import yaml -import collections try: - import salt.utils + # import salt.utils import salt.client import salt.exceptions except ImportError: @@ -124,8 +123,7 @@ def run_highstate_tests(): salt '*' salt_check.run_highstate_tests ''' states = _get_top_states() - #all_states = {} - all_states = collections.OrderedDict() + all_states = {} for sta in states: log.info("State Name = {}".format(sta)) all_states.update(run_state_tests(sta)) @@ -208,8 +206,8 @@ class SaltCheck(object): # log.info("modules are: {}".format(self.modules)) # self.salt_lc = salt.client.Caller(mopts=__opts__) self.salt_lc = salt.client.Caller() - if self.auto_update_master_cache: - update_master_cache() + # if self.auto_update_master_cache: + # update_master_cache() def __is_valid_test(self, test_dict): '''Determine if a test contains: @@ -481,7 +479,8 @@ class StateTestLoader(object): loads in one test file ''' try: - with salt.utils.files.fopen(filepath, 'r') as myfile: + # with salt.utils.files.fopen(filepath, 'r') as myfile: + with open(filepath, 'r') as myfile: contents_yaml = yaml.load(myfile) for key, value in contents_yaml.items(): self.test_dict[key] = value