blob: 09098b23d0757d73e8aa775f3a135fafba660619 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#!/usr/local/bin/python2.7
import argparse
import requests
import sys
from time import sleep
conductor_url = "http://{0}:8084/MaveriQConductor/isReady"
check_api = "http://{0}:8084/MaveriQManager/api/Inventory/isReady"
check_user = "omniq"
check_password = "radcom"
PARSER = argparse.ArgumentParser()
PARSER.add_argument("ScribeIP", type=str,
help="The Stage the application is currently in")
ARGS = PARSER.parse_args()
print("Beginning check availability check!")
isConnected = False
while isConnected is False:
try:
sys.stdout.write('.')
sleep(2)
if requests.get(conductor_url.format(ARGS.ScribeIP),
headers={'Connection': 'close'}).status_code == 200 and requests.get(
check_api.format(ARGS.ScribeIP,
headers={'Connection': 'close'}),
auth=requests.auth.HTTPBasicAuth(check_user,
check_password)).status_code == 200:
isConnected = True
except requests.exceptions.ConnectionError as e:
sleep(2)
print('Conductor and Scribe are ready!')
|