Use oslo-config-2013.1b3

The cfg API is now available via the oslo-config library, so switch to
it and remove the copied-and-pasted version.

Add the 2013.1b3 tarball to tools/pip-requires - this will be changed
to 'oslo-config>=2013.1' when oslo-config is published to pypi. This
will happen in time for grizzly final.

Remove the 'deps = pep8==1.3.3' from tox.ini as it means all the other
deps get installed with easy_install which can't install oslo-config
from the URL.

Retain dummy cfg.py file until keystoneclient middleware has been
updated (I18c450174277c8e2d15ed93879da6cd92074c27a).

Change-Id: I4815aeb8a9341a31a250e920157f15ee15cfc5bc
This commit is contained in:
Mark McLoughlin 2013-02-10 18:46:40 -05:00
parent 530737fb17
commit 98552376f3
60 changed files with 87 additions and 1926 deletions

View File

@ -46,9 +46,10 @@ if os.path.exists(os.path.join(possible_topdir, 'glance', '__init__.py')):
gettext.install('glance', unicode=1)
from oslo.config import cfg
from glance.common import config
from glance.image_cache import cleaner
from glance.openstack.common import cfg
CONF = cfg.CONF

View File

@ -37,9 +37,10 @@ if os.path.exists(os.path.join(possible_topdir, 'glance', '__init__.py')):
gettext.install('glance', unicode=1)
from oslo.config import cfg
from glance.common import config
from glance.image_cache import prefetcher
from glance.openstack.common import cfg
import glance.store
CONF = cfg.CONF

View File

@ -38,9 +38,10 @@ if os.path.exists(os.path.join(possible_topdir, 'glance', '__init__.py')):
gettext.install('glance', unicode=1)
from oslo.config import cfg
from glance.common import config
from glance.image_cache import pruner
from glance.openstack.common import cfg
CONF = cfg.CONF

View File

@ -45,8 +45,9 @@ if os.path.exists(os.path.join(possible_topdir, 'glance', '__init__.py')):
gettext.install('glance', unicode=1)
from oslo.config import cfg
from glance.common import config
from glance.openstack.common import cfg
CONF = cfg.CONF

View File

@ -40,9 +40,10 @@ if os.path.exists(os.path.join(possible_topdir, 'glance', '__init__.py')):
gettext.install('glance', unicode=1)
from oslo.config import cfg
from glance.common import config
from glance.common import exception
from glance.openstack.common import cfg
import glance.db.sqlalchemy.api
import glance.db.sqlalchemy.migration

View File

@ -34,8 +34,9 @@ if os.path.exists(os.path.join(possible_topdir, 'glance', '__init__.py')):
gettext.install('glance', unicode=1)
from oslo.config import cfg
from glance.common import config
from glance.openstack.common import cfg
import glance.store
from glance.store import scrubber

View File

@ -15,11 +15,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo.config import cfg
import paste.urlmap
from glance.openstack.common import cfg
CONF = cfg.CONF

View File

@ -17,11 +17,11 @@
import json
from oslo.config import cfg
import webob.exc
from glance.common import wsgi
import glance.context
from glance.openstack.common import cfg
import glance.openstack.common.log as logging

View File

