File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments