Skip to content
Snippets Groups Projects
Commit 6ba74954 authored by ale's avatar ale
Browse files

Update floatup.py

parent 6530caab
No related branches found
No related tags found
No related merge requests found
Pipeline #85131 failed
...@@ -49,8 +49,12 @@ def do_request(url, ssh_gw, payload): ...@@ -49,8 +49,12 @@ def do_request(url, ssh_gw, payload):
def encode_dashboard_request(req): def encode_dashboard_request(req):
# JSON data, in a raw zlib stream, base64-encoded. # JSON data, in a raw zlib stream, base64-encoded.
hosts = sorted(req['hosts'], key=lambda x: x['name']) payload = {
data = json.dumps(hosts, separators=(',', ':')).encode('utf-8') 'inv': sorted(req['hosts'], key=lambda x: x['name']),
'job': os.getenv('CI_JOB_ID'),
'proj': os.getenv('CI_PROJECT_PATH'),
}
data = json.dumps(payload, separators=(',', ':')).encode('utf-8')
comp = zlib.compressobj(level=9, wbits=-9) comp = zlib.compressobj(level=9, wbits=-9)
comp.compress(data) comp.compress(data)
return base64.urlsafe_b64encode(comp.flush()).decode('ascii') return base64.urlsafe_b64encode(comp.flush()).decode('ascii')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment