mas-cli 11.4.0__py3-none-any.whl → 11.6.0__py3-none-any.whl

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.

@@ -8,4 +8,4 @@
8
8
  #
9
9
  # *****************************************************************************
10
10
 
11
- from ..cli import BaseApp
11
+ from ..cli import BaseApp # noqa: F401
mas/cli/uninstall/app.py CHANGED
@@ -28,6 +28,7 @@ from mas.devops.tekton import installOpenShiftPipelines, updateTektonDefinitions
28
28
 
29
29
  logger = logging.getLogger(__name__)
30
30
 
31
+
31
32
  class UninstallApp(BaseApp):
32
33
  def uninstall(self, argv):
33
34
  """
@@ -76,7 +77,7 @@ class UninstallApp(BaseApp):
76
77
  for suite in suites:
77
78
  self.printDescription([f"- <u>{suite['metadata']['name']}</u> v{suite['status']['versions']['reconciled']}"])
78
79
  suiteOptions.append(suite['metadata']['name'])
79
- except ResourceNotFoundError as e:
80
+ except ResourceNotFoundError:
80
81
  self.fatalError("No MAS instances were detected on the cluster (Suite.core.mas.ibm.com/v1 API is not available). See log file for details")
81
82
 
82
83
  if len(suiteOptions) == 0:
@@ -127,7 +128,7 @@ class UninstallApp(BaseApp):
127
128
  self.fatalError(f"MAS Instance {instanceId} not found on this cluster</Red>")
128
129
 
129
130
  # Default to Red Hat Cert-Manager, and check if IBM cert-manager is installed
130
- certManagerProvider="redhat"
131
+ certManagerProvider = "redhat"
131
132
  try:
132
133
  # Check if 'ibm-common-services' namespace exist, this will throw NotFoundError exception when not found.
133
134
  namespaceAPI = self.dynamicClient.resources.get(api_version="v1", kind="Namespace")
@@ -164,7 +165,7 @@ class UninstallApp(BaseApp):
164
165
 
165
166
  with Halo(text='Validating OpenShift Pipelines installation', spinner=self.spinner) as h:
166
167
  installOpenShiftPipelines(self.dynamicClient)
167
- h.stop_and_persist(symbol=self.successIcon, text=f"OpenShift Pipelines Operator is installed and ready to use")
168
+ h.stop_and_persist(symbol=self.successIcon, text="OpenShift Pipelines Operator is installed and ready to use")
168
169
 
169
170
  with Halo(text=f'Preparing namespace ({pipelinesNamespace})', spinner=self.spinner) as h:
170
171
  createNamespace(self.dynamicClient, pipelinesNamespace)
@@ -176,17 +177,17 @@ class UninstallApp(BaseApp):
176
177
 
177
178
  with Halo(text=f'Submitting PipelineRun for {instanceId} uninstall', spinner=self.spinner) as h:
178
179
  pipelineURL = launchUninstallPipeline(
179
- dynClient = self.dynamicClient,
180
- instanceId = instanceId,
181
- certManagerProvider = "redhat",
182
- uninstallCertManager = uninstallCertManager,
183
- uninstallGrafana = uninstallGrafana,
184
- uninstallCatalog = uninstallCommonServices,
185
- uninstallCommonServices = uninstallCommonServices,
186
- uninstallUDS = uninstallUDS,
187
- uninstallMongoDb = uninstallMongoDb,
188
- uninstallSLS = uninstallSLS,
189
- droNamespace = droNamespace
180
+ dynClient=self.dynamicClient,
181
+ instanceId=instanceId,
182
+ certManagerProvider="redhat",
183
+ uninstallCertManager=uninstallCertManager,
184
+ uninstallGrafana=uninstallGrafana,
185
+ uninstallCatalog=uninstallCommonServices,
186
+ uninstallCommonServices=uninstallCommonServices,
187
+ uninstallUDS=uninstallUDS,
188
+ uninstallMongoDb=uninstallMongoDb,
189
+ uninstallSLS=uninstallSLS,
190
+ droNamespace=droNamespace
190
191
  )
191
192
  if pipelineURL is not None:
192
193
  h.stop_and_persist(symbol=self.successIcon, text=f"PipelineRun for {instanceId} uninstall submitted")
@@ -112,4 +112,4 @@ otherArgGroup.add_argument(
112
112
  action='help',
113
113
  default=False,
114
114
  help="Show this help message and exit",
115
- )
115
+ )
@@ -8,4 +8,4 @@
8
8
  #
9
9
  # *****************************************************************************
10
10
 
11
- from ..cli import BaseApp
11
+ from ..cli import BaseApp # noqa: F401
mas/cli/update/app.py CHANGED
@@ -14,7 +14,6 @@ import logging
14
14
  import logging.handlers
15
15
  from halo import Halo
16
16
  from prompt_toolkit import print_formatted_text, HTML
17
- from prompt_toolkit.completion import WordCompleter
18
17
 
19
18
  from openshift.dynamic.exceptions import NotFoundError, ResourceNotFoundError
20
19
 
@@ -29,6 +28,7 @@ from mas.devops.tekton import preparePipelinesNamespace, installOpenShiftPipelin
29
28
 
30
29
  logger = logging.getLogger(__name__)
31
30
 
31
+
32
32
  class UpdateApp(BaseApp):
33
33
 
34
34
  def update(self, argv):
@@ -75,7 +75,7 @@ class UpdateApp(BaseApp):
75
75
  self.setParam(key, value)
76
76
 
77
77
  # Arguments that we don't need to do anything with
78
- elif key in [ "no_confirm", "help"]:
78
+ elif key in ["no_confirm", "help"]:
79
79
  pass
80
80
 
81
81
  # Fail if there's any arguments we don't know how to handle
@@ -105,14 +105,14 @@ class UpdateApp(BaseApp):
105
105
  self.printH1("Dependency Update Checks")
106
106
  with Halo(text='Checking for IBM Watson Discovery', spinner=self.spinner) as h:
107
107
  if self.isWatsonDiscoveryInstalled():
108
- h.stop_and_persist(symbol=self.failureIcon, text=f"IBM Watson Discovery is installed")
108
+ h.stop_and_persist(symbol=self.failureIcon, text="IBM Watson Discovery is installed")
109
109
  self.fatalError("Watson Discovery is currently installed in the instance of Cloud Pak for Data that is managed by the MAS CLI (in the ibm-cpd namespace), this is no longer supported and the update can not proceed as a result. Please contact IBM support for assistance")
110
110
  else:
111
- h.stop_and_persist(symbol=self.successIcon, text=f"IBM Watson Discovery is not installed")
111
+ h.stop_and_persist(symbol=self.successIcon, text="IBM Watson Discovery is not installed")
112
112
 
113
113
  with Halo(text='Checking for IBM Certificate-Manager', spinner=self.spinner) as h:
114
114
  if self.isIBMCertManagerInstalled():
115
- h.stop_and_persist(symbol=self.successIcon, text=f"IBM Certificate-Manager will be replaced by Red Hat Certificate-Manager")
115
+ h.stop_and_persist(symbol=self.successIcon, text="IBM Certificate-Manager will be replaced by Red Hat Certificate-Manager")
116
116
  self.setParam("cert_manager_action", "install")
117
117
  self.setParam("cert_manager_provider", "redhat")
118
118
  self.printHighlight([
@@ -122,7 +122,7 @@ class UpdateApp(BaseApp):
122
122
  ""
123
123
  ])
124
124
  else:
125
- h.stop_and_persist(symbol=self.successIcon, text=f"IBM Certificate-Manager is not installed")
125
+ h.stop_and_persist(symbol=self.successIcon, text="IBM Certificate-Manager is not installed")
126
126
 
127
127
  self.detectUDS()
128
128
  self.detectGrafana4()
@@ -160,7 +160,7 @@ class UpdateApp(BaseApp):
160
160
  self.printSummary("Apache Kafka", "No action required")
161
161
 
162
162
  if self.getParam("cp4d_update") != "":
163
- self.printSummary("IBM Cloud Pak for Data", f"Platform and services in ibm-cpd")
163
+ self.printSummary("IBM Cloud Pak for Data", "Platform and services in ibm-cpd")
164
164
  else:
165
165
  self.printSummary("IBM Cloud Pak for Data", "No action required")
166
166
 
@@ -180,11 +180,11 @@ class UpdateApp(BaseApp):
180
180
  self.createTektonFileWithDigest()
181
181
 
182
182
  self.printH1("Launch Update")
183
- pipelinesNamespace = f"mas-pipelines"
183
+ pipelinesNamespace = "mas-pipelines"
184
184
 
185
185
  with Halo(text='Validating OpenShift Pipelines installation', spinner=self.spinner) as h:
186
186
  installOpenShiftPipelines(self.dynamicClient)
187
- h.stop_and_persist(symbol=self.successIcon, text=f"OpenShift Pipelines Operator is installed and ready to use")
187
+ h.stop_and_persist(symbol=self.successIcon, text="OpenShift Pipelines Operator is installed and ready to use")
188
188
 
189
189
  with Halo(text=f'Preparing namespace ({pipelinesNamespace})', spinner=self.spinner) as h:
190
190
  createNamespace(self.dynamicClient, pipelinesNamespace)
@@ -195,13 +195,13 @@ class UpdateApp(BaseApp):
195
195
  updateTektonDefinitions(pipelinesNamespace, self.tektonDefsPath)
196
196
  h.stop_and_persist(symbol=self.successIcon, text=f"Latest Tekton definitions are installed (v{self.version})")
197
197
 
198
- with Halo(text=f"Submitting PipelineRun for MAS update", spinner=self.spinner) as h:
198
+ with Halo(text="Submitting PipelineRun for MAS update", spinner=self.spinner) as h:
199
199
  pipelineURL = launchUpdatePipeline(dynClient=self.dynamicClient, params=self.params)
200
200
  if pipelineURL is not None:
201
- h.stop_and_persist(symbol=self.successIcon, text=f"PipelineRun for MAS update submitted")
201
+ h.stop_and_persist(symbol=self.successIcon, text="PipelineRun for MAS update submitted")
202
202
  print_formatted_text(HTML(f"\nView progress:\n <Cyan><u>{pipelineURL}</u></Cyan>\n"))
203
203
  else:
204
- h.stop_and_persist(symbol=self.failureIcon, text=f"Failed to submit PipelineRun for MAS update, see log file for details")
204
+ h.stop_and_persist(symbol=self.failureIcon, text="Failed to submit PipelineRun for MAS update, see log file for details")
205
205
  print()
206
206
 
207
207
  def reviewCurrentCatalog(self) -> None:
@@ -220,7 +220,7 @@ class UpdateApp(BaseApp):
220
220
  self.installedCatalogId = "v8-amd64"
221
221
  else:
222
222
  self.installedCatalogId = None
223
- self.printWarning(f"Unable to determine identity & version of currently installed ibm-maximo-operator-catalog")
223
+ self.printWarning("Unable to determine identity & version of currently installed ibm-maximo-operator-catalog")
224
224
 
225
225
  self.printH1("Review Installed Catalog")
226
226
  self.printDescription([
@@ -237,7 +237,7 @@ class UpdateApp(BaseApp):
237
237
  suites = listMasInstances(self.dynamicClient)
238
238
  for suite in suites:
239
239
  self.printDescription([f"- <u>{suite['metadata']['name']}</u> v{suite['status']['versions']['reconciled']}"])
240
- except ResourceNotFoundError as e:
240
+ except ResourceNotFoundError:
241
241
  self.fatalError("No MAS instances were detected on the cluster (Suite.core.mas.ibm.com/v1 API is not available). See log file for details")
242
242
 
243
243
  def chooseCatalog(self) -> None:
@@ -250,7 +250,7 @@ class UpdateApp(BaseApp):
250
250
  ])
251
251
 
252
252
  catalogOptions = [
253
- "v9-241003-amd64", "v9-240827-amd64", "v9-240730-amd64"
253
+ "v9-241003-amd64", "v9-240827-amd64", "v9-240730-amd64"
254
254
  ]
255
255
  self.promptForListSelect("Select catalog version", catalogOptions, "mas_catalog_version", default=1)
256
256
 
@@ -265,7 +265,7 @@ class UpdateApp(BaseApp):
265
265
  if len(wds) > 0:
266
266
  return True
267
267
  return False
268
- except (ResourceNotFoundError, NotFoundError) as e:
268
+ except (ResourceNotFoundError, NotFoundError):
269
269
  # Watson Discovery has never been installed on this cluster
270
270
  return False
271
271
 
@@ -301,7 +301,7 @@ class UpdateApp(BaseApp):
301
301
  # For testing, comment out the lines above and set grafanaVersion4s to a simple list
302
302
  # grafanaVersion4s = ["hello"]
303
303
  if len(grafanaVersion4s) > 0:
304
- h.stop_and_persist(symbol=self.successIcon, text=f"Grafana Operator v4 instance will be updated to v5")
304
+ h.stop_and_persist(symbol=self.successIcon, text="Grafana Operator v4 instance will be updated to v5")
305
305
  self.printDescription([
306
306
  "<u>Dependency Upgrade Notice</u>",
307
307
  "Grafana Operator v4 is currently installed and will be updated to v5",
@@ -310,10 +310,10 @@ class UpdateApp(BaseApp):
310
310
  ])
311
311
  self.setParam("grafana_v5_upgrade", "true")
312
312
  else:
313
- h.stop_and_persist(symbol=self.successIcon, text=f"Grafana Operator v4 is not installed")
313
+ h.stop_and_persist(symbol=self.successIcon, text="Grafana Operator v4 is not installed")
314
314
  return
315
- except (ResourceNotFoundError, NotFoundError) as e:
316
- h.stop_and_persist(symbol=self.successIcon, text=f"Grafana Operator v4 is not installed")
315
+ except (ResourceNotFoundError, NotFoundError):
316
+ h.stop_and_persist(symbol=self.successIcon, text="Grafana Operator v4 is not installed")
317
317
 
318
318
  def detectMongoDb(self) -> None:
319
319
  with Halo(text='Checking for MongoDb CE', spinner=self.spinner) as h:
@@ -387,10 +387,10 @@ class UpdateApp(BaseApp):
387
387
  h.stop_and_persist(symbol=self.successIcon, text=f"MongoDb CE is aleady installed at version {targetMongoVersion}")
388
388
  else:
389
389
  # There's no MongoDb instance installed in the cluster, so nothing to do
390
- h.stop_and_persist(symbol=self.successIcon, text=f"No MongoDb CE instances found")
391
- except (ResourceNotFoundError, NotFoundError) as e:
390
+ h.stop_and_persist(symbol=self.successIcon, text="No MongoDb CE instances found")
391
+ except (ResourceNotFoundError, NotFoundError):
392
392
  # There's no MongoDb instance installed in the cluster, so nothing to do
393
- h.stop_and_persist(symbol=self.successIcon, text=f"MongoDb CE is not installed")
393
+ h.stop_and_persist(symbol=self.successIcon, text="MongoDb CE is not installed")
394
394
 
395
395
  def showMongoDependencyUpdateNotice(self, currentMongoVersion, targetMongoVersion) -> None:
396
396
  self.printHighlight([
@@ -422,24 +422,24 @@ class UpdateApp(BaseApp):
422
422
  # analyticsProxies = ["foo"]
423
423
  if len(analyticsProxies) == 0:
424
424
  logger.debug("UDS is not currently installed on this cluster")
425
- h.stop_and_persist(symbol=self.successIcon, text=f"IBM User Data Services is not installed")
425
+ h.stop_and_persist(symbol=self.successIcon, text="IBM User Data Services is not installed")
426
426
  else:
427
- h.stop_and_persist(symbol=self.successIcon, text=f"IBM User Data Services must be migrated to IBM Data Reporter Operator")
427
+ h.stop_and_persist(symbol=self.successIcon, text="IBM User Data Services must be migrated to IBM Data Reporter Operator")
428
428
 
429
429
  if self.noConfirm and self.getParam("dro_migration") != "true":
430
430
  # The user has chosen not to provide confirmation but has not provided the flag to pre-approve the migration
431
- h.stop_and_persist(symbol=self.failureIcon, text=f"IBM User Data Services needs to be migrated to IBM Data Reporter Operator")
431
+ h.stop_and_persist(symbol=self.failureIcon, text="IBM User Data Services needs to be migrated to IBM Data Reporter Operator")
432
432
  self.showUDSUpdateNotice()
433
433
  self.fatalError(f"By choosing {self.getParam('mas_catalog_version')} you must confirm the migration to DRO using '--dro-migration' when using '--no-confirm'")
434
434
  elif self.noConfirm and self.getParam("dro_storage_class") is None:
435
435
  # The user has not provided the storage class to use for DRO, but has disabled confirmations/interactive prompts
436
- h.stop_and_persist(symbol=self.failureIcon, text=f"IBM User Data Services needs to be migrated to IBM Data Reporter Operator")
436
+ h.stop_and_persist(symbol=self.failureIcon, text="IBM User Data Services needs to be migrated to IBM Data Reporter Operator")
437
437
  self.showUDSUpdateNotice()
438
438
  self.fatalError(f"By choosing {self.getParam('mas_catalog_version')} you must provide the storage class to use for the migration to DRO using '--dro-storage-class' when using '--no-confirm'")
439
439
  else:
440
440
  h.stop_and_persist(symbol=self.successIcon, text="IBM User Data Services needs to be migrated to IBM Data Reporter Operator")
441
441
  self.showUDSUpdateNotice()
442
- if self.getParam("dro_migration") == "true" and self.getParam("dro_storage_class") is None:
442
+ if self.getParam("dro_migration") == "true" and self.getParam("dro_storage_class") is None:
443
443
  if not self.yesOrNo("Confirm migration from UDS to DRO", "dro_migration"):
444
444
  # If the user did not approve the update, abort
445
445
  exit(1)
@@ -454,10 +454,10 @@ class UpdateApp(BaseApp):
454
454
  if self.getParam("dro_migration") == "true":
455
455
  self.setParam("uds_action", "install-dro")
456
456
 
457
- except (ResourceNotFoundError, NotFoundError) as e:
457
+ except (ResourceNotFoundError, NotFoundError):
458
458
  # UDS has never been installed on this cluster
459
459
  logger.debug("UDS has not been installed on this cluster before")
460
- h.stop_and_persist(symbol=self.successIcon, text=f"IBM User Data Services is not installed")
460
+ h.stop_and_persist(symbol=self.successIcon, text="IBM User Data Services is not installed")
461
461
 
462
462
  def detectCP4D(self) -> bool:
463
463
  # Important:
@@ -470,7 +470,7 @@ class UpdateApp(BaseApp):
470
470
  "v9-240730-amd64": "4.8.0",
471
471
  "v9-240827-amd64": "4.8.0",
472
472
  "v9-241003-amd64": "4.8.0"
473
-
473
+
474
474
  }
475
475
 
476
476
  with Halo(text='Checking for IBM Cloud Pak for Data', spinner=self.spinner) as h:
@@ -501,14 +501,14 @@ class UpdateApp(BaseApp):
501
501
 
502
502
  if cpdInstanceVersion < cpdTargetVersion:
503
503
  # We have to update CP4D
504
- h.stop_and_persist(symbol=self.successIcon, text=f"IBM Cloud Pak for Data {cpdInstanceVersion} needs to be updated to {cpdTargetVersion}")
504
+ h.stop_and_persist(symbol=self.successIcon, text=f"IBM Cloud Pak for Data ({cpdInstanceNamespace}) {cpdInstanceVersion} needs to be updated to {cpdTargetVersion}")
505
505
 
506
506
  if currentCpdVersionMajorMinor < targetCpdVersionMajorMinor:
507
507
  # We only show the "backup first" notice for minor CP4D updates
508
508
  self.printHighlight([
509
509
  ""
510
510
  "<u>Dependency Update Notice</u>",
511
- f"Cloud Pak For Data is currently running version {cpdInstanceVersion} and will be updated to version {cpdTargetVersion}",
511
+ f"Cloud Pak For Data ({cpdInstanceNamespace}) is currently running version {cpdInstanceVersion} and will be updated to version {cpdTargetVersion}",
512
512
  "It is recommended that you backup your Cloud Pak for Data instance before proceeding:",
513
513
  " <u>https://www.ibm.com/docs/en/cloud-paks/cp-data/5.0.x?topic=administering-backing-up-restoring-cloud-pak-data</u>"
514
514
  ])
@@ -545,11 +545,11 @@ class UpdateApp(BaseApp):
545
545
  self.detectCpdService('Spss', 'spssmodeler.cpd.ibm.com/v1', 'SPSS Modeler', "cp4d_update_spss")
546
546
  self.detectCpdService('CAService', 'ca.cpd.ibm.com/v1', 'Cognos Analytics', "cp4d_update_cognos")
547
547
  else:
548
- h.stop_and_persist(symbol=self.successIcon, text=f"IBM Cloud Pak for Data is already installed at version {cpdTargetVersion}")
548
+ h.stop_and_persist(symbol=self.successIcon, text=f"IBM Cloud Pak for Data ({cpdInstanceNamespace}) is already installed at version {cpdTargetVersion}")
549
549
  else:
550
- h.stop_and_persist(symbol=self.successIcon, text=f"No IBM Cloud Pak for Data instance found")
551
- except (ResourceNotFoundError, NotFoundError) as e:
552
- h.stop_and_persist(symbol=self.successIcon, text=f"IBM Cloud Pak for Data is not installed")
550
+ h.stop_and_persist(symbol=self.successIcon, text="No IBM Cloud Pak for Data instance found")
551
+ except (ResourceNotFoundError, NotFoundError):
552
+ h.stop_and_persist(symbol=self.successIcon, text="IBM Cloud Pak for Data is not installed")
553
553
 
554
554
  def detectCpdService(self, kind: str, api: str, name: str, param: str) -> None:
555
555
  try:
@@ -618,7 +618,7 @@ class UpdateApp(BaseApp):
618
618
  else:
619
619
  logger.debug(f"Found no instances of {kind} to update")
620
620
  h.stop_and_persist(symbol=self.successIcon, text=f"Found no {kind} ({apiVersion}) instances to update")
621
- except (ResourceNotFoundError, NotFoundError) as e:
621
+ except (ResourceNotFoundError, NotFoundError):
622
622
  logger.debug(f"{kind}.{apiVersion} is not available in the cluster")
623
623
  h.stop_and_persist(symbol=self.successIcon, text=f"{kind}.{apiVersion} is not available in the cluster")
624
624
 
@@ -633,7 +633,7 @@ class UpdateApp(BaseApp):
633
633
  self.setParam("kafka_provider", "redhat")
634
634
  elif sub["spec"]["name"] == "strimzi-kafka-operator":
635
635
  self.setParam("kafka_provider", "strimzi")
636
- except (ResourceNotFoundError, NotFoundError) as e:
636
+ except (ResourceNotFoundError, NotFoundError):
637
637
  pass
638
638
 
639
639
  # If the param is still undefined then there is a big problem
@@ -153,4 +153,4 @@ otherArgGroup.add_argument(
153
153
  action='help',
154
154
  default=False,
155
155
  help="Show this help message and exit",
156
- )
156
+ )
@@ -8,4 +8,4 @@
8
8
  #
9
9
  # *****************************************************************************
10
10
 
11
- from ..cli import BaseApp
11
+ from ..cli import BaseApp # noqa: F401
mas/cli/upgrade/app.py CHANGED
@@ -17,8 +17,8 @@ from prompt_toolkit.completion import WordCompleter
17
17
 
18
18
  from halo import Halo
19
19
 
20
- from ..cli import BaseApp, getHelpFormatter
21
- from ..validators import InstanceIDValidator, YesNoValidator
20
+ from ..cli import BaseApp
21
+ from ..validators import InstanceIDValidator
22
22
  from .argParser import upgradeArgParser
23
23
 
24
24
  from mas.devops.ocp import createNamespace
@@ -27,6 +27,7 @@ from mas.devops.tekton import installOpenShiftPipelines, updateTektonDefinitions
27
27
 
28
28
  logger = logging.getLogger(__name__)
29
29
 
30
+
30
31
  class UpgradeApp(BaseApp):
31
32
  def upgrade(self, argv):
32
33
  """
@@ -56,7 +57,7 @@ class UpgradeApp(BaseApp):
56
57
  suiteOptions = []
57
58
 
58
59
  if len(suites) == 0:
59
- print_formatted_text(HTML(f"<Red>Error: No MAS instances detected on this cluster</Red>"))
60
+ print_formatted_text(HTML("<Red>Error: No MAS instances detected on this cluster</Red>"))
60
61
  sys.exit(1)
61
62
 
62
63
  for suite in suites:
@@ -65,7 +66,7 @@ class UpgradeApp(BaseApp):
65
66
 
66
67
  suiteCompleter = WordCompleter(suiteOptions)
67
68
  print()
68
- instanceId = prompt(HTML(f'<Yellow>Enter MAS instance ID: </Yellow>'), completer=suiteCompleter, validator=InstanceIDValidator(), validate_while_typing=False)
69
+ instanceId = prompt(HTML('<Yellow>Enter MAS instance ID: </Yellow>'), completer=suiteCompleter, validator=InstanceIDValidator(), validate_while_typing=False)
69
70
  else:
70
71
  # Non-interactive mode
71
72
  if not verifyMasInstance(self.dynamicClient, instanceId):
@@ -78,9 +79,9 @@ class UpgradeApp(BaseApp):
78
79
 
79
80
  if not self.noConfirm:
