Browse Source

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.

Add dependency_links to setup.py so that oslo-config can be installed
from the tarball URL specified in pip-requires.

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

Excluded code from oslo-incubator in the pep8 check.

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

Change-Id: I4815aeb8a9341a31a250e920157f15ee15cfc5bc
changes/18/22218/2
Mark McLoughlin 10 years ago
parent
commit
150d2ca694
  1. 3
      bin/heat-api
  2. 3
      bin/heat-api-cfn
  3. 3
      bin/heat-api-cloudwatch
  4. 3
      bin/heat-engine
  5. 2
      heat/common/config.py
  6. 3
      heat/common/context.py
  7. 4
      heat/common/crypt.py
  8. 3
      heat/common/heat_keystoneclient.py
  9. 3
      heat/common/policy.py
  10. 4
      heat/common/wsgi.py
  11. 5
      heat/db/api.py
  12. 3
      heat/engine/clients.py
  13. 2
      heat/engine/resources/__init__.py
  14. 10
      heat/engine/resources/instance.py
  15. 6
      heat/engine/resources/wait_condition.py
  16. 5
      heat/engine/service.py
  17. 1718
      heat/openstack/common/cfg.py
  18. 3
      heat/openstack/common/eventlet_backdoor.py
  19. 130
      heat/openstack/common/iniparser.py
  20. 3
      heat/openstack/common/log.py
  21. 3
      heat/openstack/common/notifier/api.py
  22. 3
      heat/openstack/common/notifier/list_notifier.py
  23. 2
      heat/openstack/common/notifier/log_notifier.py
  24. 2
      heat/openstack/common/notifier/rpc_notifier.py
  25. 3
      heat/openstack/common/notifier/rpc_notifier2.py
  26. 3
      heat/openstack/common/rpc/__init__.py
  27. 3
      heat/openstack/common/rpc/common.py
  28. 2
      heat/openstack/common/rpc/impl_kombu.py
  29. 2
      heat/openstack/common/rpc/impl_qpid.py
  30. 2
      heat/openstack/common/rpc/impl_zmq.py
  31. 3
      heat/openstack/common/rpc/matchmaker.py
  32. 4
      heat/openstack/common/service.py
  33. 3
      heat/rpc/client.py
  34. 6
      heat/tests/test_api_cfn_v1.py
  35. 5
      heat/tests/test_api_cloudwatch.py
  36. 7
      heat/tests/test_api_openstack_v1.py
  37. 10
      heat/tests/test_common_policy.py
  38. 4
      heat/tests/test_engine_service.py
  39. 4
      heat/tests/test_rpc_client.py
  40. 5
      heat/tests/test_user.py
  41. 5
      heat/tests/test_waitcondition.py
  42. 2
      openstack-common.conf
  43. 2
      setup.py
  44. 1
      tools/pip-requires
  45. 3
      tox.ini

3
bin/heat-api

@ -34,10 +34,11 @@ if os.path.exists(os.path.join(possible_topdir, 'heat', '__init__.py')):
gettext.install('heat', unicode=1)
from oslo.config import cfg
from heat.common import config
from heat.common import wsgi
from heat.openstack.common import cfg
from heat.openstack.common import log as logging
LOG = logging.getLogger('heat.api')

3
bin/heat-api-cfn

@ -36,10 +36,11 @@ if os.path.exists(os.path.join(possible_topdir, 'heat', '__init__.py')):
gettext.install('heat', unicode=1)
from oslo.config import cfg
from heat.common import config
from heat.common import wsgi
from heat.openstack.common import cfg
from heat.openstack.common import log as logging
LOG = logging.getLogger('heat.api.cfn')

3
bin/heat-api-cloudwatch

@ -36,10 +36,11 @@ if os.path.exists(os.path.join(possible_topdir, 'heat', '__init__.py')):
gettext.install('heat', unicode=1)
from oslo.config import cfg
from heat.common import config
from heat.common import wsgi
from heat.openstack.common import cfg
from heat.openstack.common import log as logging
LOG = logging.getLogger('heat.api.cloudwatch')

3
bin/heat-engine

@ -38,7 +38,8 @@ if os.path.exists(os.path.join(POSSIBLE_TOPDIR, 'heat', '__init__.py')):
gettext.install('heat', unicode=1)
from heat.openstack.common import cfg
from oslo.config import cfg
from heat.openstack.common import log as logging
from heat.openstack.common import service

2
heat/common/config.py

@ -25,9 +25,9 @@ import os
import sys
from eventlet.green import socket
from oslo.config import cfg
from heat.common import wsgi
from heat.openstack.common import cfg
from heat.openstack.common import rpc
DEFAULT_PORT = 8000

3
heat/common/context.py

@ -13,10 +13,11 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo.config import cfg
from heat.openstack.common import local
from heat.common import exception
from heat.common import wsgi
from heat.openstack.common import cfg
from heat.openstack.common import importutils
from heat.openstack.common import uuidutils
from heat.db import api as db_api

4
heat/common/crypt.py

@ -14,11 +14,11 @@
# under the License.
import base64
from Crypto.Cipher import AES
from Crypto import Random
from heat.openstack.common import cfg
from oslo.config import cfg
from heat.openstack.common import log as logging

3
heat/common/heat_keystoneclient.py

@ -15,7 +15,8 @@
import eventlet
from keystoneclient.v2_0 import client as kc
from heat.openstack.common import cfg
from oslo.config import cfg
from heat.openstack.common import log as logging
logger = logging.getLogger('heat.common.keystoneclient')

3
heat/common/policy.py

@ -21,8 +21,9 @@
import json
import os.path
from oslo.config import cfg
from heat.common import exception
from heat.openstack.common import cfg
import heat.openstack.common.log as logging
from heat.openstack.common import policy

4
heat/common/wsgi.py

@ -28,12 +28,13 @@ import os
import signal
import sys
import time
from lxml import etree
import eventlet
import eventlet.greenio
from eventlet.green import socket, ssl
import eventlet.wsgi
from lxml import etree
from oslo.config import cfg
from paste import deploy
import routes
import routes.middleware
@ -41,7 +42,6 @@ import webob.dec
import webob.exc
from heat.common import exception
from heat.openstack.common import cfg
from heat.openstack.common import importutils

5
heat/db/api.py

