mas-cli 15.4.0__py3-none-any.whl → 15.5.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.

mas/cli/update/app.py CHANGED
@@ -11,6 +11,7 @@
11
11
 
12
12
  import logging
13
13
  import logging.handlers
14
+ from typing import Callable
14
15
  from halo import Halo
15
16
  from prompt_toolkit import print_formatted_text, HTML
16
17
 
@@ -21,7 +22,7 @@ from ..validators import StorageClassValidator
21
22
  from .argParser import updateArgParser
22
23
 
23
24
  from mas.devops.ocp import createNamespace, getStorageClasses, getConsoleURL
24
- from mas.devops.mas import listMasInstances, getCurrentCatalog
25
+ from mas.devops.mas import listMasInstances, listAiServiceInstances, getCurrentCatalog
25
26
  from mas.devops.tekton import preparePipelinesNamespace, installOpenShiftPipelines, updateTektonDefinitions, launchUpdatePipeline
26
27
 
27
28
 
@@ -94,7 +95,10 @@ class UpdateApp(BaseApp):
94
95
  # deprecated MaximoApplicationSuite ImageContentSourcePolicy instead of the new ImageDigestMirrorSet
95
96
  self.isAirgap()
96
97
  self.reviewCurrentCatalog()
97
- self.reviewMASInstance()
98
+ isMasInstalled = self.reviewMASInstance()
99
+ isAiServiceInstalled = self.reviewAiServiceInstance()
100
+ if not isMasInstalled and not isAiServiceInstalled:
101
+ self.fatalError(["No MAS or AI Service instances were detected on the cluster => nothing to update! See log file for details"])
98
102
 
99
103
  if self.args.mas_catalog_version is None:
100
104
  # Interactive mode
@@ -228,15 +232,23 @@ class UpdateApp(BaseApp):
228
232
  f" <u>{catalogInfo['image']}</u>"
229
233
  ])
230
234
 
231
- def reviewMASInstance(self) -> None:
232
- self.printH1("Review MAS Instances")
233
- self.printDescription(["The following MAS intances are installed on the target cluster and will be affected by the catalog update:"])
235
+ def reviewMASInstance(self) -> bool:
236
+ return self.reviewInstances(listMasInstances, 'MAS', 'Suite.core.mas.ibm.com/v1')
237
+
238
+ def reviewAiServiceInstance(self) -> bool:
239
+ return self.reviewInstances(listAiServiceInstances, 'AI Service', 'AIServiceApp.aiservice.ibm.com/v1')
240
+
241
+ def reviewInstances(self, getInstances: Callable, name: str, kind: str) -> bool:
242
+ self.printH1(f"Review {name} Instances")
234
243
  try:
235
- suites = listMasInstances(self.dynamicClient)
236
- for suite in suites:
237
- self.printDescription([f"- <u>{suite['metadata']['name']}</u> v{suite['status']['versions']['reconciled']}"])
244
+ instances = getInstances(self.dynamicClient)
245
+ self.printDescription([f"The following {name} instances are installed on the target cluster and will be affected by the catalog update:"])
246
+ for instance in instances:
247
+ self.printDescription([f"- <u>{instance['metadata']['name']}</u> v{instance['status']['versions']['reconciled']}"])
248
+ return True
238
249
  except ResourceNotFoundError:
239
- 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")
250
+ self.printDescription([f"No {name} instances were detected on the cluster ({kind} API is not available)"])
251
+ return False
240
252
 
241
253
  def chooseCatalog(self) -> None:
242
254
  self.printH1("Select IBM Maximo Operator Catalog Version")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mas-cli
3
- Version: 15.4.0
3
+ Version: 15.5.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
@@ -1,5 +1,5 @@
1
- mas/cli/__init__.py,sha256=j5gTptbFChwynOmhMQP6gl7ZZl9c6aCl8bS0iHbY8Zw,526
2
- mas/cli/cli.py,sha256=TvAP_69oZVoTuUIW1vMtaH9GFmLqC9GP-XaJHlLgOzU,18932
1
+ mas/cli/__init__.py,sha256=y8o8bkmTCBmPQkRGRoZX7w2hYxXB6lXr_4c9U5smkgw,526
2
+ mas/cli/cli.py,sha256=qs5ug_r6CoFXF5iZ20mfzHrr0PlfiDBbZrRkQDr71ZY,18932
3
3
  mas/cli/displayMixins.py,sha256=e3lAx1DIOwsriDcNI0M2JyP1jeLOZKvId6sPrvWLyqs,5984
4
4
  mas/cli/gencfg.py,sha256=kgbYihOcqGADK8XnrfcEoBawaY1qSGKuVNW1unACOnU,4433
5
5
  mas/cli/validators.py,sha256=YBxkKOHO0d-EK61nUflVOd0-Mxmjuq_nbPYWyKD0VKc,5844
@@ -24,7 +24,7 @@ mas/cli/install/settings/manageSettings.py,sha256=796r5Gyub07cPn8q65kh_h-KjFRVCH
24
24
  mas/cli/install/settings/mongodbSettings.py,sha256=aZdQHpeMwLVznrJWAkJsZu2Ok9t4Dkra2RGa_uKJHaY,2604
25
25
  mas/cli/install/settings/turbonomicSettings.py,sha256=ul4eWf53b1NCzJTFsEPX6DWM23YUlWILYBygplqXYlU,1631
26
26
  mas/cli/templates/facilities-configs.yml.j2,sha256=Er4UwxUl1Y3rtjIPMExVM8EXNcbesMusgLcRV050B1s,774
27
- mas/cli/templates/ibm-mas-tekton.yaml,sha256=1R8k16JhOMsRNAXrfGKVgQ-zsJ4W5IT1EyQmyj56hkM,1563093
27
+ mas/cli/templates/ibm-mas-tekton.yaml,sha256=jypOeaLxOIy-jlGqgmhn9BChTgKEVZs4JT71Hezl7l8,1563095
28
28
  mas/cli/templates/jdbccfg.yml.j2,sha256=cANbwkUkKEPQp-P3_BB_Llbt94457Ciagah2hOdySIM,1644
29
29
  mas/cli/templates/suite_mongocfg.yml.j2,sha256=WrgJUfGyvfaRIHjY5VR_zLZ5irTpV5khKNq76ejIxKU,1606
30
30
  mas/cli/templates/pod-templates/best-effort/ibm-data-dictionary-assetdatadictionary.yml,sha256=8VG_FDFcEjWNaAOZTcS58Pe0tWOXC10SJLloNqzEMC8,757
@@ -101,14 +101,14 @@ mas/cli/uninstall/__init__.py,sha256=v0WJlcdrSycWGT5ofFjRDV3jTZ8AqVCz1AGxok4Khtc
101
101
  mas/cli/uninstall/app.py,sha256=uPJy3z-1Yt66MSFdZz1Qh8MjA97ZrQmjSgTx-Gqua9I,10047
102
102
  mas/cli/uninstall/argParser.py,sha256=VVG4myUvFOtg98L6HAzpgGg7s5c-vub_UMZPGuNQko4,3452
103
103
  mas/cli/update/__init__.py,sha256=v0WJlcdrSycWGT5ofFjRDV3jTZ8AqVCz1AGxok4Khtc,508
104
- mas/cli/update/app.py,sha256=wEJx7eyHlhM70uoa8iccKAF7T2MHQ33laxQ40Y-vziE,39559
104
+ mas/cli/update/app.py,sha256=xRodxuqcd840w952MDseoIptnbNoXV_9nK957AnEYAs,40264
105
105
  mas/cli/update/argParser.py,sha256=oOIXzB_rsI2p3og_5X5SFt_g7LURyEdLxZeiGCKq1nU,4711
106
106
  mas/cli/upgrade/__init__.py,sha256=v0WJlcdrSycWGT5ofFjRDV3jTZ8AqVCz1AGxok4Khtc,508
107
107
  mas/cli/upgrade/app.py,sha256=ZaT8tGrFfIsZM2dkvoYBy89EiqQ0ZKgEfhbMYdf0UEc,8873
108
108
  mas/cli/upgrade/argParser.py,sha256=5JxAcbwKjFKCKnbucCxg7Xacdhjphb9nRORfsgB1h_0,2196
109
109
  mas/cli/upgrade/settings/__init__.py,sha256=QI2CUsj-NXBU1qrPOsOk4MbeWnfNq0UOF3rYYc_1l2A,775
110
- mas_cli-15.4.0.data/scripts/mas-cli,sha256=ijL4Ecg_2fRtdrQ8Mk28qsi6o3O6KRIAUM8BUry5cPs,3621
111
- mas_cli-15.4.0.dist-info/METADATA,sha256=TxxsdJ4tBElD35MxIB5th-TXp2dPOlrG00M7Jn-P6_I,2258
112
- mas_cli-15.4.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
113
- mas_cli-15.4.0.dist-info/top_level.txt,sha256=_Hlsp7pvMvyV14LFg-vk1hULq30j61EILnnxMFIhhc8,4
114
- mas_cli-15.4.0.dist-info/RECORD,,
110
+ mas_cli-15.5.0.data/scripts/mas-cli,sha256=ijL4Ecg_2fRtdrQ8Mk28qsi6o3O6KRIAUM8BUry5cPs,3621
111
+ mas_cli-15.5.0.dist-info/METADATA,sha256=Cz1o-cdG885XeA5ZQcZuaZrrclN6UDP0nRqZHtP47c0,2258
112
+ mas_cli-15.5.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
113
+ mas_cli-15.5.0.dist-info/top_level.txt,sha256=_Hlsp7pvMvyV14LFg-vk1hULq30j61EILnnxMFIhhc8,4
114
+ mas_cli-15.5.0.dist-info/RECORD,,