diff --git a/billingstack/storage/impl_sqlalchemy/migration/alembic_migrations/env.py b/billingstack/storage/impl_sqlalchemy/migration/alembic_migrations/env.py index 31068d9..94c6e72 100644 --- a/billingstack/storage/impl_sqlalchemy/migration/alembic_migrations/env.py +++ b/billingstack/storage/impl_sqlalchemy/migration/alembic_migrations/env.py @@ -74,6 +74,8 @@ def run_migrations_online(): target_metadata=target_metadata ) + print target_metadata + try: with context.begin_transaction(): context.run_migrations(options=build_options()) diff --git a/bin/billingstack-api b/bin/billingstack-api new file mode 100644 index 0000000..40ff83e --- /dev/null +++ b/bin/billingstack-api @@ -0,0 +1,55 @@ +#!/usr/bin/env python +# -*- encoding: utf-8 -*- +# +# Copyright © 2012 New Dream Network, LLC (DreamHost) +# +# Author: Doug Hellmann +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +"""Set up the development API server. +""" +import os +import sys +from wsgiref import simple_server + +from ceilometer.api import app +from ceilometer import service +from ceilometer.openstack.common import cfg +from ceilometer.openstack.common import log as logging + + +if __name__ == '__main__': + # Parse OpenStack config file and command line options, then + # configure logging. + service.prepare_service(sys.argv) + + # Build the WSGI app + root = app.setup_app() + + # Create the WSGI server and start it + host, port = '0.0.0.0', int(cfg.CONF.metering_api_port) + srv = simple_server.make_server(host, port, root) + + print 'Starting server in PID %s' % os.getpid() + + if host == '0.0.0.0': + print 'serving on 0.0.0.0:%s, view at http://127.0.0.1:%s' % \ + (port, port) + else: + print "serving on http://%s:%s" % (host, port) + + try: + srv.serve_forever() + except KeyboardInterrupt: + # allow CTRL+C to shutdown without an error + pass diff --git a/bin/billingstack-db-manage b/bin/billingstack-db-manage new file mode 100644 index 0000000..bdbb5f5 --- /dev/null +++ b/bin/billingstack-db-manage @@ -0,0 +1,26 @@ +#!/usr/bin/env python +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2012 New Dream Network, LLC (DreamHost) +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# Copied: Quantum +import os +import sys +sys.path.insert(0, os.getcwd()) + +from billingstack.storage.impl_sqlalchemy.migration.cli import main + + +main() diff --git a/etc/billingstack/billingstack.conf b/etc/billingstack/billingstack.conf index 7805468..f01f4b6 100644 --- a/etc/billingstack/billingstack.conf +++ b/etc/billingstack/billingstack.conf @@ -31,7 +31,7 @@ debug = True [storage:sqlalchemy] # Database connection string - to configure options for a given implementation # like sqlalchemy or other see below -#database_connection = mysql://billingstack:billingstack@localhost:3306/billingstack +database_connection = mysql+oursql://billingstack:billingstack@mysql:3306/billingstack #connection_debug = 100 #connection_trace = False #sqlite_synchronous = True