Skip to content

Commit 7dab8bf

Browse files
committed
Adjust MCP Server App download script
1 parent 89770c0 commit 7dab8bf

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

scripts/download_splunk_mcp_server_app.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,24 +44,20 @@ def run() -> None:
4444
client = httpx.Client(follow_redirects=True)
4545
response = client.post(
4646
f"{SPLUNKBASE_URL}/api/account:login",
47-
data={
48-
"username": username,
49-
"password": password,
50-
},
5147
headers={"Content-Type": "application/x-www-form-urlencoded"},
48+
data={"username": username, "password": password},
5249
)
53-
5450
response.raise_for_status()
5551

56-
root = ET.fromstring(response.text)
57-
58-
token = next(elem.text for elem in root if elem.tag.endswith("id"))
52+
response_xml = ET.fromstring(response.text)
53+
token = next(elem.text for elem in response_xml if elem.tag.endswith("id"))
5954
if token is None:
6055
raise AssertionError("token not found in the response")
6156

6257
response = client.get(
6358
f"{SPLUNKBASE_URL}/api/v1/app/{SPLUNK_MCP_APP_ID}/?include=release",
64-
headers={"Authorization": f"Bearer {token}"},
59+
# ? Might not be needed here after all?
60+
# headers={"Authorization": f"Bearer {token}"},
6561
)
6662
response.raise_for_status()
6763

0 commit comments

Comments
 (0)