Add copyright info to all python files and bump version
Related-PROD: PROD-36846
Change-Id: I47c25d81d4173286e1729cef7a1cc321a495316f
diff --git a/cfg_checker/common/__init__.py b/cfg_checker/common/__init__.py
index 6eecf92..badea96 100644
--- a/cfg_checker/common/__init__.py
+++ b/cfg_checker/common/__init__.py
@@ -1,3 +1,5 @@
+# Author: Alex Savatieiev (osavatieiev@mirantis.com; a.savex@gmail.com)
+# Copyright 2019-2022 Mirantis, Inc.
from cfg_checker.common.log import logger, logger_cli
from cfg_checker.common.other import Utils
diff --git a/cfg_checker/common/config_file.py b/cfg_checker/common/config_file.py
index 513e0ec..5f9dd55 100644
--- a/cfg_checker/common/config_file.py
+++ b/cfg_checker/common/config_file.py
@@ -1,3 +1,5 @@
+# Author: Alex Savatieiev (osavatieiev@mirantis.com; a.savex@gmail.com)
+# Copyright 2019-2022 Mirantis, Inc.
import configparser
import os
diff --git a/cfg_checker/common/const.py b/cfg_checker/common/const.py
index 95497ec..ac7b2ca 100644
--- a/cfg_checker/common/const.py
+++ b/cfg_checker/common/const.py
@@ -1,3 +1,5 @@
+# Author: Alex Savatieiev (osavatieiev@mirantis.com; a.savex@gmail.com)
+# Copyright 2019-2022 Mirantis, Inc.
"""Constants that is not to be changed and used in all other files
"""
diff --git a/cfg_checker/common/decorators.py b/cfg_checker/common/decorators.py
index a8b6da0..1b39460 100644
--- a/cfg_checker/common/decorators.py
+++ b/cfg_checker/common/decorators.py
@@ -1,5 +1,5 @@
# Author: https://gist.github.com/FBosler/be10229aba491a8c912e3a1543bbc74e
-# Updated to fit current framework by Alex Savatieiev
+# Updated to fit current framework by Alex Savatieiev (a.savex@gmail.com)
from functools import wraps
import time
diff --git a/cfg_checker/common/exception.py b/cfg_checker/common/exception.py
index 4ee3a99..354fb16 100644
--- a/cfg_checker/common/exception.py
+++ b/cfg_checker/common/exception.py
@@ -1,4 +1,5 @@
-
+# Author: Alex Savatieiev (osavatieiev@mirantis.com; a.savex@gmail.com)
+# Copyright 2019-2022 Mirantis, Inc.
class CheckerBaseExceptions(Exception):
pass
diff --git a/cfg_checker/common/file_utils.py b/cfg_checker/common/file_utils.py
index faf7cf0..8b1652a 100644
--- a/cfg_checker/common/file_utils.py
+++ b/cfg_checker/common/file_utils.py
@@ -1,3 +1,5 @@
+# Author: Alex Savatieiev (osavatieiev@mirantis.com; a.savex@gmail.com)
+# Copyright 2019-2022 Mirantis, Inc.
import atexit
import grp
import os
diff --git a/cfg_checker/common/kube_utils.py b/cfg_checker/common/kube_utils.py
index 6f303ff..195e791 100644
--- a/cfg_checker/common/kube_utils.py
+++ b/cfg_checker/common/kube_utils.py
@@ -1,3 +1,5 @@
+# Author: Alex Savatieiev (osavatieiev@mirantis.com; a.savex@gmail.com)
+# Copyright 2019-2022 Mirantis, Inc.
"""
Module to handle interaction with Kube
"""
@@ -962,3 +964,68 @@
pod_object.metadata.namespace,
_svc
)
+
+ def get_pod_logs(self, podname, ns):
+ # Params
+ # read log of the specified Pod # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True
+
+ # >>> thread = api.read_namespaced_pod_log(name, namespace,
+ # async_req=True)
+ # >>> result = thread.get()
+ # :param async_req bool: execute request asynchronously
+ # :param str name: name of the Pod (required)
+ # :param str namespace: object name and auth scope, such as for teams
+ # and projects (required)
+ # :param str container: The container for which to stream logs.
+ # Defaults to only container if there is one container in
+ # the pod.
+ # :param bool follow: Follow the log stream of the pod. Defaults to
+ # false.
+ # :param bool insecure_skip_tls_verify_backend:
+ # insecureSkipTLSVerifyBackend indicates that the apiserver
+ # should not confirm the validity of the serving certificate
+ # of the backend it is connecting to. This will make the
+ # HTTPS connection between the apiserver and the backend
+ # insecure. This means the apiserver cannot verify the log
+ # data it is receiving came from the real kubelet. If the
+ # kubelet is configured to verify the apiserver's TLS
+ # credentials, it does not mean the connection to the real
+ # kubelet is vulnerable to a man in the middle attack (e.g.
+ # an attacker could not intercept the actual log data coming
+ # from the real kubelet).
+ # :param int limit_bytes: If set, the number of bytes to read from the
+ # server before terminating the log output. This may not
+ # display a complete final line of logging, and may return
+ # slightly more or slightly less than the specified limit.
+ # :param str pretty: If 'true', then the output is pretty printed.
+ # :param bool previous: Return previous terminated container logs.
+ # Defaults to false.
+ # :param int since_seconds: A relative time in seconds before the
+ # current time from which to show logs. If this value precedes
+ # the time a pod was started, only logs since the pod start will
+ # be returned. If this value is in the future, no logs will be
+ # returned. Only one of sinceSeconds or sinceTime may be
+ # specified.
+ # :param int tail_lines: If set, the number of lines from the end of
+ # the logs to show. If not specified, logs are shown from the
+ # creation of the container or sinceSeconds or sinceTime
+ # :param bool timestamps: If true, add an RFC3339 or RFC3339Nano
+ # timestamp at the beginning of every line of log output.
+ # Defaults to false.
+ # :param _preload_content: if False, the urllib3.HTTPResponse object
+ # will be returned without reading/decoding response data.
+ # Default is True.
+ # :param _request_timeout: timeout setting for this request. If one
+ # number provided, it will be total request timeout. It can
+ # also be a pair (tuple) of (connection, read) timeouts.
+ # :return: str
+ # If the method is called asynchronously, returns the request
+ # thread.
+
+ return self.CoreV1.read_namespaced_pod_log(
+ podname,
+ ns,
+ # timestamps=True,
+ tail_lines=50,
+ # pretty=True
+ )
diff --git a/cfg_checker/common/log.py b/cfg_checker/common/log.py
index 4c1c02c..d1f053c 100644
--- a/cfg_checker/common/log.py
+++ b/cfg_checker/common/log.py
@@ -1,3 +1,5 @@
+# Author: Alex Savatieiev (osavatieiev@mirantis.com; a.savex@gmail.com)
+# Copyright 2019-2022 Mirantis, Inc.
import logging
import os
diff --git a/cfg_checker/common/other.py b/cfg_checker/common/other.py
index b5a0406..4c3ef04 100644
--- a/cfg_checker/common/other.py
+++ b/cfg_checker/common/other.py
@@ -1,3 +1,5 @@
+# Author: Alex Savatieiev (osavatieiev@mirantis.com; a.savex@gmail.com)
+# Copyright 2019-2022 Mirantis, Inc.
import functools
import os
import re
diff --git a/cfg_checker/common/salt_utils.py b/cfg_checker/common/salt_utils.py
index 08f2d2b..97d806f 100644
--- a/cfg_checker/common/salt_utils.py
+++ b/cfg_checker/common/salt_utils.py
@@ -1,3 +1,5 @@
+# Author: Alex Savatieiev (osavatieiev@mirantis.com; a.savex@gmail.com)
+# Copyright 2019-2022 Mirantis, Inc.
"""
Module to handle interaction with salt
"""
diff --git a/cfg_checker/common/settings.py b/cfg_checker/common/settings.py
index 7b79354..f24cc33 100644
--- a/cfg_checker/common/settings.py
+++ b/cfg_checker/common/settings.py
@@ -1,3 +1,5 @@
+# Author: Alex Savatieiev (osavatieiev@mirantis.com; a.savex@gmail.com)
+# Copyright 2019-2022 Mirantis, Inc.
import os
import json
import pwd
diff --git a/cfg_checker/common/ssh_utils.py b/cfg_checker/common/ssh_utils.py
index d500e36..7ab2ea5 100644
--- a/cfg_checker/common/ssh_utils.py
+++ b/cfg_checker/common/ssh_utils.py
@@ -1,3 +1,5 @@
+# Author: Alex Savatieiev (osavatieiev@mirantis.com; a.savex@gmail.com)
+# Copyright 2019-2022 Mirantis, Inc.
import queue
import subprocess
import traceback