Skip to content

Commit

Permalink
Merging trunk, small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rconradharris committed Feb 25, 2011
2 parents 05d135b + c8b630a commit c8345c9
Show file tree
Hide file tree
Showing 122 changed files with 26,331 additions and 3,120 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ include nova/tests/db/nova.austin.sqlite
include plugins/xenapi/README
include plugins/xenapi/etc/xapi.d/plugins/objectstore
include plugins/xenapi/etc/xapi.d/plugins/pluginlib_nova.py
global-exclude *.pyc
2 changes: 0 additions & 2 deletions babel.cfg

This file was deleted.

6 changes: 4 additions & 2 deletions bin/nova-ajax-console-proxy
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ from eventlet.green import urllib2

import exceptions
import gettext
import logging
import os
import sys
import time
Expand All @@ -48,9 +47,11 @@ from nova import utils
from nova import wsgi

FLAGS = flags.FLAGS

flags.DEFINE_integer('ajax_console_idle_timeout', 300,
'Seconds before idle connection destroyed')
flags.DEFINE_flag(flags.HelpFlag())
flags.DEFINE_flag(flags.HelpshortFlag())
flags.DEFINE_flag(flags.HelpXMLFlag())

LOG = logging.getLogger('nova.ajax_console_proxy')
LOG.setLevel(logging.DEBUG)
Expand Down Expand Up @@ -130,6 +131,7 @@ class AjaxConsoleProxy(object):
if __name__ == '__main__':
utils.default_flagfile()
FLAGS(sys.argv)
logging.setup()
server = wsgi.Server()
acp = AjaxConsoleProxy()
acp.register_listeners()
Expand Down
26 changes: 16 additions & 10 deletions bin/nova-api
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,18 @@ from nova import log as logging
from nova import version
from nova import wsgi

logging.basicConfig()
LOG = logging.getLogger('nova.api')
LOG.setLevel(logging.DEBUG)

FLAGS = flags.FLAGS
flags.DEFINE_string('ec2_listen', "0.0.0.0",
'IP address for EC2 API to listen')
flags.DEFINE_integer('ec2_listen_port', 8773, 'port for ec2 api to listen')
flags.DEFINE_string('osapi_listen', "0.0.0.0",
'IP address for OpenStack API to listen')
flags.DEFINE_integer('osapi_listen_port', 8774, 'port for os api to listen')
flags.DEFINE_flag(flags.HelpFlag())
flags.DEFINE_flag(flags.HelpshortFlag())
flags.DEFINE_flag(flags.HelpXMLFlag())

API_ENDPOINTS = ['ec2', 'osapi']

Expand All @@ -57,21 +64,15 @@ def run_app(paste_config_file):
LOG.debug(_("No paste configuration for app: %s"), api)
continue
LOG.debug(_("App Config: %(api)s\n%(config)r") % locals())
wsgi.paste_config_to_flags(config, {
"verbose": FLAGS.verbose,
"%s_host" % api: config.get('host', '0.0.0.0'),
"%s_port" % api: getattr(FLAGS, "%s_port" % api)})
LOG.info(_("Running %s API"), api)
app = wsgi.load_paste_app(paste_config_file, api)
apps.append((app, getattr(FLAGS, "%s_port" % api),
getattr(FLAGS, "%s_host" % api)))
apps.append((app, getattr(FLAGS, "%s_listen_port" % api),
getattr(FLAGS, "%s_listen" % api)))
if len(apps) == 0:
LOG.error(_("No known API applications configured in %s."),
paste_config_file)
return

# NOTE(todd): redo logging config, verbose could be set in paste config
logging.basicConfig()
server = wsgi.Server()
for app in apps:
server.start(*app)
Expand All @@ -80,8 +81,13 @@ def run_app(paste_config_file):

if __name__ == '__main__':
FLAGS(sys.argv)
logging.setup()
LOG.audit(_("Starting nova-api node (version %s)"),
version.version_string_with_vcs())
LOG.debug(_("Full set of FLAGS:"))
for flag in FLAGS:
flag_get = FLAGS.get(flag, None)
LOG.debug("%(flag)s : %(flag_get)s" % locals())
conf = wsgi.paste_config_file('nova-api.conf')
if conf:
run_app(conf)
Expand Down
80 changes: 0 additions & 80 deletions bin/nova-combined

