Skip to content

Commit 081c481

Browse files
voiletvoilet
voilet
authored and
voilet
committed
repair salt api >0.8.5 bug
1 parent e5d400f commit 081c481

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

salt_ui/api/salt_https_api.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
import urllib2, cookielib, urllib, yaml, json
1515
import requests
1616

17-
#requests.packages.urllib3.disable_warnings()
17+
18+
# requests.packages.urllib3.disable_warnings()
1819

1920

2021
class salt_api_token(object):
@@ -24,16 +25,17 @@ class salt_api_token(object):
2425
salt_api_url, {'X-Auth-Token' : token_api_id})
2526
"""
2627

27-
def __init__(self, data, url, token=None):
28+
def __init__(self, data, url, token=None, swheel=True):
2829
self.data = data
2930
self.url = url
3031
self.headers = {
3132
'CustomUser-agent': 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)',
3233
"Accept": "application/x-yaml",
3334
}
34-
s = {'expr_form': 'list', "client": "local_async"}
35+
if swheel:
36+
s = {'expr_form': 'list', "client": "local_async"}
37+
self.data.update(s)
3538
self.headers.update(token)
36-
self.data.update(s)
3739

3840
def run(self):
3941
req = requests.post(self.url, headers=self.headers, data=self.data, verify=False)

salt_ui/views/key.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,8 @@ def salt_key_list(request):
336336
'fun': 'key.list_all',
337337
},
338338
salt_api_url,
339-
{"X-Auth-Token": token_api_id}
339+
{"X-Auth-Token": token_api_id},
340+
swheel=False
340341
)
341342
list_all = list_all.run()
342343
data = list_all['return'][0]

0 commit comments

Comments
 (0)