Loading bin/cc-node +12 −11 Original line number Diff line number Diff line Loading @@ -19,22 +19,23 @@ try: except ImportError: DAEMONIZE = False __VERSION__ = 4 __VERSION__ = 5 DEFAULT_CONFIG_FILE = '/etc/cc-node.conf' DEFAULT_PID_FILE = '/var/run/cc-node.pid' DEFAULT_CONFIGURATION = { 'address': None, 'login': None, 'password': None, 'port': 1984, 'verbosity': 0, 'address': '', 'login': '', 'password': '', 'port': '1984', 'verbosity': '0', 'detect_hypervisor': 'yes', #'ssl_cert': '', } MAX_AUTH_TIMEOUT = 10 def run_node(options, hypervisor=True): def run_node(options): # Setup logging facility: level = logging.ERROR Loading @@ -61,7 +62,7 @@ def run_node(options, hypervisor=True): try: node = CCNode(options['address'], int(options['port']), hypervisor) options['detect_hypervisor'] == 'yes') except Exception as err: logging.critical('Starting fail: %s' % err) return Loading Loading @@ -113,8 +114,8 @@ if __name__ == '__main__': help='run as daemon and write pid file') op.add_option('-p', '--pid-file', default=DEFAULT_PID_FILE, help='pid file (default: %default)') op.add_option('-s', '--skip-hypervisor', default=False, action="store_true", help='do not connect to hypervisors (default: %default)') #op.add_option('-s', '--skip-hypervisor', default=False, action="store_true", # help='do not connect to hypervisors (default: %default)') cliopts, args = op.parse_args() Loading @@ -139,6 +140,6 @@ if __name__ == '__main__': options[opt] = default while True: run_node(options, hypervisor=not bool(cliopts.skip_hypervisor)) run_node(options) logging.warning('Critical error, restarting node') sleep(2) debian/changelog +14 −0 Original line number Diff line number Diff line cc-node (5-2) unstable; urgency=low * Fix configuration option for HV detection -- Thibault VINCENT <tibal@reloaded.fr> Mon, 27 Dec 2010 14:10:52 +0100 cc-node (5-1) unstable; urgency=low * Support for non-hypervisor nodes * New tags implemented * First migration features -- Thibault VINCENT <tibal@reloaded.fr> Mon, 27 Dec 2010 12:18:42 +0100 cc-node (4-1) unstable; urgency=low * Fixed bugs Loading debian/default +2 −5 Original line number Diff line number Diff line # /etc/default/cc-node # CloudControl node daemon options # Set to true to enable the cc-node daemon: ENABLED=false # Set to true to skip hypervisor detection (for regular hosts) NO_HYPERVISOR=true # Set to true to enable the cc-node daemon ENABLED=true debian/init +3 −7 Original line number Diff line number Diff line Loading @@ -40,14 +40,10 @@ VERBOSE=yes [ -r /etc/default/$NAME ] && { . /etc/default/$NAME # Do not start if service is disabled if [ "$ENABLED" = "false" ] ; then if [ "$ENABLED" != "true" ] ; then echo "$DESC disabled, see /etc/default/$NAME" exit 0 fi # Skip connection to any hypervisor if [ "$NO_HYPERVISOR" = "true" ] ; then DAEMON_OPTS="${DAEMON_OPTS} --skip-hypervisor" fi } # Loading @@ -56,10 +52,10 @@ VERBOSE=yes do_start() { start-stop-daemon --start --quiet --background --name $NAME \ --exec $(readlink -f $(which python)) --test > /dev/null || return 1 --exec $(readlink -f $(which python)) --test > /dev/null || return 2 start-stop-daemon --start --quiet --background --make-pidfile \ --pidfile $PIDFILE --chuid $USER:$GROUP --exec $DAEMON \ -- $DAEMON_OPTS || return 2 -- $DAEMON_OPTS || return 1 } # Loading etc/cc-node.conf +3 −0 Original line number Diff line number Diff line Loading @@ -10,3 +10,6 @@ password = # Verbosity level 0-3: verbosity = # Enable hypervisor detection and connection detect_hypervisor = yes Loading
bin/cc-node +12 −11 Original line number Diff line number Diff line Loading @@ -19,22 +19,23 @@ try: except ImportError: DAEMONIZE = False __VERSION__ = 4 __VERSION__ = 5 DEFAULT_CONFIG_FILE = '/etc/cc-node.conf' DEFAULT_PID_FILE = '/var/run/cc-node.pid' DEFAULT_CONFIGURATION = { 'address': None, 'login': None, 'password': None, 'port': 1984, 'verbosity': 0, 'address': '', 'login': '', 'password': '', 'port': '1984', 'verbosity': '0', 'detect_hypervisor': 'yes', #'ssl_cert': '', } MAX_AUTH_TIMEOUT = 10 def run_node(options, hypervisor=True): def run_node(options): # Setup logging facility: level = logging.ERROR Loading @@ -61,7 +62,7 @@ def run_node(options, hypervisor=True): try: node = CCNode(options['address'], int(options['port']), hypervisor) options['detect_hypervisor'] == 'yes') except Exception as err: logging.critical('Starting fail: %s' % err) return Loading Loading @@ -113,8 +114,8 @@ if __name__ == '__main__': help='run as daemon and write pid file') op.add_option('-p', '--pid-file', default=DEFAULT_PID_FILE, help='pid file (default: %default)') op.add_option('-s', '--skip-hypervisor', default=False, action="store_true", help='do not connect to hypervisors (default: %default)') #op.add_option('-s', '--skip-hypervisor', default=False, action="store_true", # help='do not connect to hypervisors (default: %default)') cliopts, args = op.parse_args() Loading @@ -139,6 +140,6 @@ if __name__ == '__main__': options[opt] = default while True: run_node(options, hypervisor=not bool(cliopts.skip_hypervisor)) run_node(options) logging.warning('Critical error, restarting node') sleep(2)
debian/changelog +14 −0 Original line number Diff line number Diff line cc-node (5-2) unstable; urgency=low * Fix configuration option for HV detection -- Thibault VINCENT <tibal@reloaded.fr> Mon, 27 Dec 2010 14:10:52 +0100 cc-node (5-1) unstable; urgency=low * Support for non-hypervisor nodes * New tags implemented * First migration features -- Thibault VINCENT <tibal@reloaded.fr> Mon, 27 Dec 2010 12:18:42 +0100 cc-node (4-1) unstable; urgency=low * Fixed bugs Loading
debian/default +2 −5 Original line number Diff line number Diff line # /etc/default/cc-node # CloudControl node daemon options # Set to true to enable the cc-node daemon: ENABLED=false # Set to true to skip hypervisor detection (for regular hosts) NO_HYPERVISOR=true # Set to true to enable the cc-node daemon ENABLED=true
debian/init +3 −7 Original line number Diff line number Diff line Loading @@ -40,14 +40,10 @@ VERBOSE=yes [ -r /etc/default/$NAME ] && { . /etc/default/$NAME # Do not start if service is disabled if [ "$ENABLED" = "false" ] ; then if [ "$ENABLED" != "true" ] ; then echo "$DESC disabled, see /etc/default/$NAME" exit 0 fi # Skip connection to any hypervisor if [ "$NO_HYPERVISOR" = "true" ] ; then DAEMON_OPTS="${DAEMON_OPTS} --skip-hypervisor" fi } # Loading @@ -56,10 +52,10 @@ VERBOSE=yes do_start() { start-stop-daemon --start --quiet --background --name $NAME \ --exec $(readlink -f $(which python)) --test > /dev/null || return 1 --exec $(readlink -f $(which python)) --test > /dev/null || return 2 start-stop-daemon --start --quiet --background --make-pidfile \ --pidfile $PIDFILE --chuid $USER:$GROUP --exec $DAEMON \ -- $DAEMON_OPTS || return 2 -- $DAEMON_OPTS || return 1 } # Loading
etc/cc-node.conf +3 −0 Original line number Diff line number Diff line Loading @@ -10,3 +10,6 @@ password = # Verbosity level 0-3: verbosity = # Enable hypervisor detection and connection detect_hypervisor = yes