@ -21,9 +21,10 @@ and/or Accept headers and attempts to negotiate an API controller to
return
"""
from oslo.config import cfg
from glance.api import versions
from glance.common import wsgi
from glance.openstack.common import cfg
import glance.openstack.common.log as logging
CONF = cfg.CONF

View File

@ -20,10 +20,11 @@
import json
import os.path
from oslo.config import cfg
from glance.common import exception
from glance.common import utils
import glance.domain
from glance.openstack.common import cfg
import glance.openstack.common.log as logging
from glance.openstack.common import policy

View File

@ -22,6 +22,7 @@
import traceback
import eventlet
from oslo.config import cfg
from webob.exc import (HTTPError,
HTTPNotFound,
HTTPConflict,
@ -41,7 +42,6 @@ from glance.common import exception
from glance.common import utils
from glance.common import wsgi
from glance import notifier
from glance.openstack.common import cfg
import glance.openstack.common.log as logging
from glance import registry
from glance.store import (get_from_backend,
@ -51,7 +51,6 @@ from glance.store import (get_from_backend,
get_store_from_location,
get_store_from_scheme)
CONF = cfg.CONF
LOG = logging.getLogger(__name__)
SUPPORTED_PARAMS = glance.api.v1.SUPPORTED_PARAMS

View File

@ -19,6 +19,7 @@ import json
import re
import urllib
from oslo.config import cfg
import webob.exc
from glance.api import policy
@ -29,13 +30,11 @@ import glance.db
import glance.domain
import glance.gateway
import glance.notifier
from glance.openstack.common import cfg
import glance.openstack.common.log as logging
from glance.openstack.common import timeutils
import glance.schema
import glance.store
LOG = logging.getLogger(__name__)
CONF = cfg.CONF

View File

@ -18,10 +18,10 @@
import httplib
import json
from oslo.config import cfg
import webob.dec
from glance.common import wsgi
from glance.openstack.common import cfg
CONF = cfg.CONF

View File

@ -26,9 +26,9 @@ import logging.handlers
import os
import sys
from oslo.config import cfg
from paste import deploy
from glance.openstack.common import cfg
from glance.version import version_info as version
paste_deploy_opts = [

View File

@ -33,10 +33,10 @@ import platform
import subprocess
import sys
from oslo.config import cfg
from webob import exc
from glance.common import exception
from glance.openstack.common import cfg
import glance.openstack.common.log as logging
CONF = cfg.CONF

View File

@ -34,6 +34,7 @@ import eventlet
from eventlet.green import socket, ssl
import eventlet.greenio
import eventlet.wsgi
from oslo.config import cfg
import routes
import routes.middleware
import webob.dec
@ -41,7 +42,6 @@ import webob.exc
from glance.common import exception
from glance.common import utils
from glance.openstack.common import cfg
import glance.openstack.common.log as os_logging

View File

@ -17,10 +17,11 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo.config import cfg
from glance.api import authorization
from glance.common import exception
import glance.domain
from glance.openstack.common import cfg
from glance.openstack.common import importutils
sql_connection_opt = cfg.StrOpt('sql_connection',

View File

@ -25,6 +25,7 @@ Defines interface for DB access
import logging
import time
from oslo.config import cfg
import sqlalchemy
import sqlalchemy.orm as sa_orm
import sqlalchemy.sql as sa_sql
@ -32,11 +33,9 @@ import sqlalchemy.sql as sa_sql
from glance.common import exception
from glance.db.sqlalchemy import migration
from glance.db.sqlalchemy import models
from glance.openstack.common import cfg
import glance.openstack.common.log as os_logging
from glance.openstack.common import timeutils
_ENGINE = None
_MAKER = None
_MAX_RETRIES = None

View File

@ -32,11 +32,11 @@ Fixes bug #1081043
import types
import urlparse
from oslo.config import cfg
import sqlalchemy
from glance.common import crypt
from glance.common import exception
from glance.openstack.common import cfg
import glance.openstack.common.log as logging
import glance.store.swift

View File

@ -25,9 +25,9 @@ try:
except ImportError:
from migrate import exceptions as versioning_exceptions
from migrate.versioning import repository as versioning_repository
from oslo.config import cfg
from glance.common import exception
from glance.openstack.common import cfg
import glance.openstack.common.log as logging
LOG = logging.getLogger(__name__)

View File

@ -21,9 +21,10 @@ LRU Cache for Image Data
import hashlib
from oslo.config import cfg
from glance.common import exception
from glance.common import utils
from glance.openstack.common import cfg
from glance.openstack.common import importutils
import glance.openstack.common.log as logging

View File

@ -21,9 +21,10 @@ Base attribute driver class
import os.path
from oslo.config import cfg
from glance.common import exception
from glance.common import utils
from glance.openstack.common import cfg
import glance.openstack.common.log as logging
LOG = logging.getLogger(__name__)

View File

@ -26,11 +26,11 @@ import stat
import time
from eventlet import sleep, timeout
from oslo.config import cfg
import sqlite3
from glance.common import exception
from glance.image_cache.drivers import base
from glance.openstack.common import cfg
import glance.openstack.common.log as logging
LOG = logging.getLogger(__name__)

View File

@ -61,16 +61,15 @@ import os
import stat
import time
from oslo.config import cfg
import xattr
from glance.common import exception
from glance.image_cache.drivers import base
from glance.openstack.common import cfg
import glance.openstack.common.log as logging
LOG = logging.getLogger(__name__)
CONF = cfg.CONF

View File

@ -19,9 +19,10 @@
import socket
import uuid
from oslo.config import cfg
from glance.common import exception
import glance.domain
from glance.openstack.common import cfg
from glance.openstack.common import importutils
import glance.openstack.common.log as logging
from glance.openstack.common import timeutils

View File

@ -19,9 +19,9 @@ import time
import kombu.connection
import kombu.entity
from oslo.config import cfg
from glance.notifier import strategy
from glance.openstack.common import cfg
import glance.openstack.common.log as logging
LOG = logging.getLogger(__name__)

View File

@ -16,10 +16,10 @@
import json
from oslo.config import cfg
import qpid.messaging
from glance.notifier import strategy
from glance.openstack.common import cfg
import glance.openstack.common.log as logging
LOG = logging.getLogger(__name__)

File diff suppressed because it is too large Load Diff

View File

@ -1,130 +0,0 @@
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack LLC.
#
# 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.
class ParseError(Exception):
def __init__(self, message, lineno, line):
self.msg = message
self.line = line
self.lineno = lineno
def __str__(self):
return 'at line %d, %s: %r' % (self.lineno, self.msg, self.line)
class BaseParser(object):
lineno = 0
parse_exc = ParseError
def _assignment(self, key, value):
self.assignment(key, value)
return None, []
def _get_section(self, line):
if line[-1] != ']':
return self.error_no_section_end_bracket(line)
if len(line) <= 2:
return self.error_no_section_name(line)
return line[1:-1]
def _split_key_value(self, line):
colon = line.find(':')
equal = line.find('=')
if colon < 0 and equal < 0:
return self.error_invalid_assignment(line)
if colon < 0 or (equal >= 0 and equal < colon):
key, value = line[:equal], line[equal + 1:]
else:
key, value = line[:colon], line[colon + 1:]
value = value.strip()
if ((value and value[0] == value[-1]) and
(value[0] == "\"" or value[0] == "'")):
value = value[1:-1]
return key.strip(), [value]
def parse(self, lineiter):
key = None
value = []
for line in lineiter:
self.lineno += 1
line = line.rstrip()
if not line:
# Blank line, ends multi-line values
if key:
key, value = self._assignment(key, value)
continue
elif line[0] in (' ', '\t'):
# Continuation of previous assignment
if key is None:
self.error_unexpected_continuation(line)
else:
value.append(line.lstrip())
continue
if key:
# Flush previous assignment, if any
key, value = self._assignment(key, value)
if line[0] == '[':
# Section start
section = self._get_section(line)
if section:
self.new_section(section)
elif line[0] in '#;':
self.comment(line[1:].lstrip())
else:
key, value = self._split_key_value(line)
if not key:
return self.error_empty_key(line)
if key:
# Flush previous assignment, if any
self._assignment(key, value)
def assignment(self, key, value):
"""Called when a full assignment is parsed"""
raise NotImplementedError()
def new_section(self, section):
"""Called when a new section is started"""
raise NotImplementedError()
def comment(self, comment):
"""Called when a comment is parsed"""
pass
def error_invalid_assignment(self, line):
raise self.parse_exc("No ':' or '=' found in assignment",
self.lineno, line)
def error_empty_key(self, line):
raise self.parse_exc('Key cannot be empty', self.lineno, line)
def error_unexpected_continuation(self, line):
raise self.parse_exc('Unexpected continuation line',
self.lineno, line)
def error_no_section_end_bracket(self, line):
raise self.parse_exc('Invalid section (must end with ])',
self.lineno, line)
def error_no_section_name(self, line):
raise self.parse_exc('Empty section name', self.lineno, line)

View File

@ -40,7 +40,8 @@ import stat
import sys
import traceback
from glance.openstack.common import cfg
from oslo.config import cfg
from glance.openstack.common.gettextutils import _
from glance.openstack.common import jsonutils
from glance.openstack.common import local

View File

@ -15,7 +15,8 @@
import uuid
from glance.openstack.common import cfg
from oslo.config import cfg
from glance.openstack.common import context
from glance.openstack.common.gettextutils import _
from glance.openstack.common import importutils
@ -23,7 +24,6 @@ from glance.openstack.common import jsonutils
from glance.openstack.common import log as logging
from glance.openstack.common import timeutils
LOG = logging.getLogger(__name__)
notifier_opts = [

View File

@ -13,12 +13,11 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo.config import cfg
from glance.openstack.common import cfg
from glance.openstack.common import jsonutils
from glance.openstack.common import log as logging
CONF = cfg.CONF

View File

@ -13,8 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo.config import cfg
from glance.openstack.common import cfg
from glance.openstack.common import context as req_context
from glance.openstack.common.gettextutils import _
from glance.openstack.common import log as logging

View File

@ -15,7 +15,8 @@
'''messaging based notification driver, with message envelopes'''
from glance.openstack.common import cfg
from oslo.config import cfg
from glance.openstack.common import context as req_context
from glance.openstack.common.gettextutils import _
from glance.openstack.common import log as logging

View File

@ -21,8 +21,9 @@ Registry API
import os
from oslo.config import cfg
from glance.common import exception
from glance.openstack.common import cfg
import glance.openstack.common.log as logging
from glance.registry import client

View File

@ -19,13 +19,13 @@
Reference implementation registry server WSGI controller
"""
from oslo.config import cfg
from webob import exc
from glance.common import exception
from glance.common import utils
from glance.common import wsgi
import glance.db
from glance.openstack.common import cfg
import glance.openstack.common.log as logging
from glance.openstack.common import timeutils
from glance.openstack.common import uuidutils

View File

@ -19,12 +19,13 @@ import os
import sys
import time
from oslo.config import cfg
from glance.common import crypt
from glance.common import exception
from glance.common import utils
import glance.context
import glance.domain
from glance.openstack.common import cfg
from glance.openstack.common import importutils
import glance.openstack.common.log as logging
from glance.store import location

View File

@ -24,9 +24,10 @@ import hashlib
import os
import urlparse
from oslo.config import cfg
from glance.common import exception
from glance.common import utils
from glance.openstack.common import cfg
import glance.openstack.common.log as logging
import glance.store
import glance.store.base

View File

@ -24,8 +24,9 @@ import hashlib
import math
import urllib
from oslo.config import cfg
from glance.common import exception
from glance.openstack.common import cfg
import glance.openstack.common.log as logging
import glance.store
import glance.store.base

View File

@ -23,9 +23,10 @@ import re
import tempfile
import urlparse
from oslo.config import cfg
from glance.common import exception
from glance.common import utils
from glance.openstack.common import cfg
import glance.openstack.common.log as logging
import glance.store
import glance.store.base

View File

@ -20,10 +20,11 @@ import eventlet
import os
import time
from oslo.config import cfg
from glance.common import crypt
from glance.common import utils
from glance import context
from glance.openstack.common import cfg
import glance.openstack.common.log as logging
from glance import registry
from glance import store

