Skip to content

Commit

Permalink
Fixed bug in relaunching deployment script
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardogsilva committed Nov 27, 2024
1 parent 418e9c2 commit 3f1b0a5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions deployments/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ class _RelaunchDeploymentScript:
def handle(self) -> None:
call_args = self.original_call_args[:]
# prevent infinite loops by ensuring we set the --no-auto-update flag
if args.index(_DO_NOT_UPDATE_FLAG_NAME) == -1:
if call_args.index(_DO_NOT_UPDATE_FLAG_NAME) == -1:
call_args.append(_DO_NOT_UPDATE_FLAG_NAME)
os.execv(sys.executable, call_args)

Expand Down Expand Up @@ -562,15 +562,15 @@ def perform_deployment(
"Defaults to whatever is specified in the configuration file."
),
)
args = parser.parse_args()
logging.basicConfig(level=logging.DEBUG if args.verbose else logging.WARNING)
config_file = args.config_file.resolve()
parsed_args = parser.parse_args()
logging.basicConfig(level=logging.DEBUG if parsed_args.verbose else logging.WARNING)
config_file = parsed_args.config_file.resolve()
logger.debug(f"{config_file=}")
if config_file.exists():
deployment_config = get_configuration(config_file)
if (backend_image_name := args.backend_image) is not None:
if (backend_image_name := parsed_args.backend_image) is not None:
deployment_config.backend_image = backend_image_name
if (frontend_image_name := args.frontend_image) is not None:
if (frontend_image_name := parsed_args.frontend_image) is not None:
deployment_config.frontend_image = frontend_image_name
deployment_config.ensure_paths_exist()
logger.debug("Configuration:")
Expand All @@ -579,8 +579,8 @@ def perform_deployment(
try:
perform_deployment(
configuration=deployment_config,
auto_update=not args.no_auto_update,
confirmed=args.confirm,
auto_update=not parsed_args.no_auto_update,
confirmed=parsed_args.confirm,
)
except RuntimeError as err:
raise SystemExit(err) from err
Expand Down

0 comments on commit 3f1b0a5

Please sign in to comment.