Coverage for cfg_checker/clients/__init__.py : 50%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1from cfg_checker.common import logger
2from cfg_checker.common.salt_utils import SaltRemote
4# instance of the salt client
5salt = None
8def get_salt_remote(config):
9 """Singleton-like creation of instance
11 Arguments:
12 config {base_config} -- an instance to base_config
13 with creds and params
15 Returns:
16 SaltRemote -- instance of salt client
17 """
19 global salt
20 logger.info("Creating salt remote instance")
21 # create it once
22 if salt is None:
23 salt = SaltRemote()
24 # do most expensive operation with no strict timeout possible
25 # all nodes that answer ping
26 # salt.nodes_active = salt.get_active_nodes()
28 # return once required
29 return salt