View File

@ -25,9 +25,10 @@ import math
import urllib
import urlparse
from oslo.config import cfg
from glance.common import auth
from glance.common import exception
from glance.openstack.common import cfg
import glance.openstack.common.log as logging
import glance.store
import glance.store.base

View File

@ -19,15 +19,14 @@ import StringIO
import testtools
from oslo.config import cfg
from glance.common import exception
from glance.openstack.common import cfg
from glance.openstack.common import uuidutils
import glance.store.location
#NOTE(bcwaldon): importing this to get the default_store option
import glance.api.v1.images
CONF = cfg.CONF

View File

@ -22,9 +22,9 @@ import os
import os.path
import fixtures
import oslo.config.cfg
import testtools
import glance.openstack.common.cfg
import glance.store.filesystem
import glance.tests.functional.store as store_tests
import glance.tests.utils
@ -48,8 +48,7 @@ class TestFilesystemStore(store_tests.BaseTestCase, testtools.TestCase):
fap.write("[DEFAULT]\n")
fap.write("filesystem_store_datadir=%s" % self.store_dir)
glance.openstack.common.cfg.CONF(default_config_files=[config_file],
args=[])
oslo.config.cfg.CONF(default_config_files=[config_file], args=[])
def get_store(self, **kwargs):
store = glance.store.filesystem.Store(context=kwargs.get('context'))