@ -25,9 +25,10 @@ Usage:
The underlying driver is loaded . SQLAlchemy is currently the only
supported backend.
'''
from heat.db import utils
from heat.openstack.common import cfg
from oslo.config import cfg
from heat.db import utils
SQL_CONNECTION = 'sqlite://'
SQL_IDLE_TIMEOUT = 3600

3
heat/engine/clients.py

@ -12,9 +12,10 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import eventlet
from oslo.config import cfg
from heat.openstack.common import cfg
from heat.openstack.common import importutils
from heat.openstack.common import log as logging

2
heat/engine/resources/__init__.py

@ -48,7 +48,7 @@ def _initialise():
_register_modules(plugin_loader.load_modules(sys.modules[__name__]))
from heat.openstack.common import cfg
from oslo.config import cfg
plugin_pkg = plugin_loader.create_subpackage(cfg.CONF.plugin_dirs,
'heat.engine')

10
heat/engine/resources/instance.py

@ -13,20 +13,20 @@
# License for the specific language governing permissions and limitations
# under the License.
import eventlet
import os
import json
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import json
import os
import pkgutil
from urlparse import urlparse
import eventlet
from oslo.config import cfg
from heat.engine import clients
from heat.engine import resource
from heat.common import exception
from heat.openstack.common import cfg
from heat.openstack.common import log as logging
logger = logging.getLogger(__name__)

6
heat/engine/resources/wait_condition.py

@ -13,20 +13,20 @@
# License for the specific language governing permissions and limitations
# under the License.
import eventlet
import time
import urllib
import urlparse
import json
import eventlet
from oslo.config import cfg
from heat.common import exception
from heat.common import identifier
from heat.engine import resource
from heat.openstack.common import log as logging
from heat.openstack.common import cfg
# FIXME : we should remove the common.ec2signer fallback implementation
# when the versions of keystoneclient we support all have the Ec2Signer
# utility class

5
heat/engine/service.py

@ -14,9 +14,11 @@
# under the License.
import functools
import webob
import json
from oslo.config import cfg
import webob
from heat.common import context
from heat.db import api as db_api
from heat.engine import api
@ -29,7 +31,6 @@ from heat.engine import resource
from heat.engine import resources
from heat.engine import watchrule
from heat.openstack.common import cfg
from heat.openstack.common import log as logging
from heat.openstack.common import threadgroup
from heat.openstack.common.gettextutils import _

1718
heat/openstack/common/cfg.py

File diff suppressed because it is too large Load Diff

3
heat/openstack/common/eventlet_backdoor.py

@ -24,8 +24,7 @@ import traceback
import eventlet
import eventlet.backdoor
import greenlet
from heat.openstack.common import cfg
from oslo.config import cfg
eventlet_backdoor_opts = [
cfg.IntOpt('backdoor_port',

130
heat/openstack/common/iniparser.py

@ -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)

3
heat/openstack/common/log.py

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

3
heat/openstack/common/notifier/api.py

@ -15,7 +15,8 @@
import uuid
from heat.openstack.common import cfg
from oslo.config import cfg
from heat.openstack.common import context
from heat.openstack.common.gettextutils import _
from heat.openstack.common import importutils

3
heat/openstack/common/notifier/list_notifier.py

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

2
heat/openstack/common/notifier/log_notifier.py

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

2
heat/openstack/common/notifier/rpc_notifier.py

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

3
heat/openstack/common/notifier/rpc_notifier2.py

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

3
heat/openstack/common/rpc/__init__.py

@ -25,7 +25,8 @@ For some wrappers that add message versioning to rpc, see:
rpc.proxy
"""
from heat.openstack.common import cfg
from oslo.config import cfg
from heat.openstack.common import importutils

3
heat/openstack/common/rpc/common.py

@ -21,7 +21,8 @@ import copy
import sys
import traceback
from heat.openstack.common import cfg
from oslo.config import cfg
from heat.openstack.common.gettextutils import _
from heat.openstack.common import importutils
from heat.openstack.common import jsonutils

2
heat/openstack/common/rpc/impl_kombu.py

@ -28,8 +28,8 @@ import kombu
import kombu.connection
import kombu.entity
import kombu.messaging
from oslo.config import cfg
from heat.openstack.common import cfg
from heat.openstack.common.gettextutils import _
from heat.openstack.common import network_utils
from heat.openstack.common.rpc import amqp as rpc_amqp

2
heat/openstack/common/rpc/impl_qpid.py

@ -22,8 +22,8 @@ import uuid
import eventlet
import greenlet
from oslo.config import cfg
from heat.openstack.common import cfg
from heat.openstack.common.gettextutils import _
from heat.openstack.common import importutils
from heat.openstack.common import jsonutils

2
heat/openstack/common/rpc/impl_zmq.py

@ -23,8 +23,8 @@ import uuid
import eventlet
import greenlet
from oslo.config import cfg
from heat.openstack.common import cfg
from heat.openstack.common.gettextutils import _
from heat.openstack.common import importutils
from heat.openstack.common import jsonutils

3
heat/openstack/common/rpc/matchmaker.py

@ -22,7 +22,8 @@ import contextlib
import itertools
import json
from heat.openstack.common import cfg
from oslo.config import cfg
from heat.openstack.common.gettextutils import _
from heat.openstack.common import log as logging

4
heat/openstack/common/service.py

@ -20,6 +20,7 @@
"""Generic Node base class for all workers that run on hosts."""
import errno
import logging as std_logging
import os
import random
import signal
@ -27,9 +28,8 @@ import sys
import time
import eventlet
import logging as std_logging
from oslo.config import cfg
from heat.openstack.common import cfg
from heat.openstack.common import eventlet_backdoor
from heat.openstack.common.gettextutils import _
from heat.openstack.common import importutils

3
heat/rpc/client.py

@ -18,7 +18,8 @@
Client side of the heat engine RPC API.
"""
from heat.openstack.common import cfg
from oslo.config import cfg
from heat.openstack.common import rpc
import heat.openstack.common.rpc.proxy

6
heat/tests/test_api_cfn_v1.py

@ -12,17 +12,17 @@
# License for the specific language governing permissions and limitations
# under the License.
import mox
import json
import os
import unittest
import mox
from nose.plugins.attrib import attr
from oslo.config import cfg
from heat.common import context
from heat.common import identifier
from heat.common import policy
from heat.openstack.common import cfg
from heat.openstack.common import rpc
import heat.openstack.common.rpc.common as rpc_common
from heat.common.wsgi import Request

5
heat/tests/test_api_cloudwatch.py

@ -13,13 +13,14 @@
# under the License.
import os
import mox
import unittest
import mox
from nose.plugins.attrib import attr
from oslo.config import cfg
from heat.common import context
from heat.common import policy
from heat.openstack.common import cfg
from heat.openstack.common import rpc
from heat.common.wsgi import Request
from heat.api.aws import exception

7
heat/tests/test_api_openstack_v1.py

@ -12,17 +12,16 @@
# License for the specific language governing permissions and limitations
# under the License.
import mox
import json
import unittest
from nose.plugins.attrib import attr
import mox
from nose.plugins.attrib import attr
from oslo.config import cfg
import webob.exc
from heat.common import context
from heat.common import identifier
from heat.openstack.common import cfg
from heat.openstack.common import rpc
import heat.openstack.common.rpc.common as rpc_common
from heat.common.wsgi import Request

10
heat/tests/test_common_policy.py

@ -13,18 +13,18 @@
# License for the specific language governing permissions and limitations
# under the License.
import mox
import json
import unittest
from nose.plugins.attrib import attr
import os.path
import mox
from nose.plugins.attrib import attr
from oslo.config import cfg
import unittest
import heat.api
from heat.common import context
from heat.common import policy
from heat.common import exception
from heat.openstack.common import cfg
@attr(tag=['unit', 'common-policy', 'Enforcer'])

4
heat/tests/test_engine_service.py

@ -14,10 +14,11 @@
import os
import unittest
import mox
from nose.plugins.attrib import attr
from oslo.config import cfg
from heat.common import context
from heat.common import exception
@ -31,7 +32,6 @@ from heat.engine import service
from heat.engine.resources import instance as instances
from heat.engine import watchrule
from heat.openstack.common import threadgroup
from heat.openstack.common import cfg
tests_dir = os.path.dirname(os.path.realpath(__file__))

4
heat/tests/test_rpc_client.py

@ -19,14 +19,14 @@ Unit Tests for heat.rpc.client
"""
import stubout
from nose.plugins.attrib import attr
from oslo.config import cfg
import stubout
import unittest
from heat.common import context
from heat.common import identifier
from heat.rpc import client as rpc_client
from heat.openstack.common import cfg
from heat.openstack.common import rpc

5
heat/tests/test_user.py

@ -14,11 +14,11 @@
import os
import mox
import unittest
import mox
from nose.plugins.attrib import attr
from oslo.config import cfg
from heat.common import context
from heat.common import exception
@ -26,7 +26,6 @@ from heat.common import template_format
from heat.engine import parser
from heat.engine.resources import user
from heat.tests import fakes
from heat.openstack.common import cfg
@attr(tag=['unit', 'resource', 'User'])

5
heat/tests/test_waitcondition.py

@ -20,8 +20,10 @@ import datetime
import json
import eventlet
import unittest
from nose.plugins.attrib import attr
from oslo.config import cfg
import unittest
from heat.tests import fakes
from heat.tests.utils import stack_delete_after
@ -31,7 +33,6 @@ from heat.common import identifier
from heat.engine import parser
from heat.engine.resources import wait_condition as wc
from heat.common import context
from heat.openstack.common import cfg
test_template_waitcondition = '''
{

2
openstack-common.conf

@ -1,7 +1,7 @@
[DEFAULT]
# The list of modules to copy from openstack-common
modules=gettextutils,cfg,local,iniparser,utils,exception,timeutils,importutils,setup,log,jsonutils,notifier,rpc,excutils,service,threadgroup,eventlet_backdoor,loopingcall,network_utils,uuidutils,version,policy
modules=gettextutils,local,utils,exception,timeutils,importutils,setup,log,jsonutils,notifier,rpc,excutils,service,threadgroup,eventlet_backdoor,loopingcall,network_utils,uuidutils,version,policy
# The base module to hold the copy of openstack.common
base=heat

2
setup.py

@ -18,6 +18,7 @@ import setuptools
from heat.openstack.common import setup
requires = setup.parse_requirements()
depend_links = setup.parse_dependency_links()
project = 'heat'
@ -34,6 +35,7 @@ setuptools.setup(
packages=setuptools.find_packages(exclude=['bin']),
include_package_data=True,
install_requires=requires,
dependency_links=depend_links,
classifiers=[
'Development Status :: 4 - Beta',
'License :: OSI Approved :: Apache Software License',

1
tools/pip-requires

@ -30,3 +30,4 @@ python-swiftclient
python-quantumclient
python-cinderclient
PyYAML>=3.1.0
http://tarballs.openstack.org/oslo-config/oslo-config-2013.1b3.tar.gz#egg=oslo-config

3
tox.ini

@ -8,8 +8,7 @@ deps = -r{toxinidir}/tools/pip-requires
commands = nosetests -a tag='unit'
[testenv:pep8]
deps = pep8==1.3.4
commands = pep8 --repeat --show-source heat setup.py
commands = pep8 --repeat --show-source --exclude openstack heat setup.py
[testenv:venv]
commands = {posargs}

Loading…
Cancel
Save