remove unnecessary exit conditions

This commit is contained in:
Clint Armstrong
2015-07-16 11:55:04 -04:00
parent 9931d9dc44
commit b73b49bfcb

View File

@@ -89,32 +89,28 @@ db_dbname = config['db_name']
try: try:
amount_of_workers = int(config['poller_service_workers']) amount_of_workers = int(config['poller_service_workers'])
if amount_of_workers == 0: if amount_of_workers == 0:
log.critical("ERROR: 0 threads is not a valid value") amount_of_workers = 16
sys.exit(2)
except KeyError: except KeyError:
amount_of_workers = 16 amount_of_workers = 16
try: try:
poll_frequency = int(config['poller_service_poll_frequency']) poll_frequency = int(config['poller_service_poll_frequency'])
if poll_frequency == 0: if poll_frequency == 0:
log.critical("ERROR: 0 seconds is not a valid value") poll_frequency = 300
sys.exit(2)
except KeyError: except KeyError:
poll_frequency = 300 poll_frequency = 300
try: try:
discover_frequency = int(config['poller_service_discover_frequency']) discover_frequency = int(config['poller_service_discover_frequency'])
if discover_frequency == 0: if discover_frequency == 0:
log.critical("ERROR: 0 seconds is not a valid value") discover_frequency = 21600
sys.exit(2)
except KeyError: except KeyError:
discover_frequency = 21600 discover_frequency = 21600
try: try:
down_retry = int(config['poller_service_down_retry']) down_retry = int(config['poller_service_down_retry'])
if down_retry == 0: if down_retry == 0:
log.critical("ERROR: 0 seconds is not a valid value") down_retry = 60
sys.exit(2)
except KeyError: except KeyError:
down_retry = 60 down_retry = 60