mirror of
https://github.com/ansible/awx.git
synced 2024-10-27 17:55:10 +03:00
Make HTTPConnection import python 2,3 agnostic
This commit is contained in:
parent
00c9d756e8
commit
c49e64e62c
@ -273,12 +273,15 @@ spec:
|
||||
- /usr/bin/python
|
||||
- -c
|
||||
- |
|
||||
import httplib
|
||||
try:
|
||||
from http.client import HTTPConnection
|
||||
except ImportError:
|
||||
from httplib import HTTPConnection
|
||||
import sys
|
||||
import os
|
||||
import base64
|
||||
authsecret = base64.b64encode(os.getenv('RABBITMQ_USER') + ':' + os.getenv('RABBITMQ_PASSWORD'))
|
||||
conn=httplib.HTTPConnection('localhost:15672')
|
||||
conn=HTTPConnection('localhost:15672')
|
||||
conn.request('GET', '/api/healthchecks/node', headers={'Authorization': 'Basic %s' % authsecret})
|
||||
r1 = conn.getresponse()
|
||||
if r1.status != 200:
|
||||
@ -297,12 +300,15 @@ spec:
|
||||
- /usr/bin/python
|
||||
- -c
|
||||
- |
|
||||
import httplib
|
||||
try:
|
||||
from http.client import HTTPConnection
|
||||
except ImportError:
|
||||
from httplib import HTTPConnection
|
||||
import sys
|
||||
import os
|
||||
import base64
|
||||
authsecret = base64.b64encode(os.getenv('RABBITMQ_USER') + ':' + os.getenv('RABBITMQ_PASSWORD'))
|
||||
conn=httplib.HTTPConnection('localhost:15672')
|
||||
conn=HTTPConnection('localhost:15672')
|
||||
conn.request('GET', '/api/healthchecks/node', headers={'Authorization': 'Basic %s' % authsecret})
|
||||
r1 = conn.getresponse()
|
||||
if r1.status != 200:
|
||||
|
Loading…
Reference in New Issue
Block a user