Skip to content

Commit

Permalink
adding loop for check system up
Browse files Browse the repository at this point in the history
adding loop for check system up
  • Loading branch information
PraveenPenguin authored Sep 21, 2024
1 parent 04dd8f7 commit 2262d1d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/configparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,15 @@ def confparser(self, section, option):

def checkSys(self, addr, name):
'''Check for server availability'''
rc = os.system("ping -c 1 %s > /dev/null" % addr)
rc = os.system("ping -c 8 %s > /dev/null" % addr)
for x in range(6):
if rc:
rc = os.system("ping -c 1 %s > /dev/null" % addr)
else:
break
if rc:
logging.info("%s not reachable : %s" % (name, addr))
logging.info("Aborting Installation : Check log for errors")
exit(1)
logging.info("%s is reachable : OK" % name)

def validate(self):
Expand Down

0 comments on commit 2262d1d

Please sign in to comment.