Skip to content

Commit 050fc8b

Browse files
Merge pull request #642 from AutomationSolutionz/bug-160-group-installer-password-fails
Bug 160 group installer password fails
2 parents 0e8b6bb + dac35c9 commit 050fc8b

3 files changed

Lines changed: 21 additions & 7 deletions

File tree

Framework/install_handler/long_poll_handler.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,12 @@ async def on_message(self, message: Response) -> None:
276276
}
277277
)
278278
elif action == "group_install":
279+
280+
user_password = ""
281+
if message.value.item:
282+
user_password = (
283+
getattr(message.value.item, "user_password", "") or ""
284+
)
279285
await send_response(
280286
{
281287
"action": "group_install",
@@ -294,7 +300,14 @@ async def on_message(self, message: Response) -> None:
294300
if i["install_function"]
295301
]
296302
for func in functions:
297-
await func()
303+
# Check if function accepts parameters
304+
sig = inspect.signature(func)
305+
if len(sig.parameters) > 0:
306+
# Function accepts parameters, pass user_password
307+
await func(user_password)
308+
else:
309+
# Function doesn't accept parameters, call without (backward compatibility)
310+
await func()
298311
await send_response(
299312
{
300313
"action": "group_install",

Framework/install_handler/route.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
"os": ["darwin"],
111111
"status_function": xcode.check_status,
112112
"install_function": xcode.install,
113-
"user_password": "yes",
113+
"user_password": True,
114114
},
115115
{
116116
"name": "Simulator",
@@ -121,7 +121,7 @@
121121
"os": ["darwin"],
122122
"status_function": simulator.check_status,
123123
"install_function": simulator.install,
124-
"user_password": "yes",
124+
"user_password": True,
125125
},
126126
],
127127
},
@@ -167,7 +167,7 @@
167167
"os": ["windows", "linux", "darwin"],
168168
"status_function": mozilla.check_status,
169169
"install_function": mozilla.install,
170-
"user_password": False,
170+
"user_password": True,
171171
},
172172
{
173173
"name": "Edge",
@@ -178,7 +178,7 @@
178178
"os": ["windows", "linux", "darwin"],
179179
"status_function": edge.check_status,
180180
"install_function": edge.install,
181-
"user_password": "yes",
181+
"user_password": True,
182182
},
183183
],
184184
},
@@ -198,7 +198,7 @@
198198
"os": ["darwin"],
199199
"status_function": macos_xcode.check_status,
200200
"install_function": macos_xcode.install,
201-
"user_password": "yes",
201+
"user_password": True,
202202
}
203203
],
204204
},
@@ -219,7 +219,7 @@
219219
"os": ["windows"],
220220
"status_function": inspector.check_status,
221221
"install_function": inspector.install,
222-
"user_password": "no",
222+
"user_password": False,
223223
}
224224
],
225225
},

Framework/install_handler/web/edge.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,7 @@ async def _verify_edge_installation():
679679

680680

681681
async def install(user_password: str = "") -> bool:
682+
682683
"""Main function to install Microsoft Edge"""
683684
print("[installer][web-edge] Installing Microsoft Edge...")
684685

0 commit comments

Comments
 (0)