This file was deleted.

4 changes: 4 additions & 0 deletions bin/nova-compute
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,14 @@ if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')):

gettext.install('nova', unicode=1)

from nova import flags
from nova import log as logging
from nova import service
from nova import utils

if __name__ == '__main__':
utils.default_flagfile()
flags.FLAGS(sys.argv)
logging.setup()
service.serve()
service.wait()
4 changes: 4 additions & 0 deletions bin/nova-console
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,14 @@ if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')):

gettext.install('nova', unicode=1)

from nova import flags
from nova import log as logging
from nova import service
from nova import utils

if __name__ == '__main__':
utils.default_flagfile()
flags.FLAGS(sys.argv)
logging.setup()
service.serve()
service.wait()
6 changes: 4 additions & 2 deletions bin/nova-dhcpbridge
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def main():
flagfile = os.environ.get('FLAGFILE', FLAGS.dhcpbridge_flagfile)
utils.default_flagfile(flagfile)
argv = FLAGS(sys.argv)
logging.basicConfig()
logging.setup()
interface = os.environ.get('DNSMASQ_INTERFACE', 'br0')
if int(os.environ.get('TESTING', '0')):
FLAGS.fake_rabbit = True
Expand All @@ -113,7 +113,9 @@ def main():
FLAGS.num_networks = 5
path = os.path.abspath(os.path.join(os.path.dirname(__file__),
'..',
'nova.sqlite'))
'nova',
'tests',
'tests.sqlite'))
FLAGS.sql_connection = 'sqlite:///%s' % path
action = argv[1]
if action in ['add', 'del', 'old']:
Expand Down
6 changes: 6 additions & 0 deletions bin/nova-direct-api
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')):
gettext.install('nova', unicode=1)

from nova import flags
from nova import log as logging
from nova import utils
from nova import wsgi
from nova.api import direct
Expand All @@ -44,10 +45,15 @@ from nova.compute import api as compute_api
FLAGS = flags.FLAGS
flags.DEFINE_integer('direct_port', 8001, 'Direct API port')
flags.DEFINE_string('direct_host', '0.0.0.0', 'Direct API host')
flags.DEFINE_flag(flags.HelpFlag())
flags.DEFINE_flag(flags.HelpshortFlag())
flags.DEFINE_flag(flags.HelpXMLFlag())


if __name__ == '__main__':
utils.default_flagfile()
FLAGS(sys.argv)
logging.setup()

direct.register_service('compute', compute_api.API())
direct.register_service('reflect', direct.Reflection())
Expand Down
2 changes: 2 additions & 0 deletions bin/nova-import-canonical-imagestore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')):
gettext.install('nova', unicode=1)

from nova import flags
from nova import log as logging
from nova import utils
from nova.objectstore import image

Expand Down Expand Up @@ -92,6 +93,7 @@ def main():
"""Main entry point."""
utils.default_flagfile()
argv = FLAGS(sys.argv)
logging.setup()
images = get_images()

if len(argv) == 2:
Expand Down
3 changes: 0 additions & 3 deletions bin/nova-instancemonitor
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ from nova import utils
from nova import twistd
from nova.compute import monitor

# TODO(todd): shouldn't this be done with flags? And what about verbose?
logging.getLogger('boto').setLevel(logging.WARN)

LOG = logging.getLogger('nova.instancemonitor')


Expand Down
6 changes: 4 additions & 2 deletions bin/nova-manage
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,16 @@ from nova.auth import manager
from nova.cloudpipe import pipelib
from nova.db import migration


logging.basicConfig()
FLAGS = flags.FLAGS
flags.DECLARE('fixed_range', 'nova.network.manager')
flags.DECLARE('num_networks', 'nova.network.manager')
flags.DECLARE('network_size', 'nova.network.manager')
flags.DECLARE('vlan_start', 'nova.network.manager')
flags.DECLARE('vpn_start', 'nova.network.manager')
flags.DECLARE('fixed_range_v6', 'nova.network.manager')
flags.DEFINE_flag(flags.HelpFlag())
flags.DEFINE_flag(flags.HelpshortFlag())
flags.DEFINE_flag(flags.HelpXMLFlag())


