Loading bin/cc-node +6 −10 Original line number Diff line number Diff line Loading @@ -10,7 +10,6 @@ import logging import logging.handlers import signal import threading import socket from time import sleep from math import exp Loading @@ -26,7 +25,7 @@ DEFAULT_CONFIG_FILE = '/etc/cc-node.conf' DEFAULT_PID_FILE = '/var/run/cc-node.pid' DEFAULT_CONFIGURATION = { 'address': None, 'login': '$HOSTNAME', 'login': None, 'password': None, 'port': 1984, 'verbosity': 0, Loading Loading @@ -68,19 +67,16 @@ def run_node(options): def authentication(): timeout = 1 login = options['login'].replace('$HOSTNAME', socket.gethostname()) while node.manager.is_running(): try: node.authentify(login, options['password']) except RpcError as error: logging.critical('Authentication error: %s' % error) sleep(2) result = node.authentify(options['login'], options['password']) if result: logging.info('Authentication suscessfull.') return else: timeout += 0.1 print exp(timeout) sleep(exp(timeout)) logging.info('Authenticated to server') break def shutdown_handler(signum, frame): ''' Loading Loading
bin/cc-node +6 −10 Original line number Diff line number Diff line Loading @@ -10,7 +10,6 @@ import logging import logging.handlers import signal import threading import socket from time import sleep from math import exp Loading @@ -26,7 +25,7 @@ DEFAULT_CONFIG_FILE = '/etc/cc-node.conf' DEFAULT_PID_FILE = '/var/run/cc-node.pid' DEFAULT_CONFIGURATION = { 'address': None, 'login': '$HOSTNAME', 'login': None, 'password': None, 'port': 1984, 'verbosity': 0, Loading Loading @@ -68,19 +67,16 @@ def run_node(options): def authentication(): timeout = 1 login = options['login'].replace('$HOSTNAME', socket.gethostname()) while node.manager.is_running(): try: node.authentify(login, options['password']) except RpcError as error: logging.critical('Authentication error: %s' % error) sleep(2) result = node.authentify(options['login'], options['password']) if result: logging.info('Authentication suscessfull.') return else: timeout += 0.1 print exp(timeout) sleep(exp(timeout)) logging.info('Authenticated to server') break def shutdown_handler(signum, frame): ''' Loading