Multi env support and Kube client integration
Kube friendly Beta
Package versions supports Kube env
Added:
- Env type detection
- New option: --use-env, for selecting env
when function supports multiple detected envs
- Updated config loading
- Each module and command type has supported env check
and stops execution if it is on unsupported env
- Functions can support multiple envs
- Kubernetes dependency
- Kubenernetes API detection: local and remote
- Package checking class hierachy for using Salt or Kube
- Remote pod execution routine
- Flexible SSH/SSH Forwarder classes: with, ssh,do(), etc
- Multithreaded SSH script execution
- Number of workers parameter, default 5
Fixed:
- Config dependency
- Command loading with supported envs list
- Unittests structure and execution flow updated
- Unittests fixes
- Fixed debug mode handling
- Unified command type/support routine
- Nested attrs getter/setter
Change-Id: I3ade693ac21536e2b5dcee4b24d511749dc72759
Related-PROD: PROD-35811
diff --git a/cfg_checker/modules/reclass/__init__.py b/cfg_checker/modules/reclass/__init__.py
index 88b287e..8d498c3 100644
--- a/cfg_checker/modules/reclass/__init__.py
+++ b/cfg_checker/modules/reclass/__init__.py
@@ -1,6 +1,7 @@
import os
from cfg_checker.common import logger_cli
+from cfg_checker.common.settings import ENV_TYPE_LINUX
from cfg_checker.helpers import args_utils
from cfg_checker.reports import reporter
@@ -9,6 +10,7 @@
from . import validator
command_help = "Reclass related checks and reports"
+supported_envs = [ENV_TYPE_LINUX]
def init_parser(_parser):
@@ -48,7 +50,10 @@
return _parser
-def do_list(args):
+def do_list(args, config):
+ # Check if there is supported env found
+ args_utils.check_supported_env(ENV_TYPE_LINUX, args, config)
+ # Start command
logger_cli.info("# Reclass list")
_arg_path = args_utils.get_arg(args, 'models_path')
logger_cli.info("-> Current path is: {}".format(_arg_path))
@@ -78,7 +83,10 @@
return
-def do_diff(args):
+def do_diff(args, config):
+ # Check if there is supported env found
+ args_utils.check_supported_env(ENV_TYPE_LINUX, args, config)
+ # Start command
logger_cli.info("# Reclass comparer (HTML report)")
_filename = args_utils.get_arg(args, 'html')
# checking folder params