def param2id(object_id):
Expand Down Expand Up @@ -710,6 +711,7 @@ def main():
"""Parse options and call the appropriate class/method."""
utils.default_flagfile()
argv = FLAGS(sys.argv)
logging.setup()

script_name = argv.pop(0)
if len(argv) < 1:
Expand Down
4 changes: 4 additions & 0 deletions bin/nova-network
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,14 @@ if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')):

gettext.install('nova', unicode=1)

from nova import flags
from nova import log as logging
from nova import service
from nova import utils

if __name__ == '__main__':
utils.default_flagfile()
flags.FLAGS(sys.argv)
logging.setup()
service.serve()
service.wait()
4 changes: 4 additions & 0 deletions bin/nova-scheduler
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,14 @@ if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')):

gettext.install('nova', unicode=1)

from nova import flags
from nova import log as logging
from nova import service
from nova import utils

if __name__ == '__main__':
utils.default_flagfile()
flags.FLAGS(sys.argv)
logging.setup()
service.serve()
service.wait()
4 changes: 4 additions & 0 deletions bin/nova-volume
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,14 @@ if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')):

gettext.install('nova', unicode=1)

from nova import flags
from nova import log as logging
from nova import service
from nova import utils

if __name__ == '__main__':
utils.default_flagfile()
flags.FLAGS(sys.argv)
logging.setup()
service.serve()
service.wait()
12 changes: 7 additions & 5 deletions contrib/nova.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ if [ "$CMD" == "install" ]; then
sudo apt-get install -y user-mode-linux kvm libvirt-bin
sudo apt-get install -y screen euca2ools vlan curl rabbitmq-server
sudo apt-get install -y lvm2 iscsitarget open-iscsi
sudo apt-get install -y socat
sudo apt-get install -y socat unzip
echo "ISCSITARGET_ENABLE=true" | sudo tee /etc/default/iscsitarget
sudo /etc/init.d/iscsitarget restart
sudo modprobe kvm
Expand Down Expand Up @@ -111,8 +111,7 @@ if [ "$CMD" == "run" ]; then
--nodaemon
--dhcpbridge_flagfile=$NOVA_DIR/bin/nova.conf
--network_manager=nova.network.manager.$NET_MAN
--cc_host=$HOST_IP
--routing_source_ip=$HOST_IP
--my_ip=$HOST_IP
--sql_connection=$SQL_CONN
--auth_driver=nova.auth.$AUTH
--libvirt_type=$LIBVIRT_TYPE
Expand Down Expand Up @@ -151,7 +150,6 @@ NOVA_CONF_EOF
mkdir -p $NOVA_DIR/instances
rm -rf $NOVA_DIR/networks
mkdir -p $NOVA_DIR/networks
$NOVA_DIR/tools/clean-vlans
if [ ! -d "$NOVA_DIR/images" ]; then
ln -s $DIR/images $NOVA_DIR/images
fi
Expand All @@ -169,10 +167,14 @@ NOVA_CONF_EOF
# create a project called 'admin' with project manager of 'admin'
$NOVA_DIR/bin/nova-manage project create admin admin
# export environment variables for project 'admin' and user 'admin'
$NOVA_DIR/bin/nova-manage project environment admin admin $NOVA_DIR/novarc
$NOVA_DIR/bin/nova-manage project zipfile admin admin $NOVA_DIR/nova.zip
unzip -o $NOVA_DIR/nova.zip -d $NOVA_DIR/
# create a small network
$NOVA_DIR/bin/nova-manage network create 10.0.0.0/8 1 32

# create some floating ips
$NOVA_DIR/bin/nova-manage floating create `hostname` 10.6.0.0/27

# nova api crashes if we start it with a regular screen command,
# so send the start command by forcing text into the window.
screen_it api "$NOVA_DIR/bin/nova-api"
Expand Down
1 change: 0 additions & 1 deletion contrib/puppet/files/etc/default/nova-compute

This file was deleted.

1 change: 0 additions & 1 deletion contrib/puppet/files/etc/default/nova-volume

This file was deleted.

Loading

0 comments on commit c8345c9

Please sign in to comment.