80
81
  print()
81
- continueWithUpgrade = prompt(HTML(f'<Yellow>Proceed with these settings?</Yellow> '), validator=YesNoValidator(), validate_while_typing=False)
82
+ continueWithUpgrade = self.yesOrNo("Proceed with these settings?")
82
83
 
83
- if self.noConfirm or continueWithUpgrade in ["y", "yes"]:
84
+ if self.noConfirm or continueWithUpgrade:
84
85
  self.createTektonFileWithDigest()
85
86
 
86
87
  self.printH1("Launch Upgrade")
@@ -88,7 +89,7 @@ class UpgradeApp(BaseApp):
88
89
 
89
90
  with Halo(text='Validating OpenShift Pipelines installation', spinner=self.spinner) as h:
90
91
  installOpenShiftPipelines(self.dynamicClient)
91
- h.stop_and_persist(symbol=self.successIcon, text=f"OpenShift Pipelines Operator is installed and ready to use")
92
+ h.stop_and_persist(symbol=self.successIcon, text="OpenShift Pipelines Operator is installed and ready to use")
92
93
 
93
94
  with Halo(text=f'Preparing namespace ({pipelinesNamespace})', spinner=self.spinner) as h:
94
95
  createNamespace(self.dynamicClient, pipelinesNamespace)