View File

@ -24,7 +24,6 @@ import os.path
import signal
import testtools
import glance.openstack.common.cfg
import glance.store.http
import glance.tests.functional.store as store_tests
import glance.tests.utils

View File

@ -28,13 +28,12 @@ import os.path
import urllib
import urlparse
import oslo.config.cfg
import testtools
import glance.openstack.common.cfg
import glance.store.s3
import glance.tests.functional.store as store_tests
try:
from boto.s3.connection import S3Connection
except ImportError:
@ -86,8 +85,7 @@ class TestS3Store(store_tests.BaseTestCase, testtools.TestCase):
msg = "GLANCE_TEST_S3_CONF environ not set."
self.skipTest(msg)
glance.openstack.common.cfg.CONF(args=[],
default_config_files=[config_path])
oslo.config.cfg.CONF(args=[], default_config_files=[config_path])
raw_config = read_config(config_path)
config = parse_config(raw_config)

View File

@ -30,9 +30,9 @@ import StringIO
import urllib
import urlparse
import oslo.config.cfg
import testtools
import glance.openstack.common.cfg
from glance.openstack.common import uuidutils
import glance.store.swift
import glance.tests.functional.store as store_tests
@ -152,8 +152,7 @@ class TestSwiftStore(store_tests.BaseTestCase, testtools.TestCase):
msg = "GLANCE_TEST_SWIFT_CONF environ not set."
self.skipTest(msg)
glance.openstack.common.cfg.CONF(args=[],
default_config_files=[config_path])
oslo.config.cfg.CONF(args=[], default_config_files=[config_path])
raw_config = read_config(config_path)
config = parse_config(raw_config)

View File

@ -20,9 +20,9 @@ import os
import shutil
import fixtures
from oslo.config import cfg
import stubout
from glance.openstack.common import cfg
from glance import store
from glance.store import location
from glance.tests import stubs

View File

@ -30,6 +30,7 @@ import os
import urlparse
from migrate.versioning.repository import Repository
from oslo.config import cfg
from sqlalchemy import *
from sqlalchemy.pool import NullPool
@ -39,7 +40,6 @@ from glance.common import exception
from glance.db.sqlalchemy import api
import glance.db.sqlalchemy.migration as migration_api
from glance.db.sqlalchemy import models
from glance.openstack.common import cfg
from glance.tests import utils

View File

