removing use of salt.utils

This commit is contained in:
William Cannon 2017-07-26 15:16:54 -07:00
parent 23fb0fa44e
commit 5e4f36a6ed

View File

@ -7,9 +7,8 @@ import logging
import os import os
import time import time
import yaml import yaml
import collections
try: try:
import salt.utils # import salt.utils
import salt.client import salt.client
import salt.exceptions import salt.exceptions
except ImportError: except ImportError:
@ -124,8 +123,7 @@ def run_highstate_tests():
salt '*' salt_check.run_highstate_tests salt '*' salt_check.run_highstate_tests
''' '''
states = _get_top_states() states = _get_top_states()
#all_states = {} all_states = {}
all_states = collections.OrderedDict()
for sta in states: for sta in states:
log.info("State Name = {}".format(sta)) log.info("State Name = {}".format(sta))
all_states.update(run_state_tests(sta)) all_states.update(run_state_tests(sta))
@ -208,8 +206,8 @@ class SaltCheck(object):
# log.info("modules are: {}".format(self.modules)) # log.info("modules are: {}".format(self.modules))
# self.salt_lc = salt.client.Caller(mopts=__opts__) # self.salt_lc = salt.client.Caller(mopts=__opts__)
self.salt_lc = salt.client.Caller() self.salt_lc = salt.client.Caller()
if self.auto_update_master_cache: # if self.auto_update_master_cache:
update_master_cache() # update_master_cache()
def __is_valid_test(self, test_dict): def __is_valid_test(self, test_dict):
'''Determine if a test contains: '''Determine if a test contains:
@ -481,7 +479,8 @@ class StateTestLoader(object):
loads in one test file loads in one test file
''' '''
try: 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) contents_yaml = yaml.load(myfile)
for key, value in contents_yaml.items(): for key, value in contents_yaml.items():
self.test_dict[key] = value self.test_dict[key] = value