qontract-reconcile 0.10.1rc1191__py3-none-any.whl → 0.10.1rc1193__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: qontract-reconcile
3
- Version: 0.10.1rc1191
3
+ Version: 0.10.1rc1193
4
4
  Summary: Collection of tools to reconcile services with their desired state as defined in the app-interface DB.
5
5
  Home-page: https://github.com/app-sre/qontract-reconcile
6
6
  Author: Red Hat App-SRE Team
@@ -818,7 +818,7 @@ reconcile/utils/runtime/sharding.py,sha256=r0ieUtNed7NvknSw6qQrCkKpVXE1shuHGnfFc
818
818
  reconcile/utils/saasherder/__init__.py,sha256=3U8plqMAPRE1kjwZ5YnIsYsggTf4_gS7flRUEuXVBAs,343
819
819
  reconcile/utils/saasherder/interfaces.py,sha256=C2wrw34OXypshVocAsPrVZsSHptgw4g9u7Haa2wulZQ,9087
820
820
  reconcile/utils/saasherder/models.py,sha256=z8ln03zi2a8cu716NcNUDHp8Dv1VcVbhqdWVxCl7x9A,10148
821
- reconcile/utils/saasherder/saasherder.py,sha256=t7dqcXj9FFULROG_gUmdoSNQOLKfhdlquzwxw710yOA,85358
821
+ reconcile/utils/saasherder/saasherder.py,sha256=120A33jOQefZfYUpeDzaeNR4-Twe5V5bsBSe0DoOCSo,86115
822
822
  reconcile/utils/terraform/__init__.py,sha256=zNbiyTWo35AT1sFTElL2j_AA0jJ_yWE_bfFn-nD2xik,250
823
823
  reconcile/utils/terraform/config.py,sha256=5UVrd563TMcvi4ooa5JvWVDW1I3bIWg484u79evfV_8,164
824
824
  reconcile/utils/terraform/config_client.py,sha256=gRL1rQ0AqvShei_rcGqC3HDYGskOFKE1nPrJyJE9yno,4676
@@ -838,12 +838,12 @@ tools/app_interface_metrics_exporter.py,sha256=zkwkxdAUAxjdc-pzx2_oJXG25fo0Fnyd5
838
838
  tools/app_interface_reporter.py,sha256=oZPib4HPq0aZ2Zui1QGJGk6qQdfpeihujGDBnSdKyGE,17627
839
839
  tools/glitchtip_access_reporter.py,sha256=oPBnk_YoDuljU3v0FaChzOwwnk4vap1xEE67QEjzdqs,2948
840
840
  tools/glitchtip_access_revalidation.py,sha256=8kbBJk04mkq28kWoRDDkfCGIF3GRg3pJrFAh1sW0dbk,2821
841
- tools/qontract_cli.py,sha256=cYuovHYsRDm1CyIEdhMgx2qUkyl1tXqOO5glxAN1h8c,143860
841
+ tools/qontract_cli.py,sha256=f64mkGqv7WfZa-HvhiMe_Cig3XjOUdzwCm-MBG3DqCs,143755
842
842
  tools/sd_app_sre_alert_report.py,sha256=e9vAdyenUz2f5c8-z-5WY0wv-SJ9aePKDH2r4IwB6pc,5063
843
843
  tools/template_validation.py,sha256=qpKYaTgk0GOPGa2Ct5_5sKdwIHtCAKIBGzsMPuJU5fw,3371
844
844
  tools/cli_commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
845
845
  tools/cli_commands/container_images_report.py,sha256=64LXkv3eoWtMFZwBgkYE9jSnReDD7A9M0GEVXsR9aGk,5183
846
- tools/cli_commands/erv2.py,sha256=f_Zc5ZCPenXbFj8zv_kcKJgmGkErYHGNIhbzOfOaD4Q,22041
846
+ tools/cli_commands/erv2.py,sha256=pWjd6yBhzakB1Lz4DUaESTbzEIO9-Njc7p7k_gvZj1U,22040
847
847
  tools/cli_commands/gpg_encrypt.py,sha256=x02JOMn834z89YSNvr5B-oJky7rR1C0begCkPh45eHk,4958
848
848
  tools/cli_commands/systems_and_tools.py,sha256=EMHOF1AtUDaoSk0bbjl6oUKYAz4rTZjIBaF-6E6GspM,16816
849
849
  tools/cli_commands/cost_report/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -882,8 +882,8 @@ tools/test/test_qontract_cli.py,sha256=iuzKbQ6ahinvjoQmQLBrG4shey0z-1rB6qCgS8T6d