@ -15,17 +15,16 @@
import os.path
import oslo.config.cfg
import stubout
import glance.api.policy
from glance.common import exception
import glance.context
import glance.openstack.common.cfg
from glance.tests.unit import base
from glance.tests.unit import utils as unit_test_utils
from glance.tests import utils as test_utils
UUID1 = 'c80a1a6c-bd1f-41c5-90ee-81afedb1d58d'
@ -122,7 +121,7 @@ class TestPolicyEnforcerNoFile(base.IsolatedUnitTest):
def fake_find_file(self, name):
return None
self.stubs.Set(glance.openstack.common.cfg.ConfigOpts, 'find_file',
self.stubs.Set(oslo.config.cfg.ConfigOpts, 'find_file',
fake_find_file)
enforcer = glance.api.policy.Enforcer()

View File

@ -23,12 +23,12 @@ import StringIO
import tempfile
import urllib
from oslo.config import cfg
import stubout
import swiftclient
import glance.common.auth
from glance.common import exception
from glance.openstack.common import cfg
from glance.openstack.common import uuidutils
from glance.store import BackendException
from glance.store.location import get_location_from_uri

View File

@ -22,6 +22,7 @@ import httplib
import json
import StringIO
from oslo.config import cfg
import routes
from sqlalchemy import exc
import stubout
@ -34,7 +35,6 @@ import glance.common.config
import glance.context
from glance.db.sqlalchemy import api as db_api
from glance.db.sqlalchemy import models as db_models
from glance.openstack.common import cfg
from glance.openstack.common import timeutils
from glance.openstack.common import uuidutils
from glance.registry.api import v1 as rserver
@ -42,7 +42,6 @@ import glance.store.filesystem
from glance.tests.unit import base
from glance.tests import utils as test_utils
CONF = cfg.CONF
_gen_uuid = uuidutils.generate_uuid

View File

@ -16,10 +16,10 @@
import datetime
import json
from oslo.config import cfg
import webob
import glance.api.v2.image_members
from glance.openstack.common import cfg
from glance.openstack.common import uuidutils
from glance.tests.unit import base
import glance.tests.unit.utils as unit_test_utils

View File

@ -16,11 +16,11 @@
import datetime
import json
from oslo.config import cfg
import testtools
import webob
import glance.api.v2.images
from glance.openstack.common import cfg
from glance.openstack.common import uuidutils
import glance.schema
import glance.store
@ -28,7 +28,6 @@ from glance.tests.unit import base
import glance.tests.unit.utils as unit_test_utils
import glance.tests.utils as test_utils
DATETIME = datetime.datetime(2012, 5, 16, 15, 27, 36, 325355)
ISOTIME = '2012-05-16T15:27:36Z'

View File

@ -25,15 +25,15 @@ import socket
import StringIO
import subprocess
import testtools
from oslo.config import cfg
import stubout
import testtools
from glance.common import config
from glance.common import exception
from glance.common import utils
from glance.common import wsgi
from glance import context
from glance.openstack.common import cfg
CONF = cfg.CONF

View File

@ -1,7 +1,7 @@
[DEFAULT]
# The list of modules to copy from openstack-common
modules=cfg,gettextutils,importutils,iniparser,install_venv_common,jsonutils,local,notifier,policy,setup,timeutils,log,version,uuidutils
modules=gettextutils,importutils,install_venv_common,jsonutils,local,notifier,policy,setup,timeutils,log,version,uuidutils
# The base module to hold the copy of openstack.common
base=glance

View File

@ -32,7 +32,7 @@ if os.path.exists(os.path.join(possible_topdir, "glance",
sys.path.insert(0, possible_topdir)
from glance.openstack.common import cfg
from olso.config import cfg
class InstallVenv(object):

View File

@ -3,14 +3,13 @@
import sys
import keystoneclient.v2_0.client
from oslo.config import cfg
import glance.context
from glance.openstack.common import cfg
import glance.openstack.common.log as logging
import glance.registry.context
import glance.db.sqlalchemy.api as db_api
LOG = logging.getLogger(__name__)
LOG.addHandler(logging.StreamHandler())
LOG.setLevel(logging.DEBUG)

View File

@ -34,3 +34,5 @@ Paste
passlib
jsonschema
python-keystoneclient>=0.2.0
http://tarballs.openstack.org/oslo-config/oslo-config-2013.1b3.tar.gz#egg=oslo-config

View File

@ -17,7 +17,6 @@ commands = nosetests {posargs}
downloadcache = ~/cache/pip
[testenv:pep8]
deps = pep8==1.3.3
commands =
pep8 --ignore=E125,E126,E711,E712 --repeat --show-source --exclude=.venv,.tox,dist,doc,openstack .
pep8 --ignore=E125,E126,E711,E712 --repeat --show-source --filename=glance* bin