@@ -53,4 +53,4 @@ otherArgGroup.add_argument(
53
53
  action='help',
54
54
  default=False,
55
55
  help="Show this help message and exit",
56
- )
56
+ )
@@ -27,6 +27,7 @@ from kubernetes.client.exceptions import ApiException
27
27
 
28
28
  logger = logging.getLogger(__name__)
29
29
 
30
+
30
31
  def usage():
31
32
  print_formatted_text(HTML(""))
32
33
 
@@ -36,15 +37,16 @@ def usage():
36
37
  print_formatted_text(HTML("Important Notice:\nThis standalone CLI (<ForestGreen>mas-cli</ForestGreen>) is still in beta state, not all functions supported by the <ForestGreen>mas</ForestGreen> function in quay.io/ibmmas/cli are supported yet"))
37
38
  print("")
38
39
  print_formatted_text(HTML(
39
- "<b>MAS Management Actions:</b>\n"+
40
- " - <ForestGreen>mas-cli install</ForestGreen> Install IBM Maximo Application Suite\n"+
41
- " - <ForestGreen>mas-cli update</ForestGreen> Apply updates and security fixes\n"+
42
- " - <ForestGreen>mas-cli upgrade</ForestGreen> Upgrade to a new MAS release\n"+
43
- " - <ForestGreen>mas-cli uninstall</ForestGreen> Remove MAS from the cluster\n"
40
+ "<b>MAS Management Actions:</b>\n"
41
+ + " - <ForestGreen>mas-cli install</ForestGreen> Install IBM Maximo Application Suite\n" # noqa: W503
42
+ + " - <ForestGreen>mas-cli update</ForestGreen> Apply updates and security fixes\n" # noqa: W503
43
+ + " - <ForestGreen>mas-cli upgrade</ForestGreen> Upgrade to a new MAS release\n" # noqa: W503
44
+ + " - <ForestGreen>mas-cli uninstall</ForestGreen> Remove MAS from the cluster\n" # noqa: W503
44
45
 
45
46
  ))
46
47
  print_formatted_text(HTML("For usage information run <ForestGreen>mas-cli [action] --help</ForestGreen>\n"))
47
48
 
49
+
48
50
  if __name__ == '__main__':
49
51
  try:
50
52
  function = argv[1]
@@ -69,7 +71,7 @@ if __name__ == '__main__':
69
71
  print_formatted_text(HTML(f"<Red>Unknown action: {function}</Red>\n"))
70
72
  exit(1)
71
73
 
72
- except KeyboardInterrupt as e:
74
+ except KeyboardInterrupt:
73
75
  pass
74
76
  except ApiException as e:
75
77
  app.fatalError(message=f"An error occured communicating with the target server: {e.reason} ({e.status})", exception=e)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mas-cli
3
- Version: 11.4.0
3
+ Version: 11.6.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.6.3
21
21
  Requires-Dist: halo
22
22
  Requires-Dist: prompt-toolkit
23
23
  Requires-Dist: openshift
@@ -1,20 +1,20 @@
1
- mas/cli/__init__.py,sha256=b0mEzsD32qjAyt58076AzTBlzG6lLCmTO53XOq5TkZc,526
2
- mas/cli/cli.py,sha256=AAxyOl7jPP1uqIK3_YkGqwfYlTrxC-IvLh7B8WoECAw,14563
3
- mas/cli/displayMixins.py,sha256=ygDJ8KPLdJpip_JQ4JDPWbvo7ZIdsOZQfQoVnMdAauM,5594
4
- mas/cli/gencfg.py,sha256=57ik5x73gQBFXPl_8h2byXmV_vhCgxfeSDZk4Wg5-Pw,2102
1
+ mas/cli/__init__.py,sha256=jwFdxuSo_zwNXds0IVNrCiO5YZjBdvxHAVBfdCpvvYw,526
2
+ mas/cli/cli.py,sha256=lR0h-pPyFXiKCOKka5wTRJbyQZDrQevq3-ZIvZUTa_A,14411
3
+ mas/cli/displayMixins.py,sha256=VVL2kWzPTqNQy63WT-tYIDnYa7SX3w33QX2XjSWVHWk,5636
4
+ mas/cli/gencfg.py,sha256=BbWCyX6soIwQWcsKCLDTY0VkipLd944cuIAFpAWWXpA,2107
5
5
  mas/cli/validators.py,sha256=vi1pFA8QtqMhqtGk1NlkkNDUrlFCi53kS5wJqFGDgOU,5108