882
882
  tools/test/test_saas_promotion_state.py,sha256=dy4kkSSAQ7bC0Xp2CociETGN-2aABEfL6FU5D9Jl00Y,6056
883
883
  tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
884
884
  tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
885
- qontract_reconcile-0.10.1rc1191.dist-info/METADATA,sha256=PYtZqqEcXMwJNmaFvFxZTdM7fWRL05zlsWrO6ZboOOQ,2213
886
- qontract_reconcile-0.10.1rc1191.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
887
- qontract_reconcile-0.10.1rc1191.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
888
- qontract_reconcile-0.10.1rc1191.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
889
- qontract_reconcile-0.10.1rc1191.dist-info/RECORD,,
885
+ qontract_reconcile-0.10.1rc1193.dist-info/METADATA,sha256=k_Cwgii6ONKxPtx4vnZZQfe5EXDW2C19xn5t5PFWj1o,2213
886
+ qontract_reconcile-0.10.1rc1193.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
887
+ qontract_reconcile-0.10.1rc1193.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
888
+ qontract_reconcile-0.10.1rc1193.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
889
+ qontract_reconcile-0.10.1rc1193.dist-info/RECORD,,
@@ -1112,29 +1112,54 @@ class SaasHerder: # pylint: disable=too-many-public-methods
1112
1112
  username, password = (
1113
1113
  base64.b64decode(auth["auth"]).decode("utf-8").split(":")
1114
1114
  )
1115
- with suppress(Exception):
1116
- return Image(
1117
- image,
1118
- username=username,
1119
- password=password,
1120
- auth_server=image_auth.auth_server,
1121
- timeout=REQUEST_TIMEOUT,
1122
- )
1115
+
1116
+ return SaasHerder._get_and_validate_image(
1117
+ full_image_path=image,
1118
+ username=username,
1119
+ password=password,
1120
+ auth_server=image_auth.auth_server,
1121
+ timeout=REQUEST_TIMEOUT,
1122
+ error_prefix=error_prefix,
1123
+ )
1123
1124
 
1124
1125
  # basic auth fallback for backwards compatibility
1126
+ return SaasHerder._get_and_validate_image(
1127
+ full_image_path=image,
1128
+ username=image_auth.username,
1129
+ password=image_auth.password,
1130
+ auth_server=image_auth.auth_server,
1131
+ timeout=REQUEST_TIMEOUT,
1132
+ error_prefix=error_prefix,
1133
+ )
1134
+
1135
+ @staticmethod
1136
+ def _get_and_validate_image(
1137
+ full_image_path: str,
1138
+ username: str | Any,
1139
+ password: str | Any,
1140
+ auth_server: str | Any,
1141
+ timeout: int,
1142
+ error_prefix: str,
1143
+ ) -> Image | None:
1125
1144
  try:
1126
- return Image(
1127
- image,
1128
- username=image_auth.username,
1129
- password=image_auth.password,
1130
- auth_server=image_auth.auth_server,
1131
- timeout=REQUEST_TIMEOUT,
1145
+ img = Image(
1146
+ full_image_path,
1147
+ username=username,
1148
+ password=password,
1149
+ auth_server=auth_server,
1150
+ timeout=timeout,
1132
1151
  )
1152
+ if img:
1153
+ return img
1154
+ else:
1155
+ logging.error(
1156
+ f"{error_prefix} Image : {full_image_path} does not exist"
1157
+ )
1133
1158
  except Exception as e:
1134
1159
  logging.error(
1135
- f"{error_prefix} Image is invalid: {image}. " + f"details: {e!s}"
1160
+ f"{error_prefix} Image is invalid: {full_image_path}. "
1161
+ + f"details: {e!s}"
1136
1162
  )
1137
-
1138
1163
  return None
1139
1164
 
1140
1165
  def _check_images(
@@ -470,7 +470,7 @@ class TerraformCli:
470
470
  self.progress_spinner.stop()
471
471
  if not Confirm.ask(
472
472
  "\nEverything ok? Would you like to upload the modified terraform states",
473
- default=False,
473
+ default=True,
474
474
  ):
475
475
  return
476
476
 
tools/qontract_cli.py CHANGED
@@ -4229,8 +4229,7 @@ def migrate(ctx, dry_run: bool, skip_build: bool) -> None:
4229
4229
 
4230
4230
  if not Confirm.ask(
4231
4231
  dedent("""
4232
- Please disable terraform-resources: [i blue]https://app-interface.unleash.devshift.net/projects/default/features/terraform-resources[/]
4233
- in Unleash before proceeding!
4232
+ Please ensure [red]terraform-resources[/] is disabled before proceeding!
4234
4233
 
4235
4234
  Do you want to proceed?"""),
4236
4235
  default=True,