77import re
88import sys
99
10- import semantic_version
10+ import ibex_install_utils .default_args
11+ import semantic_version # pyright: ignore
1112from ibex_install_utils .exceptions import ErrorInTask , UserStop
1213from ibex_install_utils .file_utils import FileUtils
1314from ibex_install_utils .install_tasks import UPGRADE_TYPES , UpgradeInstrument
1415from ibex_install_utils .logger import Logger
1516from ibex_install_utils .user_prompt import UserPrompt
1617
1718
18- def _get_latest_release_path (release_dir ) :
19+ def _get_latest_release_path (release_dir : str ) -> str :
1920 regex = re .compile (r"^\d+\.\d+\.\d+$" )
2021
2122 releases = [
@@ -31,7 +32,7 @@ def _get_latest_release_path(release_dir):
3132 return os .path .join (release_dir , f"{ current_release } " )
3233
3334
34- def _get_latest_existing_dir_path (release_dir , component ) :
35+ def _get_latest_existing_dir_path (release_dir : str , component : str ) -> str :
3536 regex = re .compile (r"^\d+\.\d+\.\d+$" )
3637
3738 releases = [
@@ -108,7 +109,10 @@ def _get_latest_existing_dir_path(release_dir, component):
108109 )
109110 parser .add_argument ("--kits_icp_dir" , default = None , help = "Directory of kits/ICP" )
110111 parser .add_argument (
111- "--server_arch" , default = "x64" , choices = ["x64" , "x86" ], help = "Server build architecture."
112+ "--server_arch" ,
113+ default = ibex_install_utils .default_args .SERVER_ARCH ,
114+ choices = ["x64" , "x86" ],
115+ help = "Server build architecture." ,
112116 )
113117
114118 deployment_types = [
@@ -122,6 +126,8 @@ def _get_latest_existing_dir_path(release_dir, component):
122126
123127 args = parser .parse_args ()
124128
129+ ibex_install_utils .default_args .SERVER_ARCH = args .server_arch
130+
125131 if not args .no_log_to_var :
126132 Logger .set_up ()
127133
@@ -165,8 +171,8 @@ def _get_latest_existing_dir_path(release_dir, component):
165171 )
166172 except UserStop :
167173 print (
168- "To specify the directory you want use --server_dir, --client_dir, and --genie_python3_dir "
169- "when running the IBEX_upgrade.py script."
174+ "To specify the directory you want use --server_dir, --client_dir, and"
175+ " --genie_python3_dir when running the IBEX_upgrade.py script."
170176 )
171177 sys .exit (2 )
172178
0 commit comments