6
- mas/cli/install/__init__.py,sha256=tGH_qJ5ZqcSFpIlObRiye3Y-r4zU8rEplYFjwuHwBTY,494
7
- mas/cli/install/app.py,sha256=SigGUQwmtrxWlm2TJzEW8FJxLyDivSD-0Y3AxcW1odY,55998
8
- mas/cli/install/argBuilder.py,sha256=kOkoQ5Ksj-SiSr9s3Pjn7tXLY1NYK78hwyAFAU6tGes,22741
9
- mas/cli/install/argParser.py,sha256=Yin9uxUOAxzfD1kIWehlKNgylle2VCo5YKSI7JpmFHM,26835
10
- mas/cli/install/summarizer.py,sha256=9dxRDOdGGH4TOsNWAwIigqusqVUMa-R8tj9TPPKTx_4,18907
11
- mas/cli/install/settings/__init__.py,sha256=eGdNVHVALUxJlZyGYkBet8LbHvVfa-1UjL_8Zl3d-lY,953
12
- mas/cli/install/settings/additionalConfigs.py,sha256=cdOWpOXJeVqpSFxAAwyEBhd7H1Y9r9H1NnMBNBowd2A,9625
13
- mas/cli/install/settings/db2Settings.py,sha256=mR0XL81Talvwvm1bekw0o9VOwV42QkS0jMyp055bx5U,10713
14
- mas/cli/install/settings/kafkaSettings.py,sha256=bjAji5OZfSBpttiYHKM5B5Lvva8L8PUzi8QSs6opQcE,6997
15
- mas/cli/install/settings/manageSettings.py,sha256=TSByaLXVF9hRH0hqhX-eBc7dIHrOf4zgviOq2YrjSHc,13658
16
- mas/cli/install/settings/turbonomicSettings.py,sha256=eqMDocZxJnGEnWh41Yh8rmmVKVR_JnA8qrbfRrFAOaQ,1588
17
- mas/cli/templates/ibm-mas-tekton.yaml,sha256=uZQ4L3R0zdV7INdQlOO6ORwCSK8Bgwwat14d_6L8Uc4,727008
6
+ mas/cli/install/__init__.py,sha256=v0WJlcdrSycWGT5ofFjRDV3jTZ8AqVCz1AGxok4Khtc,508
7
+ mas/cli/install/app.py,sha256=iihHRfhdo4h91xHovfioDsYx-I6j9ClgB69oD6TwMEM,58314
8
+ mas/cli/install/argBuilder.py,sha256=064MK0mp42bH6HM3lZiixkKZvMyXJuWPhwt1znTViQE,22734
9
+ mas/cli/install/argParser.py,sha256=rqS36UVxMTz_XNG8e_W2IuIJZuYiq2sN75OmsAVczVg,32587
10
+ mas/cli/install/summarizer.py,sha256=oo-_hcPWe3cKGmucpmUmhoWfUR_gzPZKUhwKGljGHGk,21002
11
+ mas/cli/install/settings/__init__.py,sha256=wvprrlWi-j9SPwERiJkZdNKC99g_3QZ0h6lMn1gNGqE,962
12
+ mas/cli/install/settings/additionalConfigs.py,sha256=rD9-eEiZZiMJ6O7zKTYeioZoqI5sghiRRuAOE7-pVq0,9373
13
+ mas/cli/install/settings/db2Settings.py,sha256=0gR3nkr-xeR3cUgBzXWvatSgZf1fv2SbDdbxjBRBFG0,10712
14
+ mas/cli/install/settings/kafkaSettings.py,sha256=OWE5MV--h2fTtATMQiaGQq1FXIMXzaTAPGE_6-vXoWU,6998
15
+ mas/cli/install/settings/manageSettings.py,sha256=If2VVjX7YsYdcwB3P04_lSxm_dhC6sF3QEQJN0HND8A,15808
16
+ mas/cli/install/settings/turbonomicSettings.py,sha256=qy1SBjWJw1AHfRQoLv8uB9DO_QFcGa8hZp1fhdM0dY8,1589
17
+ mas/cli/templates/ibm-mas-tekton.yaml,sha256=73bkddTaY1fI77AbnlsJYdmts16ABI1HCFOqmRyFweU,778036
18
18
  mas/cli/templates/jdbccfg.yml.j2,sha256=cANbwkUkKEPQp-P3_BB_Llbt94457Ciagah2hOdySIM,1644
19
19
  mas/cli/templates/pod-templates/best-effort/ibm-data-dictionary-assetdatadictionary.yml,sha256=8VG_FDFcEjWNaAOZTcS58Pe0tWOXC10SJLloNqzEMC8,757
20
20
  mas/cli/templates/pod-templates/best-effort/ibm-mas-bascfg.yml,sha256=rkq8c2pVJoskgict9tCZzCchGSE2MBC-dJ47JyMYm7A,1559
@@ -86,17 +86,17 @@ mas/cli/templates/pod-templates/guaranteed/ibm-mas-smtpcfg.yml,sha256=fbBe8S5iHH
86
86
  mas/cli/templates/pod-templates/guaranteed/ibm-mas-suite.yml,sha256=aB-buCWUAqD0PV9zcGrPI5gm8QWUHZgxdriw_HG85q0,7656
87
87
  mas/cli/templates/pod-templates/guaranteed/ibm-mas-visualinspection.yml,sha256=NiXBlXKe3j2RvroEcx3kCSuD92G6WB-jcpNAYGAg3T0,1975
88
88
  mas/cli/templates/pod-templates/guaranteed/ibm-sls-licenseservice.yml,sha256=CKt1yim4L3ClloVcQDHiXLD8EMvmKXIltmDxJTxNdDs,546
89
- mas/cli/uninstall/__init__.py,sha256=tGH_qJ5ZqcSFpIlObRiye3Y-r4zU8rEplYFjwuHwBTY,494
90
- mas/cli/uninstall/app.py,sha256=VFF7X8kI6wqmxoyjCXIN6jjcJrVZXtCYA0Guo5wRWME,10072
91
- mas/cli/uninstall/argParser.py,sha256=5uT2gT8P-wbahtiiI3C1aT1Ygp7E8UM-_G4SR4zcyc4,3451
92
- mas/cli/update/__init__.py,sha256=tGH_qJ5ZqcSFpIlObRiye3Y-r4zU8rEplYFjwuHwBTY,494
93
- mas/cli/update/app.py,sha256=ToCdWf7xZ6CX2nIaBcqid3W_KAVutR4RoSGCw6kyoSM,37782
94
- mas/cli/update/argParser.py,sha256=ch0VZhrWLTZzhUAANihUCdkbcyx7rNhc690B9pX-L3U,4710
95
- mas/cli/upgrade/__init__.py,sha256=tGH_qJ5ZqcSFpIlObRiye3Y-r4zU8rEplYFjwuHwBTY,494
96
- mas/cli/upgrade/app.py,sha256=AjRI1uCVfl--edonhUb9ZTrp_QifJTQPp-ORT1S_uO8,5375
97
- mas/cli/upgrade/argParser.py,sha256=jl8SU0mXDMAkpfqXaKE4MPNUmVoD0LSsvMUSJjU1dbQ,1881
98
- mas_cli-11.4.0.data/scripts/mas-cli,sha256=sEPYV6KUzcq4ukiTM4tMLsYKv-d9Ms0aJI9Uhjg_G9Y,3436
99
- mas_cli-11.4.0.dist-info/METADATA,sha256=RYVDcUYAa6K8yG-gswpBkCYdcf4rSx0H0dCSChxalZ4,2076
100
- mas_cli-11.4.0.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
101
- mas_cli-11.4.0.dist-info/top_level.txt,sha256=_Hlsp7pvMvyV14LFg-vk1hULq30j61EILnnxMFIhhc8,4
102
- mas_cli-11.4.0.dist-info/RECORD,,
89
+ mas/cli/uninstall/__init__.py,sha256=v0WJlcdrSycWGT5ofFjRDV3jTZ8AqVCz1AGxok4Khtc,508
90
+ mas/cli/uninstall/app.py,sha256=uPJy3z-1Yt66MSFdZz1Qh8MjA97ZrQmjSgTx-Gqua9I,10047
91
+ mas/cli/uninstall/argParser.py,sha256=VVG4myUvFOtg98L6HAzpgGg7s5c-vub_UMZPGuNQko4,3452
92
+ mas/cli/update/__init__.py,sha256=v0WJlcdrSycWGT5ofFjRDV3jTZ8AqVCz1AGxok4Khtc,508
93
+ mas/cli/update/app.py,sha256=loh76IOo3h4gx9VUe4m27nqcI2_h2fK9h1uRvCZGOGE,37729
94
+ mas/cli/update/argParser.py,sha256=oOIXzB_rsI2p3og_5X5SFt_g7LURyEdLxZeiGCKq1nU,4711
95
+ mas/cli/upgrade/__init__.py,sha256=v0WJlcdrSycWGT5ofFjRDV3jTZ8AqVCz1AGxok4Khtc,508
96
+ mas/cli/upgrade/app.py,sha256=f1qfvzRdmf7YiYMtVTqKwE5RFVMcUkLGavCIZDuU_7c,5247
97
+ mas/cli/upgrade/argParser.py,sha256=zk629svjIk-hD40Ytc5e5UOLO3xogVrfqSz09S17mWw,1882
98
+ mas_cli-11.6.0.data/scripts/mas-cli,sha256=Es-wSefTBcR3Vs5_kIUHQLfWHxTXVrmIPMFY0hbrxt8,3493
99
+ mas_cli-11.6.0.dist-info/METADATA,sha256=v3-xafN2zDAhnqyyEDJMy44ppQnNlJ9cp1eEX1XE6wE,2084
100
+ mas_cli-11.6.0.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
101
+ mas_cli-11.6.0.dist-info/top_level.txt,sha256=_Hlsp7pvMvyV14LFg-vk1hULq30j61EILnnxMFIhhc8,4
102
+ mas_cli-11.6.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.1.0)
2
+ Generator: setuptools (75.3.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5