Skip to content

Commit

Permalink
Merge pull request #1 from itsmesinghavneet/patch-1
Browse files Browse the repository at this point in the history
Update cluster_health_check.py
  • Loading branch information
ibreakthecloud committed Aug 19, 2018
2 parents 3f703df + 24f9140 commit 74dbc98
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions k8s/utils/health/cluster_health_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def create_api():
v1=client.CoreV1Api()
break
except Exception as e:
print "error occurred while creating core v1 api:", e
#print "error occurred while creating core v1 api:", e
return v1

def get_nodes(node_count):
Expand All @@ -42,7 +42,7 @@ def get_nodes(node_count):
if len(getNodes.items) == int(node_count):
return getNodes.items
except Exception as e:
print "error occured while getting nodes:", e
#print "error occured while getting nodes:", e

def get_node_status(node_count):
count = 0
Expand All @@ -61,16 +61,16 @@ def checkCluster(node_count):
if count == int(node_count):
break
except Exception as e:
print 'error occured while itirating over status object:', e
print('Cluster is Up and Running')
#print 'error occured while itirating over status object:', e
#print('Cluster is Up and Running')

def get_kube_config():
while True:
try:
config.load_kube_config()
break
except Exception as e:
print "kubeconfig not loaded.\n",e, "retrying..."
#print "kubeconfig not loaded.\n",e, "retrying..."

def get_args():
parser = argparse.ArgumentParser()
Expand All @@ -87,7 +87,7 @@ def init():
exit = checkCluster(nodes)
return exit
except Exception as e:
print "Error Occured:", e
#print "Error Occured:", e

if __name__ == '__main__':
p = multiprocessing.Process(target=init, name="main")
Expand All @@ -104,4 +104,4 @@ def init():
p.terminate()
sys.exit(1)
time.sleep(1)
timeElapsed += 1
timeElapsed += 1

0 comments on commit 74dbc98

Please sign in to comment.