diff --git a/bin/cc-node b/bin/cc-node index ef9bc6fa79dd7f39be20a78f23da602477cf93be..141837df74fe9cd54b191cd6891c0e95600a5eca 100755 --- a/bin/cc-node +++ b/bin/cc-node @@ -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 @@ -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 @@ -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() @@ -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) diff --git a/debian/changelog b/debian/changelog index 3a0b6c23b7a6039a1e9b13b5e5ed101cb44e614c..30d4eed9fa94e643723fb7bd2aa39706ecccf26d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,17 @@ +cc-node (5-2) unstable; urgency=low + + * Fix configuration option for HV detection + + -- Thibault VINCENT 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 Mon, 27 Dec 2010 12:18:42 +0100 + cc-node (4-1) unstable; urgency=low * Fixed bugs diff --git a/debian/default b/debian/default index 04a12df0ec76e6ca0f05c21c9670acc45e10eeef..c7caa6fee5585aed377f0feb9f4711bb6b4854ca 100644 --- a/debian/default +++ b/debian/default @@ -1,8 +1,5 @@ # /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 diff --git a/debian/init b/debian/init index fb4494728152f4c250f7ddc9bc1d59b9748c4f57..57e94b1a22cba97eb4f4ad4118e5b4f3dca45413 100644 --- a/debian/init +++ b/debian/init @@ -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 } # @@ -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 } # diff --git a/etc/cc-node.conf b/etc/cc-node.conf index efa41e8d45a28548644800665afee58e3f5fed55..7e6f57a6cccd635eb3db9fb02b2a451ebfa06ef9 100644 --- a/etc/cc-node.conf +++ b/etc/cc-node.conf @@ -10,3 +10,6 @@ password = # Verbosity level 0-3: verbosity = + +# Enable hypervisor detection and connection +detect_hypervisor = yes diff --git a/setup.py b/setup.py index 774c12d435f374ef2c738df6d7d4e06d1366f413..7d6bbc48aeae65e4e4c15e3564ec1b9c5454f2ea 100644 --- a/setup.py +++ b/setup.py @@ -5,11 +5,11 @@ ldesc = open(os.path.join(os.path.dirname(__file__), 'README')).read() setup( name='cc-node', - version='4', + version='5', description='Cloud Control Node', long_description=ldesc, - author='Chakib Benziane', - author_email='chakib.benziane@smartjog.com', + author='Thibault VINCENT', + author_email='thibault.vincent@smartjog.com', license='GPL2', packages=['ccnode'], scripts=['bin/cc-node'],