mas-cli 11.5.0__tar.gz → 11.7.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of mas-cli might be problematic. Click here for more details.
- {mas_cli-11.5.0 → mas_cli-11.7.0}/PKG-INFO +2 -2
- {mas_cli-11.5.0 → mas_cli-11.7.0}/setup.py +6 -6
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/__init__.py +1 -1
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/cli.py +43 -5
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/gencfg.py +32 -8
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/install/app.py +228 -357
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/install/argBuilder.py +14 -2
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/install/argParser.py +210 -1
- mas_cli-11.7.0/src/mas/cli/install/catalogs.py +141 -0
- mas_cli-11.7.0/src/mas/cli/install/params.py +168 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/install/settings/__init__.py +2 -1
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/install/settings/additionalConfigs.py +11 -11
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/install/settings/db2Settings.py +75 -45
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/install/settings/kafkaSettings.py +14 -10
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/install/settings/manageSettings.py +71 -41
- mas_cli-11.7.0/src/mas/cli/install/settings/mongodbSettings.py +42 -0
- mas_cli-11.7.0/src/mas/cli/install/settings/turbonomicSettings.py +31 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/install/summarizer.py +39 -12
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/ibm-mas-tekton.yaml +1316 -124
- mas_cli-11.7.0/src/mas/cli/templates/suite_mongocfg.yml.j2 +55 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/update/app.py +20 -15
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas_cli.egg-info/PKG-INFO +2 -2
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas_cli.egg-info/SOURCES.txt +4 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas_cli.egg-info/requires.txt +1 -1
- mas_cli-11.5.0/src/mas/cli/install/settings/turbonomicSettings.py +0 -30
- {mas_cli-11.5.0 → mas_cli-11.7.0}/MANIFEST.in +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/README.rst +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/pyproject.toml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/setup.cfg +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/displayMixins.py +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/install/__init__.py +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/jdbccfg.yml.j2 +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/best-effort/ibm-data-dictionary-assetdatadictionary.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/best-effort/ibm-mas-bascfg.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/best-effort/ibm-mas-coreidp.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/best-effort/ibm-mas-iot-actions.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/best-effort/ibm-mas-iot-auth.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/best-effort/ibm-mas-iot-datapower.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/best-effort/ibm-mas-iot-devops.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/best-effort/ibm-mas-iot-dm.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/best-effort/ibm-mas-iot-dsc.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/best-effort/ibm-mas-iot-edgeconfig.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/best-effort/ibm-mas-iot-fpl.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/best-effort/ibm-mas-iot-guardian.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/best-effort/ibm-mas-iot-iot.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/best-effort/ibm-mas-iot-mbgx.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/best-effort/ibm-mas-iot-mfgx.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/best-effort/ibm-mas-iot-monitor.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/best-effort/ibm-mas-iot-orgmgmt.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/best-effort/ibm-mas-iot-provision.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/best-effort/ibm-mas-iot-registry.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/best-effort/ibm-mas-iot-state.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/best-effort/ibm-mas-iot-webui.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/best-effort/ibm-mas-manage-healthextaccelerator.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/best-effort/ibm-mas-manage-healthextworkspace.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/best-effort/ibm-mas-manage-imagestitching.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/best-effort/ibm-mas-manage-manageaccelerators.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/best-effort/ibm-mas-manage-manageapp.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/best-effort/ibm-mas-manage-manageworkspace.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/best-effort/ibm-mas-manage-slackproxy.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/best-effort/ibm-mas-pushnotificationcfg.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/best-effort/ibm-mas-scimcfg.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/best-effort/ibm-mas-slscfg.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/best-effort/ibm-mas-smtpcfg.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/best-effort/ibm-mas-suite.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/best-effort/ibm-mas-visualinspection.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/best-effort/ibm-sls-licenseservice.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/guaranteed/ibm-data-dictionary-assetdatadictionary.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/guaranteed/ibm-mas-bascfg.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/guaranteed/ibm-mas-coreidp.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/guaranteed/ibm-mas-iot-actions.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/guaranteed/ibm-mas-iot-auth.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/guaranteed/ibm-mas-iot-datapower.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/guaranteed/ibm-mas-iot-devops.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/guaranteed/ibm-mas-iot-dm.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/guaranteed/ibm-mas-iot-dsc.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/guaranteed/ibm-mas-iot-edgeconfig.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/guaranteed/ibm-mas-iot-fpl.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/guaranteed/ibm-mas-iot-guardian.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/guaranteed/ibm-mas-iot-iot.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/guaranteed/ibm-mas-iot-mbgx.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/guaranteed/ibm-mas-iot-mfgx.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/guaranteed/ibm-mas-iot-monitor.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/guaranteed/ibm-mas-iot-orgmgmt.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/guaranteed/ibm-mas-iot-provision.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/guaranteed/ibm-mas-iot-registry.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/guaranteed/ibm-mas-iot-state.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/guaranteed/ibm-mas-iot-webui.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/guaranteed/ibm-mas-manage-healthextaccelerator.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/guaranteed/ibm-mas-manage-healthextworkspace.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/guaranteed/ibm-mas-manage-imagestitching.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/guaranteed/ibm-mas-manage-manageaccelerators.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/guaranteed/ibm-mas-manage-manageapp.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/guaranteed/ibm-mas-manage-manageworkspace.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/guaranteed/ibm-mas-manage-slackproxy.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/guaranteed/ibm-mas-pushnotificationcfg.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/guaranteed/ibm-mas-scimcfg.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/guaranteed/ibm-mas-slscfg.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/guaranteed/ibm-mas-smtpcfg.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/guaranteed/ibm-mas-suite.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/guaranteed/ibm-mas-visualinspection.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/templates/pod-templates/guaranteed/ibm-sls-licenseservice.yml +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/uninstall/__init__.py +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/uninstall/app.py +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/uninstall/argParser.py +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/update/__init__.py +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/update/argParser.py +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/upgrade/__init__.py +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/upgrade/app.py +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/upgrade/argParser.py +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas/cli/validators.py +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas-cli +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas_cli.egg-info/dependency_links.txt +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/src/mas_cli.egg-info/top_level.txt +0 -0
- {mas_cli-11.5.0 → mas_cli-11.7.0}/test/test_help.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: mas-cli
|
|
3
|
-
Version: 11.
|
|
3
|
+
Version: 11.7.0
|
|
4
4
|
Summary: Python Admin CLI for Maximo Application Suite
|
|
5
5
|
Home-page: https://github.com/ibm-mas/cli
|
|
6
6
|
Author: David Parker
|
|
@@ -17,7 +17,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
17
17
|
Classifier: Topic :: Communications
|
|
18
18
|
Classifier: Topic :: Internet
|
|
19
19
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
20
|
-
Requires-Dist: mas-devops
|
|
20
|
+
Requires-Dist: mas-devops>=1.7.0
|
|
21
21
|
Requires-Dist: halo
|
|
22
22
|
Requires-Dist: prompt_toolkit
|
|
23
23
|
Requires-Dist: openshift
|
|
@@ -58,12 +58,12 @@ setup(
|
|
|
58
58
|
description='Python Admin CLI for Maximo Application Suite',
|
|
59
59
|
long_description=long_description,
|
|
60
60
|
install_requires=[
|
|
61
|
-
'mas-devops',
|
|
62
|
-
'halo',
|
|
63
|
-
'prompt_toolkit',
|
|
64
|
-
'openshift',
|
|
65
|
-
'kubernetes',
|
|
66
|
-
'tabulate'
|
|
61
|
+
'mas-devops >= 1.7.0', # EPL
|
|
62
|
+
'halo', # MIT License
|
|
63
|
+
'prompt_toolkit', # BSD License
|
|
64
|
+
'openshift', # Apache Software License
|
|
65
|
+
'kubernetes', # Apache Software License
|
|
66
|
+
'tabulate' # MIT License
|
|
67
67
|
],
|
|
68
68
|
extras_require={
|
|
69
69
|
'dev': [
|
|
@@ -28,7 +28,7 @@ from openshift.dynamic.exceptions import NotFoundError
|
|
|
28
28
|
from prompt_toolkit import prompt, print_formatted_text, HTML
|
|
29
29
|
|
|
30
30
|
from mas.devops.mas import isAirgapInstall
|
|
31
|
-
from mas.devops.ocp import connect, isSNO
|
|
31
|
+
from mas.devops.ocp import connect, isSNO, getNodes
|
|
32
32
|
|
|
33
33
|
from .displayMixins import PrintMixin, PromptMixin
|
|
34
34
|
|
|
@@ -50,7 +50,7 @@ def getHelpFormatter(formatter=RawTextHelpFormatter, w=160, h=50):
|
|
|
50
50
|
formatter(None, **kwargs)
|
|
51
51
|
return lambda prog: formatter(prog, **kwargs)
|
|
52
52
|
except TypeError:
|
|
53
|
-
logger.
|
|
53
|
+
logger.warning("argparse help formatter failed, falling back.")
|
|
54
54
|
return formatter
|
|
55
55
|
|
|
56
56
|
|
|
@@ -89,6 +89,15 @@ def runCmd(cmdArray, timeout=630):
|
|
|
89
89
|
return RunCmdResult(127, 'TimeoutExpired', str(e))
|
|
90
90
|
|
|
91
91
|
|
|
92
|
+
def logMethodCall(func):
|
|
93
|
+
def wrapper(self, *args, **kwargs):
|
|
94
|
+
logger.debug(f">>> BaseApp.{func.__name__}")
|
|
95
|
+
result = func(self, *args, **kwargs)
|
|
96
|
+
logger.debug(f"<<< BaseApp.{func.__name__}")
|
|
97
|
+
return result
|
|
98
|
+
return wrapper
|
|
99
|
+
|
|
100
|
+
|
|
92
101
|
class BaseApp(PrintMixin, PromptMixin):
|
|
93
102
|
def __init__(self):
|
|
94
103
|
# Set up a log formatter
|
|
@@ -105,9 +114,10 @@ class BaseApp(PrintMixin, PromptMixin):
|
|
|
105
114
|
rootLogger = logging.getLogger()
|
|
106
115
|
rootLogger.addHandler(ch)
|
|
107
116
|
rootLogger.setLevel(logging.DEBUG)
|
|
117
|
+
logging.getLogger('asyncio').setLevel(logging.INFO)
|
|
108
118
|
|
|
109
119
|
# Supports extended semver, unlike mas.cli.__version__
|
|
110
|
-
self.version = "11.
|
|
120
|
+
self.version = "11.7.0"
|
|
111
121
|
self.h1count = 0
|
|
112
122
|
self.h2count = 0
|
|
113
123
|
|
|
@@ -129,6 +139,9 @@ class BaseApp(PrintMixin, PromptMixin):
|
|
|
129
139
|
|
|
130
140
|
self._isSNO = None
|
|
131
141
|
|
|
142
|
+
# Until we connect to the cluster we don't know what architecture it's worker nodes are
|
|
143
|
+
self.architecture = None
|
|
144
|
+
|
|
132
145
|
self.compatibilityMatrix = {
|
|
133
146
|
"9.0.x": {
|
|
134
147
|
"assist": ["9.0.x", "8.8.x"],
|
|
@@ -137,7 +150,8 @@ class BaseApp(PrintMixin, PromptMixin):
|
|
|
137
150
|
"monitor": ["9.0.x", "8.11.x"],
|
|
138
151
|
"optimizer": ["9.0.x", "8.5.x"],
|
|
139
152
|
"predict": ["9.0.x", "8.9.x"],
|
|
140
|
-
"visualinspection": ["9.0.x", "8.9.x"]
|
|
153
|
+
"visualinspection": ["9.0.x", "8.9.x"],
|
|
154
|
+
"aibroker": ["9.0.x"]
|
|
141
155
|
},
|
|
142
156
|
"8.11.x": {
|
|
143
157
|
"assist": ["8.8.x", "8.7.x"],
|
|
@@ -174,6 +188,7 @@ class BaseApp(PrintMixin, PromptMixin):
|
|
|
174
188
|
if which("kubectl") is None:
|
|
175
189
|
self.fatalError("Could not find kubectl on the path, see <DarkGoldenRod><u>https://kubernetes.io/docs/tasks/tools/#kubectl</u></DarkGoldenRod> for installation instructions")
|
|
176
190
|
|
|
191
|
+
@logMethodCall
|
|
177
192
|
def createTektonFileWithDigest(self) -> None:
|
|
178
193
|
if path.exists(self.tektonDefsWithDigestPath):
|
|
179
194
|
logger.debug(f"We have already generated {self.tektonDefsWithDigestPath}")
|
|
@@ -216,12 +231,14 @@ class BaseApp(PrintMixin, PromptMixin):
|
|
|
216
231
|
|
|
217
232
|
self.tektonDefsPath = self.tektonDefsWithDigestPath
|
|
218
233
|
|
|
234
|
+
@logMethodCall
|
|
219
235
|
def getCompatibleVersions(self, coreChannel: str, appId: str) -> list:
|
|
220
236
|
if coreChannel in self.compatibilityMatrix:
|
|
221
237
|
return self.compatibilityMatrix[coreChannel][appId]
|
|
222
238
|
else:
|
|
223
239
|
return []
|
|
224
240
|
|
|
241
|
+
@logMethodCall
|
|
225
242
|
def fatalError(self, message: str, exception: Exception = None) -> None:
|
|
226
243
|
if exception is not None:
|
|
227
244
|
logger.error(message)
|
|
@@ -232,6 +249,7 @@ class BaseApp(PrintMixin, PromptMixin):
|
|
|
232
249
|
print_formatted_text(HTML(f"<Red>Fatal Error: {message.replace(' & ', ' & ')}</Red>\n"))
|
|
233
250
|
exit(1)
|
|
234
251
|
|
|
252
|
+
@logMethodCall
|
|
235
253
|
def isSNO(self):
|
|
236
254
|
if self._isSNO is None:
|
|
237
255
|
self._isSNO = isSNO(self.dynamicClient)
|
|
@@ -256,6 +274,7 @@ class BaseApp(PrintMixin, PromptMixin):
|
|
|
256
274
|
else:
|
|
257
275
|
return self.reloadDynamicClient()
|
|
258
276
|
|
|
277
|
+
@logMethodCall
|
|
259
278
|
def reloadDynamicClient(self):
|
|
260
279
|
"""
|
|
261
280
|
Configure the Kubernetes API Client using the active context in kubeconfig
|
|
@@ -277,6 +296,7 @@ class BaseApp(PrintMixin, PromptMixin):
|
|
|
277
296
|
logger.exception(e, stack_info=True)
|
|
278
297
|
return None
|
|
279
298
|
|
|
299
|
+
@logMethodCall
|
|
280
300
|
def connect(self):
|
|
281
301
|
promptForNewServer = False
|
|
282
302
|
self.reloadDynamicClient()
|
|
@@ -288,7 +308,7 @@ class BaseApp(PrintMixin, PromptMixin):
|
|
|
288
308
|
print()
|
|
289
309
|
if not self.noConfirm:
|
|
290
310
|
# We are already connected to a cluster, but prompt the user if they want to use this connection
|
|
291
|
-
promptForNewServer = not self.yesOrNo("Proceed with this cluster
|
|
311
|
+
promptForNewServer = not self.yesOrNo("Proceed with this cluster")
|
|
292
312
|
except Exception as e:
|
|
293
313
|
# We are already connected to a cluster, but the connection is not valid so prompt for connection details
|
|
294
314
|
logger.debug("Failed looking up OpenShift Console route to verify connection")
|
|
@@ -309,6 +329,24 @@ class BaseApp(PrintMixin, PromptMixin):
|
|
|
309
329
|
print_formatted_text(HTML("<Red>Unable to connect to cluster. See log file for details</Red>"))
|
|
310
330
|
exit(1)
|
|
311
331
|
|
|
332
|
+
# Now that we are connected, inspect the architecture of the OpenShift cluster
|
|
333
|
+
self.lookupTargetArchitecture()
|
|
334
|
+
|
|
335
|
+
@logMethodCall
|
|
336
|
+
def lookupTargetArchitecture(self, architecture: str = None) -> None:
|
|
337
|
+
logger.debug("Looking up worker node architecture")
|
|
338
|
+
if architecture is not None:
|
|
339
|
+
self.architecture = architecture
|
|
340
|
+
logger.debug(f"Target architecture (overridden): {self.architecture}")
|
|
341
|
+
else:
|
|
342
|
+
nodes = getNodes(self.dynamicClient)
|
|
343
|
+
self.architecture = nodes[0]["status"]["nodeInfo"]["architecture"]
|
|
344
|
+
logger.debug(f"Target architecture: {self.architecture}")
|
|
345
|
+
|
|
346
|
+
if self.architecture not in ["amd64", "s390x"]:
|
|
347
|
+
self.fatalError(f"Unsupported worker node architecture: {self.architecture}")
|
|
348
|
+
|
|
349
|
+
@logMethodCall
|
|
312
350
|
def initializeApprovalConfigMap(self, namespace: str, id: str, key: str = None, maxRetries: int = 100, delay: int = 300, ignoreFailure: bool = True) -> None:
|
|
313
351
|
"""
|
|
314
352
|
Set key = None if you don't want approval workflow enabled
|
|
@@ -10,17 +10,11 @@
|
|
|
10
10
|
|
|
11
11
|
from os import path
|
|
12
12
|
from jinja2 import Template
|
|
13
|
+
from base64 import b64encode
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
class ConfigGeneratorMixin():
|
|
16
|
-
def generateJDBCCfg(
|
|
17
|
-
self,
|
|
18
|
-
instanceId: str,
|
|
19
|
-
scope: str,
|
|
20
|
-
destination: str,
|
|
21
|
-
appId: str = "",
|
|
22
|
-
workspaceId: str = "") -> None:
|
|
23
|
-
|
|
17
|
+
def generateJDBCCfg(self, instanceId: str, scope: str, destination: str, appId: str = "", workspaceId: str = "") -> None:
|
|
24
18
|
templateFile = path.join(self.templatesDir, "jdbccfg.yml.j2")
|
|
25
19
|
with open(templateFile) as tFile:
|
|
26
20
|
template = Template(tFile.read())
|
|
@@ -64,3 +58,33 @@ class ConfigGeneratorMixin():
|
|
|
64
58
|
with open(destination, 'w') as f:
|
|
65
59
|
f.write(cfg)
|
|
66
60
|
f.write('\n')
|
|
61
|
+
|
|
62
|
+
def generateMongoCfg(self, instanceId: str, destination: str) -> None:
|
|
63
|
+
templateFile = path.join(self.templatesDir, "suite_mongocfg.yml.j2")
|
|
64
|
+
|
|
65
|
+
with open(templateFile) as tFile:
|
|
66
|
+
template = Template(tFile.read())
|
|
67
|
+
|
|
68
|
+
name = self.promptForString("Configuration Display Name")
|
|
69
|
+
hosts = self.promptForString("MongoDb Hosts (comma-separated list)")
|
|
70
|
+
|
|
71
|
+
username = self.promptForString("MongoDb Username")
|
|
72
|
+
password = self.promptForString("MongoDb Password", isPassword=True)
|
|
73
|
+
encoded_username = b64encode(username.encode('ascii')).decode("ascii")
|
|
74
|
+
encoded_password = b64encode(password.encode('ascii')).decode("ascii")
|
|
75
|
+
sslCertFile = self.promptForFile("Path to certificate file")
|
|
76
|
+
with open(sslCertFile) as cFile:
|
|
77
|
+
certLocalFileContent = cFile.read()
|
|
78
|
+
|
|
79
|
+
cfg = template.render(
|
|
80
|
+
mas_instance_id=instanceId,
|
|
81
|
+
cfg_display_name=name,
|
|
82
|
+
mongodb_hosts=hosts,
|
|
83
|
+
mongodb_admin_username=encoded_username,
|
|
84
|
+
mongodb_admin_password=encoded_password,
|
|
85
|
+
mongodb_ca_pem_local_file=certLocalFileContent
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
with open(destination, 'w') as f:
|
|
89
|
+
f.write(cfg)
|
|
90
|
+
f.write('\n')
|