diff --git a/.coveragerc b/.coveragerc index 17649503..07df79df 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,5 +1,5 @@ [run] -omit = *cdn/openstack* +omit = *poppy/openstack* [report] exclude_lines = diff --git a/HACKING.rst b/HACKING.rst index 0158bfb8..c766e970 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -86,7 +86,7 @@ Template:: \n {{third-party lib imports in human alphabetical order}} \n - {{cdn imports in human alphabetical order}} + {{poppy imports in human alphabetical order}} \n \n {{begin your code}} @@ -102,9 +102,9 @@ Example:: import eventlet - import cdn.common - from cdn import test - import cdn.storage.cassandra + import poppy.common + from poppy import test + import poppy.storage.cassandra More Import Examples @@ -112,11 +112,11 @@ More Import Examples **INCORRECT** :: - import cdn.transport.wsgi as wsgi + import poppy.transport.wsgi as wsgi **CORRECT** :: - from cdn.transport import wsgi + from poppy.transport import wsgi Docstrings ---------- diff --git a/README.rst b/README.rst index 5fb35dc1..053e71f2 100644 --- a/README.rst +++ b/README.rst @@ -1,16 +1,16 @@ -CDN +Poppy ======= -Content Delivery Network Management as a Service +CDN Provider Management as a Service Note: This is a work in progress and is not currently recommended for production use. -What is CDN +What is Poppy ============ Users have come to expect exceptional speed in their applications, websites, and video experiences. Because of this, using a CDN has become standard for companies, no matter their size. -CDN will take all the guess work out of the CDN market for our users. CDN will give them a consistently speedy experience from integrated partners, with an easy to use RESTful API. +Poppy will take all the guess work out of the CDN market for our users. Poppy will give them a consistently speedy experience from integrated partners, with an easy to use RESTful API. Vendor lock-in to a particular CDN provider is removed by abstracting away the plethora of vendor API's available. This means that a customer only has to integrate with one CDN API, and reap the benefits of using multiple providers. @@ -39,10 +39,10 @@ Features + Set Restrictions on who can access cached content -What CDN is not +What Poppy is not ---------------------- -CDN does not run its own Edge Cache or POP servers. This is purely a management API to abstract away the myriad of CDN providers on the market. +Poppy does not run its own Edge Cache or POP servers. This is purely a management API to abstract away the myriad of CDN providers on the market. @@ -53,38 +53,38 @@ Getting Started not all of these steps are required. It is assumed you have `CassandraDB` installed and running. -1. From your home folder create the ``~/.cdn`` folder and clone the repo:: +1. From your home folder create the ``~/.poppy`` folder and clone the repo:: $ cd - $ mkdir .cdn + $ mkdir .poppy $ git clone https://github.com/rackerlabs/cdn.git -2. Copy the CDN config files to the directory ``~/.cdn``:: +2. Copy the Poppy config files to the directory ``~/.poppy``:: - $ cp cdn/etc/cdn.conf ~/.cdn/cdn.conf - $ cp cdn/etc/logging.conf ~/.cdn/logging.conf + $ cp poppy/etc/poppy.conf ~/.poppy/poppy.conf + $ cp poppy/etc/logging.conf ~/.poppy/logging.conf 3. Find the ``[drivers:storage:cassandradb]`` section in - ``~/.cdn/cdn.conf`` and modify the URI to point + ``~/.poppy/poppy.conf`` and modify the URI to point to your local casssandra cluster:: [drivers:storage:cassandra] cluster = "localhost" - keyspace = cdn + keyspace = poppy 4. By using cassandra storage plugin, you will need to create the default - keyspace "cdn" on your cassandra host/cluster. So log into cqlsh, do:: + keyspace "poppy" on your cassandra host/cluster. So log into cqlsh, do:: - cqlsh> CREATE KEYSPACE cdn WITH REPLICATION = { 'class' : 'SimpleStrategy' , 'replication_factor' : 1} ; + cqlsh> CREATE KEYSPACE poppy WITH REPLICATION = { 'class' : 'SimpleStrategy' , 'replication_factor' : 1} ; 5. For logging, find the ``[DEFAULT]`` section in - ``~/.cdn/cdn.conf`` and modify as desired:: + ``~/.poppy/poppy.conf`` and modify as desired:: log_file = server.log 6. Change directories back to your local copy of the repo:: - $ cd cdn + $ cd poppy 7. Install general requirements:: @@ -93,7 +93,7 @@ installed and running. Install Requirements for each Provider configured:: - $ pip install -r cdn/providers/fastly/requirements.txt + $ pip install -r poppy/providers/fastly/requirements.txt Run the following so you can see the results of any changes you make to the code without having to reinstall the package each time:: @@ -101,14 +101,11 @@ installed and running. $ pip install -e . - Installing the fastly client library may have issues. Copy the `README.md` file to `README` and try again. +8. Start the Poppy server:: + $ poppy-server -8. Start the CDN server:: - - $ cdn-server - -9. Test out that CDN is working by requesting the home doc (with a sample project ID):: +9. Test out that Poppy is working by requesting the home doc (with a sample project ID):: $ curl -i -X GET http://0.0.0.0:8888/v1.0/123 @@ -143,11 +140,11 @@ Mac OSX 3. Create a Keyspace with Replication:: - CREATE KEYSPACE cdn WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 }; + CREATE KEYSPACE poppy WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 }; 4. Import the Cassandra Schema to set up the required tables that CDN will need:: - Open ./cqlsh and import the /cdn/storage/cassandra/schema.cql file + Open ./cqlsh and import the /poppy/storage/cassandra/schema.cql file @@ -160,7 +157,7 @@ First install the additional requirements:: And then run tests:: - $ tox -e py27 + $ tox .. _`CassandraDB` : http://cassandra.apache.org diff --git a/doc/source/conf.py b/doc/source/conf.py new file mode 100644 index 00000000..bd1e4f3a --- /dev/null +++ b/doc/source/conf.py @@ -0,0 +1,246 @@ +# -*- coding: utf-8 -*- +# +# poppy documentation build configuration file, created by +# sphinx-quickstart on Wed Aug 6 16:54:51 2014. +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys +import os + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +sys.path.insert(0, os.path.abspath('../../')) +sys.path.insert(0, os.path.abspath('../')) +sys.path.insert(0, os.path.abspath('./')) + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +#needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = ['sphinx.ext.autodoc', + 'sphinx.ext.intersphinx', + 'sphinx.ext.coverage', + 'sphinx.ext.pngmath', + 'sphinx.ext.ifconfig', + 'sphinx.ext.graphviz', + 'oslosphinx', + ] + +# autodoc generation is a bit aggressive and a nuisance +# when doing heavy text edit cycles. Execute "export SPHINX_DEBUG=1" +# in your terminal to disable + +todo_include_todos = True + +# Add any paths that contain templates here, relative to this directory. +templates_path = [] +if os.getenv('HUDSON_PUBLISH_DOCS'): + templates_path = ['_ga', '_templates'] +else: + templates_path = ['_templates'] + +# The suffix of source filenames. +source_suffix = '.rst' + +# The encoding of source files. +#source_encoding = 'utf-8' + +# The master toctree document. +master_doc = 'index' + + +# General information about the project. +project = u'Poppy' +copyright = u'2010-present, OpenStack Foundation' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +from poppy.version import version_info +# The full version, including alpha/beta/rc tags. +release = version_info.release_string() +# The short X.Y version. +version = version_info.version_string() + + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +#language = None + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +#today = '' +# Else, today_fmt is used as the format for a strftime call. +#today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = [] + +# The reST default role (used for this markup: `text`) to use for all +# documents. +#default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +#add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +#add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +#show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# A list of ignored prefixes for module index sorting. +modindex_common_prefix = ['poppy.'] + +# If true, keep warnings as "system message" paragraphs in the built documents. +#keep_warnings = False + + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +#html_theme = 'default' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +#html_theme_options = {} + +# Add any paths that contain custom themes here, relative to this directory. +#html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +#html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +#html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +#html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +#html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = [] + +# Add any extra paths that contain custom files (such as robots.txt or +# .htaccess) here, relative to this directory. These files are copied +# directly to the root of the documentation. +#html_extra_path = [] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +#html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +#html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +#html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +#html_additional_pages = {} + +# If false, no module index is generated. +#html_domain_indices = True + +# If false, no index is generated. +#html_use_index = True + +# If true, the index is split into individual pages for each letter. +#html_split_index = False + +# If true, links to the reST sources are added to the pages. +#html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +#html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +#html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +#html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +#html_file_suffix = None + +# Output file base name for HTML help builder. +htmlhelp_basename = 'poppydoc' + + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { +# The paper size ('letterpaper' or 'a4paper'). +#'papersize': 'letterpaper', + +# The font size ('10pt', '11pt' or '12pt'). +#'pointsize': '10pt', + +# Additional stuff for the LaTeX preamble. +#'preamble': '', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + ('index', 'poppy.tex', u'Poppy Documentation', + u'OpenStack Foundation', 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +#latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +#latex_use_parts = False + +# If true, show page references after internal links. +#latex_show_pagerefs = False + +# If true, show URL addresses after external links. +#latex_show_urls = False + +# Documents to append as an appendix to all manuals. +#latex_appendices = [] + +# If false, no module index is generated. +#latex_domain_indices = True + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = {'python': ('http://docs.python.org/', None)} diff --git a/doc/source/index.rst b/doc/source/index.rst new file mode 100644 index 00000000..2606ecf3 --- /dev/null +++ b/doc/source/index.rst @@ -0,0 +1,65 @@ +.. + 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. + +Welcome to Poppy's documentation! +================================= + +Poppy is an OpenStack related project to provide a generic and modular vendor-neutral API that wraps provisioning instructions for CDN vendors that support it. + +Poppy, as with all OpenStack projects, is written with the following design +guidelines in mind: + +* **Component based architecture**: Quickly add new behaviors +* **Highly available**: Scale to very serious workloads +* **Fault tolerant**: Isolated processes avoid cascading failures +* **Recoverable**: Failures should be easy to diagnose, debug, and rectify +* **Open standards**: Be a reference implementation for a community-driven api + +This documentation is generated by the Sphinx toolkit and lives in the source +tree. Additional draft and project documentation on Poppy and other components of OpenStack can +be found on the `OpenStack wiki`_. Cloud administrators, refer to `docs.openstack.org`_. + +.. _`OpenStack wiki`: http://wiki.openstack.org +.. _`docs.openstack.org`: http://docs.openstack.org + +Concepts +======== + +.. toctree:: + :maxdepth: 1 + + glossary + +Installing/Configuring Poppy +============================ + +.. toctree:: + :maxdepth: 1 + + installing + +Operating Poppy +=============== + +.. toctree:: + :maxdepth: 1 + + ha + +Using Poppy +=========== + +.. toctree:: + :maxdepth: 1 + + api \ No newline at end of file diff --git a/docker/README.md b/docker/README.md index befe29dc..04fdfecc 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1,7 +1,7 @@ Building the Cassandra Docker Image -------------------------------------- -From the docker/cassandra-cdn folder: +From the docker/cassandra folder: $ docker build -t db . @@ -30,5 +30,5 @@ Where local ip is the ip address of your running docker container Import Schema --------------- -Import the schema file from the cdn/storage/cassandra/schema.cql file. +Import the schema file from the poppy/storage/cassandra/schema.cql file. diff --git a/docker/api-cdn/Dockerfile b/docker/api/Dockerfile similarity index 77% rename from docker/api-cdn/Dockerfile rename to docker/api/Dockerfile index 7547d742..c41be806 100644 --- a/docker/api-cdn/Dockerfile +++ b/docker/api/Dockerfile @@ -1,11 +1,11 @@ ## -## CDN API +## Poppy ## ## # The following files should exist in this folder before running Dockerfile # - docker_rsa (private key) -> public key should be published to the private git repo -# - cdn.conf (desired configuration for cdn api) +# - poppy.conf (desired configuration for poppy api) # - logging.conf (desired logging configuration file) @@ -43,28 +43,28 @@ RUN echo "IdentityFile ~/.ssh/id_rsa" >> /etc/ssh/ssh_config RUN touch /root/.ssh/known_hosts # Pull project -RUN git clone git@github.com:rackerlabs/cdn /home/cdn +RUN git clone git@github.com:rackerlabs/cdn /home/poppy # Install Requirements -RUN sudo pip install -r /home/cdn/requirements/requirements.txt +RUN sudo pip install -r /home/poppy/requirements/requirements.txt -RUN sudo pip install -e /home/cdn/. +RUN sudo pip install -e /home/poppy/. # Set up the configuration files -ADD ./cdn.conf /etc/cdn.conf +ADD ./poppy.conf /etc/poppy.conf ADD ./logging.conf /etc/logging.conf ADD ./uwsgi.ini /root/uwsgi.ini # create uwsgi log directory -RUN mkdir -p /var/log/cdn -RUN chmod -R +w /var/log/cdn +RUN mkdir -p /var/log/poppy +RUN chmod -R +w /var/log/poppy # create uwsgi pid directory -RUN mkdir -p /var/run/cdn -RUN chmod -R +w /var/run/cdn +RUN mkdir -p /var/run/poppy +RUN chmod -R +w /var/run/poppy #RUN /usr/local/bin/uwsgi --ini /root/uwsgi.ini -# Start CDN +# Start Poppy EXPOSE 80 CMD ["/usr/local/bin/uwsgi", "--ini", "/root/uwsgi.ini"] diff --git a/docker/api-cdn/logging.conf b/docker/api/logging.conf similarity index 92% rename from docker/api-cdn/logging.conf rename to docker/api/logging.conf index 990cee07..a1bd37ce 100644 --- a/docker/api-cdn/logging.conf +++ b/docker/api/logging.conf @@ -14,12 +14,12 @@ handlers=devel [logger_server] level=DEBUG handlers=devel -qualname=cdn-server +qualname=poppy-server [logger_combined] level=DEBUG handlers=devel -qualname=cdn-combined +qualname=poppy-combined [handler_production] class=handlers.SysLogHandler @@ -31,7 +31,7 @@ args=(('localhost', handlers.SYSLOG_UDP_PORT), handlers.SysLogHandler.LOG_USER) class=FileHandler level=DEBUG formatter=normal_with_name -args=('cdn.log', 'w') +args=('poppy.log', 'w') [handler_devel] class=StreamHandler diff --git a/docker/api-cdn/cdn.conf b/docker/api/poppy.conf similarity index 89% rename from docker/api-cdn/cdn.conf rename to docker/api/poppy.conf index e98fa7a1..e6c4567f 100644 --- a/docker/api-cdn/cdn.conf +++ b/docker/api/poppy.conf @@ -1,6 +1,6 @@ # By default, this should live in one of: -# ~/.cdn/cdn.conf -# /etc/cdn/cdn.conf +# ~/.poppy/poppy.conf +# /etc/poppy/poppy.conf [DEFAULT] # Show more verbose log output (sets INFO log level output) @@ -10,7 +10,7 @@ ;debug = False # Log to this file -log_file = cdn.log +log_file = poppy.log ;auth_strategy = @@ -40,14 +40,14 @@ port = 8888 [drivers:storage:mongodb] uri = mongodb://localhost -database = cdn +database = poppy [drivers:storage:cassandra] cluster = "" -keyspace = cdn +keyspace = poppy [drivers:storage:mockdb] -database = cdn +database = poppy [drivers:provider:fastly] apikey = "" diff --git a/docker/api-cdn/uwsgi.ini b/docker/api/uwsgi.ini similarity index 56% rename from docker/api-cdn/uwsgi.ini rename to docker/api/uwsgi.ini index cc3cf486..5c0d1a23 100644 --- a/docker/api-cdn/uwsgi.ini +++ b/docker/api/uwsgi.ini @@ -1,14 +1,14 @@ [uwsgi] master = true -chdir = /home/cdn/ +chdir = /home/poppy/ workers = 4 http-socket = 0.0.0.0:80 -logger = file:/var/log/cdn/cdn.log -pidfile = /var/run/cdn/cdn.pid +logger = file:/var/log/poppy/poppy.log +pidfile = /var/run/poppy/poppy.pid die-on-term = true enable-threads = true buffer-size = 32768 max-requests = 15000 no-orphans = true vacuum = true -module = cdn.transport.falcon.app:app \ No newline at end of file +module = poppy.transport.falcon.app:app \ No newline at end of file diff --git a/docker/cassandra-cdn/Dockerfile b/docker/cassandra/Dockerfile similarity index 100% rename from docker/cassandra-cdn/Dockerfile rename to docker/cassandra/Dockerfile diff --git a/docker/cassandra-cdn/init.sh b/docker/cassandra/init.sh similarity index 100% rename from docker/cassandra-cdn/init.sh rename to docker/cassandra/init.sh diff --git a/docker/cassandra-cdn/shutdown.sh b/docker/cassandra/shutdown.sh similarity index 100% rename from docker/cassandra-cdn/shutdown.sh rename to docker/cassandra/shutdown.sh diff --git a/etc/logging.conf b/etc/logging.conf index 990cee07..a1bd37ce 100644 --- a/etc/logging.conf +++ b/etc/logging.conf @@ -14,12 +14,12 @@ handlers=devel [logger_server] level=DEBUG handlers=devel -qualname=cdn-server +qualname=poppy-server [logger_combined] level=DEBUG handlers=devel -qualname=cdn-combined +qualname=poppy-combined [handler_production] class=handlers.SysLogHandler @@ -31,7 +31,7 @@ args=(('localhost', handlers.SYSLOG_UDP_PORT), handlers.SysLogHandler.LOG_USER) class=FileHandler level=DEBUG formatter=normal_with_name -args=('cdn.log', 'w') +args=('poppy.log', 'w') [handler_devel] class=StreamHandler diff --git a/etc/cdn.conf b/etc/poppy.conf similarity index 87% rename from etc/cdn.conf rename to etc/poppy.conf index 3b5c5098..298d5113 100644 --- a/etc/cdn.conf +++ b/etc/poppy.conf @@ -1,6 +1,6 @@ # By default, this should live in one of: -# ~/.cdn/cdn.conf -# /etc/cdn/cdn.conf +# ~/.poppy/poppy.conf +# /etc/poppy/poppy.conf [DEFAULT] # Show more verbose log output (sets INFO log level output) @@ -10,7 +10,7 @@ ;debug = False # Log to this file -log_file = cdn.log +log_file = poppy.log ;auth_strategy = @@ -42,14 +42,14 @@ port = 8888 [drivers:storage:mongodb] uri = mongodb://localhost -database = cdn +database = poppy [drivers:storage:cassandra] cluster = "localhost" -keyspace = cdn +keyspace = poppy [drivers:storage:mockdb] -database = cdn +database = poppy [drivers:provider:fastly] apikey = "MYAPIKEY" \ No newline at end of file diff --git a/openstack-common.conf b/openstack-common.conf index aa879d9e..afba5e3b 100644 --- a/openstack-common.conf +++ b/openstack-common.conf @@ -1,5 +1,10 @@ [DEFAULT] -base=cdn -modules=context -modules=local -modules=log \ No newline at end of file +base=poppy +module=context +module=gettextutils +module=importutils +module=jsonutils +module=local +module=log +module=strutils +module=timeutils diff --git a/cdn/__init__.py b/poppy/__init__.py similarity index 100% rename from cdn/__init__.py rename to poppy/__init__.py diff --git a/cdn/bootstrap.py b/poppy/bootstrap.py similarity index 93% rename from cdn/bootstrap.py rename to poppy/bootstrap.py index 22db680f..3701cef6 100644 --- a/cdn/bootstrap.py +++ b/poppy/bootstrap.py @@ -13,11 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cdn.common import decorators -from cdn.openstack.common import log from oslo.config import cfg from stevedore import driver, extension +from poppy.common import decorators +from poppy.openstack.common import log + LOG = log.getLogger(__name__) @@ -47,7 +48,7 @@ class Bootstrap(object): self.conf.register_opts(_DRIVER_OPTIONS, group=_DRIVER_GROUP) self.driver_conf = self.conf[_DRIVER_GROUP] - log.setup('cdn') + log.setup('poppy') LOG.debug("init bootstrap") @@ -56,7 +57,7 @@ class Bootstrap(object): LOG.debug((u'Loading provider extension(s)')) # create the driver manager to load the appropriate drivers - provider_type = 'cdn.provider' + provider_type = 'poppy.provider' args = [self.conf] mgr = extension.ExtensionManager(namespace=provider_type, @@ -69,7 +70,7 @@ class Bootstrap(object): LOG.debug((u'Loading storage driver')) # create the driver manager to load the appropriate drivers - storage_type = 'cdn.storage' + storage_type = 'poppy.storage' storage_name = self.driver_conf.storage args = [self.conf] @@ -88,7 +89,7 @@ class Bootstrap(object): LOG.debug((u'Loading manager driver')) # create the driver manager to load the appropriate drivers - manager_type = 'cdn.manager' + manager_type = 'poppy.manager' manager_name = self.driver_conf.manager args = [self.conf, self.storage, self.provider] @@ -107,7 +108,7 @@ class Bootstrap(object): LOG.debug("loading transport") # create the driver manager to load the appropriate drivers - transport_type = 'cdn.transport' + transport_type = 'poppy.transport' transport_name = self.driver_conf.transport args = [self.conf, self.manager] diff --git a/cdn/cmd/__init__.py b/poppy/cmd/__init__.py similarity index 100% rename from cdn/cmd/__init__.py rename to poppy/cmd/__init__.py diff --git a/cdn/cmd/server.py b/poppy/cmd/server.py similarity index 90% rename from cdn/cmd/server.py rename to poppy/cmd/server.py index 0ad2196b..dbce5177 100644 --- a/cdn/cmd/server.py +++ b/poppy/cmd/server.py @@ -13,10 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cdn import bootstrap -from cdn.common import cli from oslo.config import cfg +from poppy import bootstrap +from poppy.common import cli + @cli.runnable def run(): @@ -24,7 +25,7 @@ def run(): # to pick up common options from openstack.common.log, since # that module uses the global CONF instance exclusively. conf = cfg.CONF - conf(project='cdn', prog='cdn') + conf(project='poppy', prog='poppy') server = bootstrap.Bootstrap(conf) server.run() diff --git a/cdn/common/__init__.py b/poppy/common/__init__.py similarity index 100% rename from cdn/common/__init__.py rename to poppy/common/__init__.py diff --git a/cdn/common/cli.py b/poppy/common/cli.py similarity index 93% rename from cdn/common/cli.py rename to poppy/common/cli.py index d3840f79..e04042e7 100644 --- a/cdn/common/cli.py +++ b/poppy/common/cli.py @@ -20,8 +20,8 @@ import os import sys import termios -from cdn.openstack.common.gettextutils import _ -from cdn.openstack.common import log as logging +from poppy.openstack.common.gettextutils import _ +from poppy.openstack.common import log as logging LOG = logging.getLogger(__name__) @@ -72,7 +72,7 @@ def runnable(func): _enable_echo(False) try: - logging.setup('cdn') + logging.setup('poppy') func() except KeyboardInterrupt: LOG.info(_(u'Terminating')) diff --git a/cdn/common/decorators.py b/poppy/common/decorators.py similarity index 100% rename from cdn/common/decorators.py rename to poppy/common/decorators.py diff --git a/cdn/common/errors.py b/poppy/common/errors.py similarity index 100% rename from cdn/common/errors.py rename to poppy/common/errors.py diff --git a/cdn/manager/__init__.py b/poppy/manager/__init__.py similarity index 100% rename from cdn/manager/__init__.py rename to poppy/manager/__init__.py diff --git a/cdn/manager/base/__init__.py b/poppy/manager/base/__init__.py similarity index 86% rename from cdn/manager/base/__init__.py rename to poppy/manager/base/__init__.py index 951e0d80..a1616638 100644 --- a/cdn/manager/base/__init__.py +++ b/poppy/manager/base/__init__.py @@ -13,9 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cdn.manager.base import driver -from cdn.manager.base import services -from cdn.manager.base import v1 +from poppy.manager.base import driver +from poppy.manager.base import services +from poppy.manager.base import v1 Driver = driver.ManagerDriverBase diff --git a/cdn/manager/base/controller.py b/poppy/manager/base/controller.py similarity index 100% rename from cdn/manager/base/controller.py rename to poppy/manager/base/controller.py diff --git a/cdn/manager/base/driver.py b/poppy/manager/base/driver.py similarity index 100% rename from cdn/manager/base/driver.py rename to poppy/manager/base/driver.py diff --git a/cdn/manager/base/providers.py b/poppy/manager/base/providers.py similarity index 100% rename from cdn/manager/base/providers.py rename to poppy/manager/base/providers.py diff --git a/cdn/manager/base/services.py b/poppy/manager/base/services.py similarity index 94% rename from cdn/manager/base/services.py rename to poppy/manager/base/services.py index 6447019c..5db7a861 100644 --- a/cdn/manager/base/services.py +++ b/poppy/manager/base/services.py @@ -16,8 +16,8 @@ import abc import six -from cdn.manager.base import controller -from cdn.manager.base import providers +from poppy.manager.base import controller +from poppy.manager.base import providers @six.add_metaclass(abc.ABCMeta) diff --git a/cdn/manager/base/v1.py b/poppy/manager/base/v1.py similarity index 95% rename from cdn/manager/base/v1.py rename to poppy/manager/base/v1.py index 410eb490..aba4037e 100644 --- a/cdn/manager/base/v1.py +++ b/poppy/manager/base/v1.py @@ -16,7 +16,7 @@ import abc import six -from cdn.manager.base import controller +from poppy.manager.base import controller @six.add_metaclass(abc.ABCMeta) diff --git a/cdn/manager/default/__init__.py b/poppy/manager/default/__init__.py similarity index 94% rename from cdn/manager/default/__init__.py rename to poppy/manager/default/__init__.py index 4ba278ce..a081614a 100644 --- a/cdn/manager/default/__init__.py +++ b/poppy/manager/default/__init__.py @@ -15,7 +15,7 @@ """Default Manager Driver""" -from cdn.manager.default import driver +from poppy.manager.default import driver # Hoist classes into package namespace diff --git a/cdn/manager/default/controllers.py b/poppy/manager/default/controllers.py similarity index 93% rename from cdn/manager/default/controllers.py rename to poppy/manager/default/controllers.py index 52f68c41..d2b3a57c 100644 --- a/cdn/manager/default/controllers.py +++ b/poppy/manager/default/controllers.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cdn.manager.default import services, v1 +from poppy.manager.default import services, v1 Services = services.DefaultServicesController diff --git a/cdn/manager/default/driver.py b/poppy/manager/default/driver.py similarity index 90% rename from cdn/manager/default/driver.py rename to poppy/manager/default/driver.py index a65089b6..b76f3186 100644 --- a/cdn/manager/default/driver.py +++ b/poppy/manager/default/driver.py @@ -15,9 +15,9 @@ """Default manager driver implementation.""" -from cdn.common import decorators -from cdn.manager import base -from cdn.manager.default import controllers +from poppy.common import decorators +from poppy.manager import base +from poppy.manager.default import controllers class DefaultManagerDriver(base.Driver): diff --git a/cdn/manager/default/services.py b/poppy/manager/default/services.py similarity index 98% rename from cdn/manager/default/services.py rename to poppy/manager/default/services.py index 5df140aa..ddbca778 100644 --- a/cdn/manager/default/services.py +++ b/poppy/manager/default/services.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cdn.manager import base +from poppy.manager import base class DefaultServicesController(base.ServicesController): diff --git a/cdn/manager/default/v1.py b/poppy/manager/default/v1.py similarity index 95% rename from cdn/manager/default/v1.py rename to poppy/manager/default/v1.py index db0e6b3e..05aa288f 100644 --- a/cdn/manager/default/v1.py +++ b/poppy/manager/default/v1.py @@ -13,11 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cdn.manager import base +from poppy.manager import base JSON_HOME = { "resources": { - "rel/cdn": { + "rel/poppy": { "href-template": "services{?marker,limit}", "href-vars": { "marker": "param/marker", diff --git a/cdn/model/__init__.py b/poppy/model/__init__.py similarity index 100% rename from cdn/model/__init__.py rename to poppy/model/__init__.py diff --git a/cdn/model/helpers/__init__.py b/poppy/model/helpers/__init__.py similarity index 100% rename from cdn/model/helpers/__init__.py rename to poppy/model/helpers/__init__.py diff --git a/cdn/model/helpers/cachingrule.py b/poppy/model/helpers/cachingrule.py similarity index 100% rename from cdn/model/helpers/cachingrule.py rename to poppy/model/helpers/cachingrule.py diff --git a/cdn/model/helpers/domain.py b/poppy/model/helpers/domain.py similarity index 100% rename from cdn/model/helpers/domain.py rename to poppy/model/helpers/domain.py diff --git a/cdn/model/helpers/link.py b/poppy/model/helpers/link.py similarity index 100% rename from cdn/model/helpers/link.py rename to poppy/model/helpers/link.py diff --git a/cdn/model/helpers/origin.py b/poppy/model/helpers/origin.py similarity index 100% rename from cdn/model/helpers/origin.py rename to poppy/model/helpers/origin.py diff --git a/cdn/model/helpers/restriction.py b/poppy/model/helpers/restriction.py similarity index 100% rename from cdn/model/helpers/restriction.py rename to poppy/model/helpers/restriction.py diff --git a/cdn/model/helpers/rule.py b/poppy/model/helpers/rule.py similarity index 100% rename from cdn/model/helpers/rule.py rename to poppy/model/helpers/rule.py diff --git a/cdn/model/service.py b/poppy/model/service.py similarity index 100% rename from cdn/model/service.py rename to poppy/model/service.py diff --git a/cdn/openstack/__init__.py b/poppy/openstack/__init__.py similarity index 100% rename from cdn/openstack/__init__.py rename to poppy/openstack/__init__.py diff --git a/cdn/openstack/common/__init__.py b/poppy/openstack/common/__init__.py similarity index 100% rename from cdn/openstack/common/__init__.py rename to poppy/openstack/common/__init__.py diff --git a/cdn/openstack/common/context.py b/poppy/openstack/common/context.py similarity index 100% rename from cdn/openstack/common/context.py rename to poppy/openstack/common/context.py diff --git a/cdn/openstack/common/gettextutils.py b/poppy/openstack/common/gettextutils.py similarity index 99% rename from cdn/openstack/common/gettextutils.py rename to poppy/openstack/common/gettextutils.py index 503c0eff..74ff3e3f 100644 --- a/cdn/openstack/common/gettextutils.py +++ b/poppy/openstack/common/gettextutils.py @@ -19,7 +19,7 @@ gettext for openstack-common modules. Usual usage in an openstack.common module: - from cdn.openstack.common.gettextutils import _ + from poppy.openstack.common.gettextutils import _ """ import copy @@ -121,7 +121,7 @@ class TranslatorFactory(object): # module within each application. # Create the global translation functions. -_translators = TranslatorFactory('cdn') +_translators = TranslatorFactory('poppy') # The primary translation function using the well-known name "_" _ = _translators.primary @@ -182,7 +182,7 @@ class Message(six.text_type): """ def __new__(cls, msgid, msgtext=None, params=None, - domain='cdn', *args): + domain='poppy', *args): """Create a new Message object. In order for translation to work gettext requires a message ID, this diff --git a/cdn/openstack/common/importutils.py b/poppy/openstack/common/importutils.py similarity index 98% rename from cdn/openstack/common/importutils.py rename to poppy/openstack/common/importutils.py index e2254a72..8d409695 100644 --- a/cdn/openstack/common/importutils.py +++ b/poppy/openstack/common/importutils.py @@ -59,7 +59,7 @@ def import_module(import_str): def import_versioned_module(version, submodule=None): - module = 'cdn.v%s' % version + module = 'poppy.v%s' % version if submodule: module = '.'.join((module, submodule)) return import_module(module) diff --git a/cdn/openstack/common/jsonutils.py b/poppy/openstack/common/jsonutils.py similarity index 97% rename from cdn/openstack/common/jsonutils.py rename to poppy/openstack/common/jsonutils.py index 8cb91e8d..daf70d6e 100644 --- a/cdn/openstack/common/jsonutils.py +++ b/poppy/openstack/common/jsonutils.py @@ -51,10 +51,10 @@ else: import six import six.moves.xmlrpc_client as xmlrpclib -from cdn.openstack.common import gettextutils -from cdn.openstack.common import importutils -from cdn.openstack.common import strutils -from cdn.openstack.common import timeutils +from poppy.openstack.common import gettextutils +from poppy.openstack.common import importutils +from poppy.openstack.common import strutils +from poppy.openstack.common import timeutils netaddr = importutils.try_import("netaddr") diff --git a/cdn/openstack/common/local.py b/poppy/openstack/common/local.py similarity index 100% rename from cdn/openstack/common/local.py rename to poppy/openstack/common/local.py diff --git a/cdn/openstack/common/log.py b/poppy/openstack/common/log.py similarity index 97% rename from cdn/openstack/common/log.py rename to poppy/openstack/common/log.py index 68760efc..2e2d7c54 100644 --- a/cdn/openstack/common/log.py +++ b/poppy/openstack/common/log.py @@ -40,13 +40,15 @@ from oslo.config import cfg import six from six import moves -from cdn.openstack.common.gettextutils import _ -from cdn.openstack.common import importutils -from cdn.openstack.common import jsonutils -from cdn.openstack.common import local +_PY26 = sys.version_info[0:2] == (2, 6) + +from poppy.openstack.common.gettextutils import _ +from poppy.openstack.common import importutils +from poppy.openstack.common import jsonutils +from poppy.openstack.common import local # NOTE(flaper87): Pls, remove when graduating this module # from the incubator. -from cdn.openstack.common.strutils import mask_password # noqa +from poppy.openstack.common.strutils import mask_password # noqa _DEFAULT_LOG_DATE_FORMAT = "%Y-%m-%d %H:%M:%S" @@ -227,6 +229,15 @@ class BaseLoggerAdapter(logging.LoggerAdapter): def audit(self, msg, *args, **kwargs): self.log(logging.AUDIT, msg, *args, **kwargs) + def isEnabledFor(self, level): + if _PY26: + # This method was added in python 2.7 (and it does the exact + # same logic, so we need to do the exact same logic so that + # python 2.6 has this capability as well). + return self.logger.isEnabledFor(level) + else: + return super(BaseLoggerAdapter, self).isEnabledFor(level) + class LazyAdapter(BaseLoggerAdapter): def __init__(self, name='unknown', version='unknown'): @@ -502,7 +513,7 @@ def _setup_logging_from_conf(project, version): if CONF.publish_errors: try: handler = importutils.import_object( - "cdn.openstack.common.log_handler.PublishErrorsHandler", + "poppy.openstack.common.log_handler.PublishErrorsHandler", logging.ERROR) except ImportError: handler = importutils.import_object( diff --git a/cdn/openstack/common/strutils.py b/poppy/openstack/common/strutils.py similarity index 99% rename from cdn/openstack/common/strutils.py rename to poppy/openstack/common/strutils.py index c8bc956c..5bc05cdb 100644 --- a/cdn/openstack/common/strutils.py +++ b/poppy/openstack/common/strutils.py @@ -24,7 +24,7 @@ import unicodedata import six -from cdn.openstack.common.gettextutils import _ +from poppy.openstack.common.gettextutils import _ UNIT_PREFIX_EXPONENT = { diff --git a/cdn/openstack/common/timeutils.py b/poppy/openstack/common/timeutils.py similarity index 100% rename from cdn/openstack/common/timeutils.py rename to poppy/openstack/common/timeutils.py diff --git a/cdn/provider/__init__.py b/poppy/provider/__init__.py similarity index 100% rename from cdn/provider/__init__.py rename to poppy/provider/__init__.py diff --git a/cdn/provider/base/__init__.py b/poppy/provider/base/__init__.py similarity index 89% rename from cdn/provider/base/__init__.py rename to poppy/provider/base/__init__.py index a712a73d..a511874d 100644 --- a/cdn/provider/base/__init__.py +++ b/poppy/provider/base/__init__.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cdn.provider.base import driver -from cdn.provider.base import services +from poppy.provider.base import driver +from poppy.provider.base import services Driver = driver.ProviderDriverBase diff --git a/cdn/provider/base/controller.py b/poppy/provider/base/controller.py similarity index 100% rename from cdn/provider/base/controller.py rename to poppy/provider/base/controller.py diff --git a/cdn/provider/base/driver.py b/poppy/provider/base/driver.py similarity index 100% rename from cdn/provider/base/driver.py rename to poppy/provider/base/driver.py diff --git a/cdn/provider/base/responder.py b/poppy/provider/base/responder.py similarity index 100% rename from cdn/provider/base/responder.py rename to poppy/provider/base/responder.py diff --git a/cdn/provider/base/services.py b/poppy/provider/base/services.py similarity index 93% rename from cdn/provider/base/services.py rename to poppy/provider/base/services.py index 482c839e..dab0ba1a 100644 --- a/cdn/provider/base/services.py +++ b/poppy/provider/base/services.py @@ -16,8 +16,8 @@ import abc import six -from cdn.provider.base import controller -from cdn.provider.base import responder +from poppy.provider.base import controller +from poppy.provider.base import responder @six.add_metaclass(abc.ABCMeta) diff --git a/cdn/provider/fastly/__init__.py b/poppy/provider/fastly/__init__.py similarity index 71% rename from cdn/provider/fastly/__init__.py rename to poppy/provider/fastly/__init__.py index 6e29c3b2..a3c869b2 100644 --- a/cdn/provider/fastly/__init__.py +++ b/poppy/provider/fastly/__init__.py @@ -1,6 +1,6 @@ """Fastly CDN Extension for CDN""" -from cdn.provider.fastly import driver +from poppy.provider.fastly import driver # Hoist classes into package namespace Driver = driver.CDNProvider diff --git a/cdn/provider/fastly/controllers.py b/poppy/provider/fastly/controllers.py similarity index 95% rename from cdn/provider/fastly/controllers.py rename to poppy/provider/fastly/controllers.py index 0bc6bf50..8b70e1bc 100644 --- a/cdn/provider/fastly/controllers.py +++ b/poppy/provider/fastly/controllers.py @@ -22,6 +22,6 @@ Field Mappings: updated and documented in each controller class. """ -from cdn.provider.fastly import services +from poppy.provider.fastly import services ServiceController = services.ServiceController diff --git a/cdn/provider/fastly/driver.py b/poppy/provider/fastly/driver.py similarity index 91% rename from cdn/provider/fastly/driver.py rename to poppy/provider/fastly/driver.py index d09aae36..bcc8d4e8 100644 --- a/cdn/provider/fastly/driver.py +++ b/poppy/provider/fastly/driver.py @@ -15,9 +15,9 @@ """Fastly CDN Provider implementation.""" -from cdn.openstack.common import log as logging -from cdn.provider import base -from cdn.provider.fastly import controllers +from poppy.openstack.common import log as logging +from poppy.provider import base +from poppy.provider.fastly import controllers from oslo.config import cfg diff --git a/cdn/provider/fastly/requirements.txt b/poppy/provider/fastly/requirements.txt similarity index 100% rename from cdn/provider/fastly/requirements.txt rename to poppy/provider/fastly/requirements.txt diff --git a/cdn/provider/fastly/services.py b/poppy/provider/fastly/services.py similarity index 98% rename from cdn/provider/fastly/services.py rename to poppy/provider/fastly/services.py index 301e771b..74bf54ee 100644 --- a/cdn/provider/fastly/services.py +++ b/poppy/provider/fastly/services.py @@ -15,7 +15,7 @@ import fastly -from cdn.provider import base +from poppy.provider import base class ServiceController(base.ServiceBase): diff --git a/cdn/provider/mock/__init__.py b/poppy/provider/mock/__init__.py similarity index 71% rename from cdn/provider/mock/__init__.py rename to poppy/provider/mock/__init__.py index 1dbe69a8..87445b45 100644 --- a/cdn/provider/mock/__init__.py +++ b/poppy/provider/mock/__init__.py @@ -1,6 +1,6 @@ """CDN Extension for CDN""" -from cdn.provider.mock import driver +from poppy.provider.mock import driver # Hoist classes into package namespace Driver = driver.CDNProvider diff --git a/cdn/provider/mock/controllers.py b/poppy/provider/mock/controllers.py similarity index 95% rename from cdn/provider/mock/controllers.py rename to poppy/provider/mock/controllers.py index b2d93db7..a89ac437 100644 --- a/cdn/provider/mock/controllers.py +++ b/poppy/provider/mock/controllers.py @@ -22,6 +22,6 @@ Field Mappings: updated and documented in each controller class. """ -from cdn.provider.mock import services +from poppy.provider.mock import services ServiceController = services.ServiceController diff --git a/cdn/provider/mock/driver.py b/poppy/provider/mock/driver.py similarity index 88% rename from cdn/provider/mock/driver.py rename to poppy/provider/mock/driver.py index 646ac260..a2224b28 100644 --- a/cdn/provider/mock/driver.py +++ b/poppy/provider/mock/driver.py @@ -15,9 +15,9 @@ """CDN Provider implementation.""" -from cdn.openstack.common import log as logging -from cdn.provider import base -from cdn.provider.mock import controllers +from poppy.openstack.common import log as logging +from poppy.provider import base +from poppy.provider.mock import controllers LOG = logging.getLogger(__name__) diff --git a/cdn/provider/mock/services.py b/poppy/provider/mock/services.py similarity index 96% rename from cdn/provider/mock/services.py rename to poppy/provider/mock/services.py index 779def01..df070b0c 100644 --- a/cdn/provider/mock/services.py +++ b/poppy/provider/mock/services.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cdn.provider import base +from poppy.provider import base class ServiceController(base.ServiceBase): diff --git a/cdn/storage/__init__.py b/poppy/storage/__init__.py similarity index 100% rename from cdn/storage/__init__.py rename to poppy/storage/__init__.py diff --git a/cdn/storage/base/__init__.py b/poppy/storage/base/__init__.py similarity index 89% rename from cdn/storage/base/__init__.py rename to poppy/storage/base/__init__.py index 92ea120d..554589b7 100644 --- a/cdn/storage/base/__init__.py +++ b/poppy/storage/base/__init__.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cdn.storage.base import driver -from cdn.storage.base import services +from poppy.storage.base import driver +from poppy.storage.base import services Driver = driver.StorageDriverBase diff --git a/cdn/storage/base/controller.py b/poppy/storage/base/controller.py similarity index 100% rename from cdn/storage/base/controller.py rename to poppy/storage/base/controller.py diff --git a/cdn/storage/base/driver.py b/poppy/storage/base/driver.py similarity index 100% rename from cdn/storage/base/driver.py rename to poppy/storage/base/driver.py diff --git a/cdn/storage/base/services.py b/poppy/storage/base/services.py similarity index 96% rename from cdn/storage/base/services.py rename to poppy/storage/base/services.py index c4ca69f8..bcdbf041 100644 --- a/cdn/storage/base/services.py +++ b/poppy/storage/base/services.py @@ -16,7 +16,7 @@ import abc import six -from cdn.storage.base import controller +from poppy.storage.base import controller @six.add_metaclass(abc.ABCMeta) diff --git a/cdn/storage/cassandra/__init__.py b/poppy/storage/cassandra/__init__.py similarity index 73% rename from cdn/storage/cassandra/__init__.py rename to poppy/storage/cassandra/__init__.py index a5631d5c..aa4d9dfb 100644 --- a/cdn/storage/cassandra/__init__.py +++ b/poppy/storage/cassandra/__init__.py @@ -1,6 +1,6 @@ """MongoDB Storage Driver for CDN""" -from cdn.storage.cassandra import driver +from poppy.storage.cassandra import driver # Hoist classes into package namespace Driver = driver.CassandraStorageDriver diff --git a/cdn/storage/cassandra/controllers.py b/poppy/storage/cassandra/controllers.py similarity index 95% rename from cdn/storage/cassandra/controllers.py rename to poppy/storage/cassandra/controllers.py index f74114a8..84211831 100644 --- a/cdn/storage/cassandra/controllers.py +++ b/poppy/storage/cassandra/controllers.py @@ -23,6 +23,6 @@ Field Mappings: updated and documented in each controller class. """ -from cdn.storage.cassandra import services +from poppy.storage.cassandra import services ServicesController = services.ServicesController diff --git a/cdn/storage/cassandra/driver.py b/poppy/storage/cassandra/driver.py similarity index 89% rename from cdn/storage/cassandra/driver.py rename to poppy/storage/cassandra/driver.py index cccac428..fcae6115 100644 --- a/cdn/storage/cassandra/driver.py +++ b/poppy/storage/cassandra/driver.py @@ -17,10 +17,10 @@ from cassandra.cluster import Cluster -from cdn.common import decorators -from cdn.openstack.common import log as logging -from cdn.storage import base -from cdn.storage.cassandra import controllers +from poppy.common import decorators +from poppy.openstack.common import log as logging +from poppy.storage import base +from poppy.storage.cassandra import controllers from oslo.config import cfg @@ -28,7 +28,7 @@ LOG = logging.getLogger(__name__) CASSANDRA_OPTIONS = [ cfg.ListOpt('cluster', help='Cassandra Cluster contact points'), - cfg.StrOpt('keyspace', default='cdn', + cfg.StrOpt('keyspace', default='poppy', help='Keyspace for all queries made in session'), ] diff --git a/cdn/storage/cassandra/schema.cql b/poppy/storage/cassandra/schema.cql similarity index 66% rename from cdn/storage/cassandra/schema.cql rename to poppy/storage/cassandra/schema.cql index faea1622..f7ff2dd4 100644 --- a/cdn/storage/cassandra/schema.cql +++ b/poppy/storage/cassandra/schema.cql @@ -1,5 +1,5 @@ -CREATE KEYSPACE cdn WITH REPLICATION = { 'class' : 'SimpleStrategy' , 'replication_factor' : 1} ; -USE cdn; +CREATE KEYSPACE poppy WITH REPLICATION = { 'class' : 'SimpleStrategy' , 'replication_factor' : 1} ; +USE poppy; CREATE TABLE services ( project_id VARCHAR, diff --git a/cdn/storage/cassandra/services.py b/poppy/storage/cassandra/services.py similarity index 99% rename from cdn/storage/cassandra/services.py rename to poppy/storage/cassandra/services.py index f24e505c..d78a2089 100644 --- a/cdn/storage/cassandra/services.py +++ b/poppy/storage/cassandra/services.py @@ -15,7 +15,7 @@ import json -from cdn.storage import base +from poppy.storage import base CQL_GET_ALL_SERVICES = ''' SELECT project_id, diff --git a/cdn/storage/mockdb/__init__.py b/poppy/storage/mockdb/__init__.py similarity index 72% rename from cdn/storage/mockdb/__init__.py rename to poppy/storage/mockdb/__init__.py index 15dc02e3..0a6ced15 100644 --- a/cdn/storage/mockdb/__init__.py +++ b/poppy/storage/mockdb/__init__.py @@ -1,6 +1,6 @@ """Storage Driver for CDN""" -from cdn.storage.mockdb import driver +from poppy.storage.mockdb import driver # Hoist classes into package namespace Driver = driver.MockDBStorageDriver diff --git a/cdn/storage/mockdb/controllers.py b/poppy/storage/mockdb/controllers.py similarity index 95% rename from cdn/storage/mockdb/controllers.py rename to poppy/storage/mockdb/controllers.py index b5e6b43c..cc489f11 100644 --- a/cdn/storage/mockdb/controllers.py +++ b/poppy/storage/mockdb/controllers.py @@ -23,6 +23,6 @@ Field Mappings: updated and documented in each controller class. """ -from cdn.storage.mockdb import services +from poppy.storage.mockdb import services ServicesController = services.ServicesController diff --git a/cdn/storage/mockdb/driver.py b/poppy/storage/mockdb/driver.py similarity index 88% rename from cdn/storage/mockdb/driver.py rename to poppy/storage/mockdb/driver.py index 04961f43..33c49489 100644 --- a/cdn/storage/mockdb/driver.py +++ b/poppy/storage/mockdb/driver.py @@ -15,17 +15,17 @@ """Storage driver implementation.""" -from cdn.common import decorators -from cdn.openstack.common import log as logging -from cdn.storage import base -from cdn.storage.mockdb import controllers +from poppy.common import decorators +from poppy.openstack.common import log as logging +from poppy.storage import base +from poppy.storage.mockdb import controllers from oslo.config import cfg LOG = logging.getLogger(__name__) MOCKDB_OPTIONS = [ - cfg.StrOpt('database', default='cdn', + cfg.StrOpt('database', default='poppy', help='Database for all queries made in session') ] diff --git a/cdn/storage/mockdb/services.py b/poppy/storage/mockdb/services.py similarity index 99% rename from cdn/storage/mockdb/services.py rename to poppy/storage/mockdb/services.py index d0e09df6..821a7fc6 100644 --- a/cdn/storage/mockdb/services.py +++ b/poppy/storage/mockdb/services.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cdn.storage import base +from poppy.storage import base class ServicesController(base.ServicesController): diff --git a/cdn/storage/mongodb/__init__.py b/poppy/storage/mongodb/__init__.py similarity index 73% rename from cdn/storage/mongodb/__init__.py rename to poppy/storage/mongodb/__init__.py index 0659e126..cc335a9e 100644 --- a/cdn/storage/mongodb/__init__.py +++ b/poppy/storage/mongodb/__init__.py @@ -1,6 +1,6 @@ """MongoDB Storage Driver for CDN""" -from cdn.storage.mongodb import driver +from poppy.storage.mongodb import driver # Hoist classes into package namespace Driver = driver.MongoDBStorageDriver diff --git a/cdn/storage/mongodb/controllers.py b/poppy/storage/mongodb/controllers.py similarity index 95% rename from cdn/storage/mongodb/controllers.py rename to poppy/storage/mongodb/controllers.py index 4b02899e..e63f13f8 100644 --- a/cdn/storage/mongodb/controllers.py +++ b/poppy/storage/mongodb/controllers.py @@ -22,6 +22,6 @@ Field Mappings: updated and documented in each controller class. """ -from cdn.storage.mongodb import services +from poppy.storage.mongodb import services ServicesController = services.ServicesController diff --git a/cdn/storage/mongodb/driver.py b/poppy/storage/mongodb/driver.py similarity index 92% rename from cdn/storage/mongodb/driver.py rename to poppy/storage/mongodb/driver.py index c56d7fce..c58a21b2 100644 --- a/cdn/storage/mongodb/driver.py +++ b/poppy/storage/mongodb/driver.py @@ -18,10 +18,10 @@ import pymongo import pymongo.errors -from cdn.common import decorators -from cdn.openstack.common import log as logging -from cdn.storage import base -from cdn.storage.mongodb import controllers +from poppy.common import decorators +from poppy.openstack.common import log as logging +from poppy.storage import base +from poppy.storage.mongodb import controllers from oslo.config import cfg @@ -33,7 +33,7 @@ MONGODB_OPTIONS = [ # Database name # TODO(kgriffs): Consider local sharding across DBs to mitigate # per-DB locking latency. - cfg.StrOpt('database', default='cdn', help='Database name'), + cfg.StrOpt('database', default='poppy', help='Database name'), cfg.IntOpt('max_attempts', default=1000, help=('Maximum number of times to retry a failed operation.' diff --git a/cdn/storage/mongodb/services.py b/poppy/storage/mongodb/services.py similarity index 97% rename from cdn/storage/mongodb/services.py rename to poppy/storage/mongodb/services.py index a7d62dda..5b7a6b4a 100644 --- a/cdn/storage/mongodb/services.py +++ b/poppy/storage/mongodb/services.py @@ -14,7 +14,7 @@ # limitations under the License. # stevedore/example/simple.py -from cdn.storage import base +from poppy.storage import base class ServicesController(base.ServicesController): diff --git a/cdn/transport/__init__.py b/poppy/transport/__init__.py similarity index 95% rename from cdn/transport/__init__.py rename to poppy/transport/__init__.py index baf9bea1..bec70b9d 100644 --- a/cdn/transport/__init__.py +++ b/poppy/transport/__init__.py @@ -15,7 +15,7 @@ """CDN Transport Drivers""" -from cdn.transport import base +from poppy.transport import base # Hoist into package namespace diff --git a/cdn/transport/app.py b/poppy/transport/app.py similarity index 89% rename from cdn/transport/app.py rename to poppy/transport/app.py index 08a059bc..a019f004 100644 --- a/cdn/transport/app.py +++ b/poppy/transport/app.py @@ -18,7 +18,7 @@ This app should be used by external WSGI containers. For example: - $ gunicorn cdn.transport.app:app + $ gunicorn poppy.transport.app:app NOTE: As for external containers, it is necessary to put config files in the standard paths. There's @@ -28,10 +28,10 @@ to the WSGI app when it is called from other apps. from oslo.config import cfg -from cdn import bootstrap +from poppy import bootstrap conf = cfg.CONF -conf(project='cdn', prog='cdn', args=[]) +conf(project='poppy', prog='poppy', args=[]) app = bootstrap.Bootstrap(conf).transport.app diff --git a/cdn/transport/base.py b/poppy/transport/base.py similarity index 100% rename from cdn/transport/base.py rename to poppy/transport/base.py diff --git a/cdn/transport/falcon/__init__.py b/poppy/transport/falcon/__init__.py similarity index 69% rename from cdn/transport/falcon/__init__.py rename to poppy/transport/falcon/__init__.py index f3716389..efe61e03 100644 --- a/cdn/transport/falcon/__init__.py +++ b/poppy/transport/falcon/__init__.py @@ -1,6 +1,6 @@ """Falcon Transport Driver""" -from cdn.transport.falcon import driver +from poppy.transport.falcon import driver # Hoist into package namespace Driver = driver.TransportDriver diff --git a/cdn/transport/falcon/app.py b/poppy/transport/falcon/app.py similarity index 89% rename from cdn/transport/falcon/app.py rename to poppy/transport/falcon/app.py index 35aaf107..c3e878d5 100644 --- a/cdn/transport/falcon/app.py +++ b/poppy/transport/falcon/app.py @@ -18,7 +18,7 @@ This app should be used by external WSGI containers. For example: - $ gunicorn cdn.transport.falcon.app:app + $ gunicorn poppy.transport.falcon.app:app NOTE: As for external containers, it is necessary to put config files in the standard paths. There's @@ -26,10 +26,11 @@ no common way to specify / pass configuration files to the WSGI app when it is called from other apps. """ -from cdn import bootstrap from oslo.config import cfg +from poppy import bootstrap + conf = cfg.CONF -conf(project='cdn', prog='cdn', args=[]) +conf(project='poppy', prog='poppy', args=[]) app = bootstrap.Bootstrap(conf).transport.app diff --git a/cdn/transport/falcon/driver.py b/poppy/transport/falcon/driver.py similarity index 95% rename from cdn/transport/falcon/driver.py rename to poppy/transport/falcon/driver.py index ff9c6796..62292c59 100644 --- a/cdn/transport/falcon/driver.py +++ b/poppy/transport/falcon/driver.py @@ -20,9 +20,9 @@ import falcon from oslo.config import cfg import six -import cdn.openstack.common.log as logging -from cdn import transport -from cdn.transport.falcon import ( +import poppy.openstack.common.log as logging +from poppy import transport +from poppy.transport.falcon import ( v1, services ) diff --git a/cdn/transport/falcon/services.py b/poppy/transport/falcon/services.py similarity index 100% rename from cdn/transport/falcon/services.py rename to poppy/transport/falcon/services.py diff --git a/cdn/transport/falcon/v1.py b/poppy/transport/falcon/v1.py similarity index 98% rename from cdn/transport/falcon/v1.py rename to poppy/transport/falcon/v1.py index add4e6f6..d2012997 100644 --- a/cdn/transport/falcon/v1.py +++ b/poppy/transport/falcon/v1.py @@ -19,7 +19,7 @@ import json # NOTE(amitgandhinz): http://tools.ietf.org/html/draft-nottingham-json-home-03 JSON_HOME = { "resources": { - "rel/cdn": { + "rel/poppy": { "href-template": "services{?marker,limit}", "href-vars": { "marker": "param/marker", diff --git a/cdn/transport/pecan/__init__.py b/poppy/transport/pecan/__init__.py similarity index 94% rename from cdn/transport/pecan/__init__.py rename to poppy/transport/pecan/__init__.py index 0dab23d1..5ebcad05 100644 --- a/cdn/transport/pecan/__init__.py +++ b/poppy/transport/pecan/__init__.py @@ -15,7 +15,7 @@ """Pecan Transport Driver""" -from cdn.transport.pecan import driver +from poppy.transport.pecan import driver # Hoist into package namespace diff --git a/cdn/transport/pecan/controllers/__init__.py b/poppy/transport/pecan/controllers/__init__.py similarity index 82% rename from cdn/transport/pecan/controllers/__init__.py rename to poppy/transport/pecan/controllers/__init__.py index 0721eb6e..83e3765d 100644 --- a/cdn/transport/pecan/controllers/__init__.py +++ b/poppy/transport/pecan/controllers/__init__.py @@ -15,9 +15,9 @@ """Pecan Controllers""" -from cdn.transport.pecan.controllers import root -from cdn.transport.pecan.controllers import services -from cdn.transport.pecan.controllers import v1 +from poppy.transport.pecan.controllers import root +from poppy.transport.pecan.controllers import services +from poppy.transport.pecan.controllers import v1 # Hoist into package namespace diff --git a/cdn/transport/pecan/controllers/base.py b/poppy/transport/pecan/controllers/base.py similarity index 100% rename from cdn/transport/pecan/controllers/base.py rename to poppy/transport/pecan/controllers/base.py diff --git a/cdn/transport/pecan/controllers/root.py b/poppy/transport/pecan/controllers/root.py similarity index 96% rename from cdn/transport/pecan/controllers/root.py rename to poppy/transport/pecan/controllers/root.py index 17bf285e..08d6c23a 100644 --- a/cdn/transport/pecan/controllers/root.py +++ b/poppy/transport/pecan/controllers/root.py @@ -17,7 +17,7 @@ import re import pecan -from cdn.transport.pecan.controllers import base +from poppy.transport.pecan.controllers import base class RootController(base.Controller): diff --git a/cdn/transport/pecan/controllers/services.py b/poppy/transport/pecan/controllers/services.py similarity index 88% rename from cdn/transport/pecan/controllers/services.py rename to poppy/transport/pecan/controllers/services.py index a4d23091..713a7a79 100644 --- a/cdn/transport/pecan/controllers/services.py +++ b/poppy/transport/pecan/controllers/services.py @@ -17,13 +17,13 @@ import json import pecan -from cdn.openstack.common import local -from cdn.transport.pecan.controllers import base -from cdn.transport.validators import helpers -from cdn.transport.validators.schemas import service -from cdn.transport.validators.stoplight import decorators -from cdn.transport.validators.stoplight import helpers as stoplight_helpers -from cdn.transport.validators.stoplight import rule +from poppy.openstack.common import local +from poppy.transport.pecan.controllers import base +from poppy.transport.validators import helpers +from poppy.transport.validators.schemas import service +from poppy.transport.validators.stoplight import decorators +from poppy.transport.validators.stoplight import helpers as stoplight_helpers +from poppy.transport.validators.stoplight import rule class ServicesController(base.Controller): diff --git a/cdn/transport/pecan/controllers/v1.py b/poppy/transport/pecan/controllers/v1.py similarity index 93% rename from cdn/transport/pecan/controllers/v1.py rename to poppy/transport/pecan/controllers/v1.py index 9c64ceab..39f79e3e 100644 --- a/cdn/transport/pecan/controllers/v1.py +++ b/poppy/transport/pecan/controllers/v1.py @@ -15,7 +15,7 @@ import pecan -from cdn.transport.pecan.controllers import base +from poppy.transport.pecan.controllers import base class ControllerV1(base.Controller): diff --git a/cdn/transport/pecan/driver.py b/poppy/transport/pecan/driver.py similarity index 93% rename from cdn/transport/pecan/driver.py rename to poppy/transport/pecan/driver.py index 3bae1592..4caaed63 100644 --- a/cdn/transport/pecan/driver.py +++ b/poppy/transport/pecan/driver.py @@ -18,10 +18,10 @@ from wsgiref import simple_server from oslo.config import cfg import pecan -from cdn.openstack.common import log -from cdn import transport -from cdn.transport.pecan import controllers -from cdn.transport.pecan import hooks +from poppy.openstack.common import log +from poppy import transport +from poppy.transport.pecan import controllers +from poppy.transport.pecan import hooks _PECAN_OPTIONS = [ diff --git a/cdn/transport/pecan/hooks/__init__.py b/poppy/transport/pecan/hooks/__init__.py similarity index 93% rename from cdn/transport/pecan/hooks/__init__.py rename to poppy/transport/pecan/hooks/__init__.py index f0cb9f89..bba33842 100644 --- a/cdn/transport/pecan/hooks/__init__.py +++ b/poppy/transport/pecan/hooks/__init__.py @@ -15,7 +15,7 @@ """Pecan Hooks""" -from cdn.transport.pecan.hooks import context +from poppy.transport.pecan.hooks import context # Hoist into package namespace diff --git a/cdn/transport/pecan/hooks/context.py b/poppy/transport/pecan/hooks/context.py similarity index 94% rename from cdn/transport/pecan/hooks/context.py rename to poppy/transport/pecan/hooks/context.py index b1cc4de1..0d1e3978 100644 --- a/cdn/transport/pecan/hooks/context.py +++ b/poppy/transport/pecan/hooks/context.py @@ -15,8 +15,8 @@ from pecan import hooks -from cdn.openstack.common import context -from cdn.openstack.common import local +from poppy.openstack.common import context +from poppy.openstack.common import local class ContextHook(hooks.PecanHook): diff --git a/cdn/transport/validators/__init__.py b/poppy/transport/validators/__init__.py similarity index 100% rename from cdn/transport/validators/__init__.py rename to poppy/transport/validators/__init__.py diff --git a/cdn/transport/validators/fake_falcon.py b/poppy/transport/validators/fake_falcon.py similarity index 100% rename from cdn/transport/validators/fake_falcon.py rename to poppy/transport/validators/fake_falcon.py diff --git a/cdn/transport/validators/helpers.py b/poppy/transport/validators/helpers.py similarity index 98% rename from cdn/transport/validators/helpers.py rename to poppy/transport/validators/helpers.py index 80204fd6..bc6bbf91 100644 --- a/cdn/transport/validators/helpers.py +++ b/poppy/transport/validators/helpers.py @@ -24,8 +24,8 @@ except ImportError: import jsonschema import pecan -from cdn.transport.validators.stoplight import decorators -from cdn.transport.validators.stoplight import exceptions +from poppy.transport.validators.stoplight import decorators +from poppy.transport.validators.stoplight import exceptions def req_accepts_json_pecan(request, desired_content_type='application/json'): diff --git a/cdn/transport/validators/schema_base.py b/poppy/transport/validators/schema_base.py similarity index 95% rename from cdn/transport/validators/schema_base.py rename to poppy/transport/validators/schema_base.py index 8346f974..e3fe8f48 100644 --- a/cdn/transport/validators/schema_base.py +++ b/poppy/transport/validators/schema_base.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cdn.common import errors -from cdn.openstack.common.gettextutils import _ +from poppy.common import errors +from poppy.openstack.common.gettextutils import _ class SchemaBase(object): diff --git a/cdn/transport/validators/schemas/__init__.py b/poppy/transport/validators/schemas/__init__.py similarity index 100% rename from cdn/transport/validators/schemas/__init__.py rename to poppy/transport/validators/schemas/__init__.py diff --git a/cdn/transport/validators/schemas/service.py b/poppy/transport/validators/schemas/service.py similarity index 99% rename from cdn/transport/validators/schemas/service.py rename to poppy/transport/validators/schemas/service.py index 0878e242..cc04ebbc 100644 --- a/cdn/transport/validators/schemas/service.py +++ b/poppy/transport/validators/schemas/service.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cdn.transport.validators import schema_base +from poppy.transport.validators import schema_base class ServiceSchema(schema_base.SchemaBase): diff --git a/cdn/transport/validators/stoplight/__init__.py b/poppy/transport/validators/stoplight/__init__.py similarity index 100% rename from cdn/transport/validators/stoplight/__init__.py rename to poppy/transport/validators/stoplight/__init__.py diff --git a/cdn/transport/validators/stoplight/decorators.py b/poppy/transport/validators/stoplight/decorators.py similarity index 100% rename from cdn/transport/validators/stoplight/decorators.py rename to poppy/transport/validators/stoplight/decorators.py diff --git a/cdn/transport/validators/stoplight/exceptions.py b/poppy/transport/validators/stoplight/exceptions.py similarity index 100% rename from cdn/transport/validators/stoplight/exceptions.py rename to poppy/transport/validators/stoplight/exceptions.py diff --git a/cdn/transport/validators/stoplight/helpers.py b/poppy/transport/validators/stoplight/helpers.py similarity index 100% rename from cdn/transport/validators/stoplight/helpers.py rename to poppy/transport/validators/stoplight/helpers.py diff --git a/cdn/transport/validators/stoplight/rule.py b/poppy/transport/validators/stoplight/rule.py similarity index 100% rename from cdn/transport/validators/stoplight/rule.py rename to poppy/transport/validators/stoplight/rule.py diff --git a/poppy/version.py b/poppy/version.py new file mode 100644 index 00000000..c8a6cd11 --- /dev/null +++ b/poppy/version.py @@ -0,0 +1,20 @@ +# Copyright (c) 2014 OpenStack Foundation +# +# 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. + +import pbr.packaging +import pbr.version + + +version_info = pbr.version.VersionInfo('poppy') diff --git a/setup.cfg b/setup.cfg index 08203825..35058da2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,7 +1,7 @@ [metadata] -name = cdn +name = poppy version = 2014.2 -summary = CDN Service +summary = A modular, vendor-neutral API, that wraps provisioning instructions for all CDN vendors that support it. description-file = README.rst author = OpenStack @@ -20,27 +20,32 @@ classifier = [files] packages = - cdn + poppy + +[build_sphinx] +all_files = 1 +build-dir = doc/build +source-dir = doc/source [entry_points] console_scripts = - cdn-server = cdn.cmd.server:run + poppy-server = poppy.cmd.server:run -cdn.transport = - falcon = cdn.transport.falcon:Driver - pecan = cdn.transport.pecan:Driver +poppy.transport = + falcon = poppy.transport.falcon:Driver + pecan = poppy.transport.pecan:Driver -cdn.manager = - default = cdn.manager.default:Driver +poppy.manager = + default = poppy.manager.default:Driver -cdn.storage = - mongodb = cdn.storage.mongodb:Driver - cassandra = cdn.storage.cassandra:Driver - mockdb = cdn.storage.mockdb:Driver +poppy.storage = + mongodb = poppy.storage.mongodb:Driver + cassandra = poppy.storage.cassandra:Driver + mockdb = poppy.storage.mockdb:Driver -cdn.provider = - fastly = cdn.provider.fastly:Driver - mock = cdn.provider.mock:Driver +poppy.provider = + fastly = poppy.provider.fastly:Driver + mock = poppy.provider.mock:Driver [wheel] universal = 1 @@ -51,7 +56,7 @@ verbosity=2 with-doctest = true -cover-package = cdn +cover-package = poppy cover-html = true cover-erase = true cover-inclusive = true diff --git a/tests/api/README.rst b/tests/api/README.rst index 8ed5d16f..2ed9bb52 100644 --- a/tests/api/README.rst +++ b/tests/api/README.rst @@ -4,7 +4,7 @@ API Tests The API tests + test an actual API against a running environment. + are black box tests -+ can be used to test any running instance of cdn server (dev, test, prod, local ++ can be used to test any running instance of poppy server (dev, test, prod, local instance, containerized instance) @@ -17,13 +17,13 @@ To run the tests 2. Set the following environment variables:: - export CAFE_CONFIG_FILE_PATH=~/.cdn/tests.conf - export CAFE_ROOT_LOG_PATH=~/.cdn/logs - export CAFE_TEST_LOG_PATH=~/.cdn/logs + export CAFE_CONFIG_FILE_PATH=~/.poppy/tests.conf + export CAFE_ROOT_LOG_PATH=~/.poppy/logs + export CAFE_TEST_LOG_PATH=~/.poppy/logs 3. Copy the api.conf file to the path set by CAFE_CONFIG_FILE_PATH:: - cp tests/etc/api.conf ~/.cdn/tests.conf + cp tests/etc/api.conf ~/.poppy/tests.conf 4. Once you are ready to run the tests:: diff --git a/tests/api/base.py b/tests/api/base.py index beb14858..a4520387 100644 --- a/tests/api/base.py +++ b/tests/api/base.py @@ -36,7 +36,7 @@ class TestBase(fixtures.BaseTestFixture): @classmethod def setUpClass(cls): - cls.conf_file = 'cdn_mockdb.conf' + cls.conf_file = 'poppy_mockdb.conf' super(TestBase, cls).setUpClass() @@ -56,14 +56,14 @@ class TestBase(fixtures.BaseTestFixture): cls.server_config = config.CDNServerConfig() if cls.server_config.run_server: - conf_path = os.environ["CDN_TESTS_CONFIGS_DIR"] + conf_path = os.environ["POPPY_TESTS_CONFIGS_DIR"] config_file = os.path.join(conf_path, cls.conf_file) conf = cfg.ConfigOpts() - conf(project='cdn', prog='cdn', args=[], + conf(project='poppy', prog='poppy', args=[], default_config_files=[config_file]) - cdn_server = server.CDNServer() - cdn_server.start(conf) + poppy_server = server.CDNServer() + poppy_server.start(conf) def assertSchema(self, response_json, expected_schema): """Verify response schema aligns with the expected schema.""" diff --git a/tests/api/utils/config.py b/tests/api/utils/config.py index e98314d5..9a549fe3 100644 --- a/tests/api/utils/config.py +++ b/tests/api/utils/config.py @@ -16,23 +16,23 @@ from cafe.engine.models import data_interfaces -class CDNConfig(data_interfaces.ConfigSectionInterface): - """Defines the config values for cdn.""" - SECTION_NAME = 'cdn' +class PoppyConfig(data_interfaces.ConfigSectionInterface): + """Defines the config values for poppy.""" + SECTION_NAME = 'poppy' @property def base_url(self): - """CDN endpoint.""" + """poppy endpoint.""" return self.get('base_url') -class CDNServerConfig(data_interfaces.ConfigSectionInterface): - """Defines the config values for starting (or not) a cdn server""" - SECTION_NAME = 'cdn_server' +class PoppyServerConfig(data_interfaces.ConfigSectionInterface): + """Defines the config values for starting (or not) a Poppy server""" + SECTION_NAME = 'poppy_server' @property def run_server(self): - """Boolean value indicating whether to start CDN server.""" + """Boolean value indicating whether to start a Poppy server.""" return self.get_boolean('run_server') diff --git a/tests/api/utils/server.py b/tests/api/utils/server.py index e8d36640..bf83380c 100644 --- a/tests/api/utils/server.py +++ b/tests/api/utils/server.py @@ -17,13 +17,13 @@ import abc import multiprocessing import six -from cdn import bootstrap +from poppy import bootstrap @six.add_metaclass(abc.ABCMeta) class Server(object): - name = "cdn-server" + name = "poppy-server" def __init__(self): self.process = None @@ -88,7 +88,7 @@ class Server(object): class CDNServer(Server): - name = "cdn-server" + name = "poppy-server" def get_target(self, conf): server = bootstrap.Bootstrap(conf) diff --git a/tests/base.py b/tests/base.py index 2326618d..656500aa 100644 --- a/tests/base.py +++ b/tests/base.py @@ -33,7 +33,7 @@ class TestCase(testtools.TestCase): def setUp(self): super(TestCase, self).setUp() - self.useFixture(fixtures.FakeLogger('cdn')) + self.useFixture(fixtures.FakeLogger('poppy')) if self.config_file: self.conf = self.load_conf(self.config_file) diff --git a/tests/etc/api.conf b/tests/etc/api.conf index d99a8875..f5e97132 100644 --- a/tests/etc/api.conf +++ b/tests/etc/api.conf @@ -7,8 +7,8 @@ username={user name of the cloud account} api_key={api key for this user name} base_url=https://identity.api.rackspacecloud.com/v2.0 -[cdn] +[poppy] base_url=https//0.0.0.0:8888 -[cdn_server] +[poppy_server] run_server=True diff --git a/tests/etc/cdn_mockdb.conf b/tests/etc/cdn_mockdb.conf index 1c3de368..08b11d53 100644 --- a/tests/etc/cdn_mockdb.conf +++ b/tests/etc/cdn_mockdb.conf @@ -1,6 +1,6 @@ # By default, this should live in one of: -# ~/.cdn/cdn.conf -# /etc/cdn/cdn.conf +# ~/.poppy/poppy.conf +# /etc/poppy/poppy.conf [DEFAULT] # Show more verbose log output (sets INFO log level output) @@ -10,7 +10,7 @@ ;debug = False # Log to this file -log_file = cdn.log +log_file = poppy.log ;auth_strategy = @@ -42,14 +42,14 @@ port = 8888 [drivers:storage:mongodb] uri = mongodb://localhost -database = cdn +database = poppy [drivers:storage:cassandra] cluster = "localhost" -keyspace = cdn +keyspace = poppy [drivers:storage:mockdb] -database = cdn +database = poppy [drivers:provider:fastly] apikey = "MYAPIKEY" \ No newline at end of file diff --git a/tests/etc/functional.conf b/tests/etc/functional.conf index d985db28..95b8c217 100644 --- a/tests/etc/functional.conf +++ b/tests/etc/functional.conf @@ -1,6 +1,6 @@ # By default, this should live in one of: -# ~/.cdn/cdn.conf -# /etc/cdn/cdn.conf +# ~/.poppy/poppy.conf +# /etc/poppy/poppy.conf [DEFAULT] # Show more verbose log output (sets INFO log level output) @@ -10,7 +10,7 @@ ;debug = False # Log to this file -log_file = cdn.log +log_file = poppy.log # ================= Syslog Options ============================ @@ -40,14 +40,14 @@ port = 8888 [drivers:storage:mongodb] uri = mongodb://localhost -database = cdn +database = poppy [drivers:storage:cassandra] cluster = "localhost" -keyspace = cdn +keyspace = poppy [drivers:storage:mockdb] -database = cdn +database = poppy [drivers:provider:fastly] apikey = "MYAPIKEY" \ No newline at end of file diff --git a/tests/functional/transport/pecan/base.py b/tests/functional/transport/pecan/base.py index 9ca0ef85..c44d64d9 100644 --- a/tests/functional/transport/pecan/base.py +++ b/tests/functional/transport/pecan/base.py @@ -18,7 +18,7 @@ import os from oslo.config import cfg import webtest -from cdn import bootstrap +from poppy import bootstrap from tests.functional import base @@ -33,9 +33,9 @@ class BaseFunctionalTest(base.TestCase): )))) conf_path = os.path.join(tests_path, 'etc', 'default_functional.conf') cfg.CONF(args=[], default_config_files=[conf_path]) - cdn_wsgi = bootstrap.Bootstrap(cfg.CONF).transport.app + poppy_wsgi = bootstrap.Bootstrap(cfg.CONF).transport.app - self.app = webtest.TestApp(cdn_wsgi) + self.app = webtest.TestApp(poppy_wsgi) FunctionalTest = BaseFunctionalTest diff --git a/tests/functional/transport/pecan/controllers/test_services.py b/tests/functional/transport/pecan/controllers/test_services.py index 454d2689..f9ea1043 100644 --- a/tests/functional/transport/pecan/controllers/test_services.py +++ b/tests/functional/transport/pecan/controllers/test_services.py @@ -18,7 +18,7 @@ import json import pecan from webtest import app -from cdn.transport.pecan.controllers import base as c_base +from poppy.transport.pecan.controllers import base as c_base from tests.functional.transport.pecan import base diff --git a/tests/functional/transport/pecan/controllers/test_v1_controller.py b/tests/functional/transport/pecan/controllers/test_v1_controller.py index b845b6d5..1f154541 100644 --- a/tests/functional/transport/pecan/controllers/test_v1_controller.py +++ b/tests/functional/transport/pecan/controllers/test_v1_controller.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cdn.manager.default import v1 +from poppy.manager.default import v1 from tests.functional.transport.pecan import base diff --git a/tests/functional/transport/pecan/hooks/test_context.py b/tests/functional/transport/pecan/hooks/test_context.py index 8e26dfa5..82639a8a 100644 --- a/tests/functional/transport/pecan/hooks/test_context.py +++ b/tests/functional/transport/pecan/hooks/test_context.py @@ -15,7 +15,7 @@ import uuid -from cdn.manager.default import v1 +from poppy.manager.default import v1 from tests.functional.transport.pecan import base diff --git a/tests/functional/transport/validator/test_service_validation.py b/tests/functional/transport/validator/test_service_validation.py index b8450e3a..10c23bfe 100644 --- a/tests/functional/transport/validator/test_service_validation.py +++ b/tests/functional/transport/validator/test_service_validation.py @@ -22,13 +22,13 @@ import sys import pecan from webtest import app -from cdn.common import errors -from cdn.transport.validators import helpers -from cdn.transport.validators.schemas import service -from cdn.transport.validators.stoplight import decorators -from cdn.transport.validators.stoplight import exceptions -from cdn.transport.validators.stoplight import helpers as stoplight_helpers -from cdn.transport.validators.stoplight import rule +from poppy.common import errors +from poppy.transport.validators import helpers +from poppy.transport.validators.schemas import service +from poppy.transport.validators.stoplight import decorators +from poppy.transport.validators.stoplight import exceptions +from poppy.transport.validators.stoplight import helpers as stoplight_helpers +from poppy.transport.validators.stoplight import rule from tests.functional import base # for pecan testing app diff --git a/tests/functional/transport/validator/test_stoplight_validation.py b/tests/functional/transport/validator/test_stoplight_validation.py index 9e8b3424..e18da1df 100644 --- a/tests/functional/transport/validator/test_stoplight_validation.py +++ b/tests/functional/transport/validator/test_stoplight_validation.py @@ -13,9 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cdn.transport.validators.stoplight import decorators -from cdn.transport.validators.stoplight import exceptions -from cdn.transport.validators.stoplight import rule +from poppy.transport.validators.stoplight import decorators +from poppy.transport.validators.stoplight import exceptions +from poppy.transport.validators.stoplight import rule from test_service_validation import BaseTestCase # TODO(tonytan4ever): We probably want to move this to a diff --git a/tests/unit/common/test_decorators.py b/tests/unit/common/test_decorators.py index 1526c144..d1ca04c8 100644 --- a/tests/unit/common/test_decorators.py +++ b/tests/unit/common/test_decorators.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cdn.common import decorators +from poppy.common import decorators from tests.unit import base diff --git a/tests/unit/manager/default/test_driver.py b/tests/unit/manager/default/test_driver.py index 0693d51a..858abeb9 100644 --- a/tests/unit/manager/default/test_driver.py +++ b/tests/unit/manager/default/test_driver.py @@ -17,14 +17,14 @@ import mock from oslo.config import cfg -from cdn.manager.default import driver -from cdn.manager.default import services +from poppy.manager.default import driver +from poppy.manager.default import services from tests.unit import base class DefaultManagerDriverTests(base.TestCase): - @mock.patch('cdn.storage.base.driver.StorageDriverBase') - @mock.patch('cdn.provider.base.driver.ProviderDriverBase') + @mock.patch('poppy.storage.base.driver.StorageDriverBase') + @mock.patch('poppy.provider.base.driver.ProviderDriverBase') def setUp(self, mock_storage, mock_provider): super(DefaultManagerDriverTests, self).setUp() diff --git a/tests/unit/manager/default/test_services.py b/tests/unit/manager/default/test_services.py index 9fc7a00b..a0ad6738 100644 --- a/tests/unit/manager/default/test_services.py +++ b/tests/unit/manager/default/test_services.py @@ -17,14 +17,14 @@ import mock from oslo.config import cfg -from cdn.manager.default import driver -from cdn.manager.default import services +from poppy.manager.default import driver +from poppy.manager.default import services from tests.unit import base class DefaultManagerServiceTests(base.TestCase): - @mock.patch('cdn.storage.base.driver.StorageDriverBase') - @mock.patch('cdn.provider.base.driver.ProviderDriverBase') + @mock.patch('poppy.storage.base.driver.StorageDriverBase') + @mock.patch('poppy.provider.base.driver.ProviderDriverBase') def setUp(self, mock_driver, mock_provider): super(DefaultManagerServiceTests, self).setUp() diff --git a/tests/unit/model/helpers/test_cachingrule.py b/tests/unit/model/helpers/test_cachingrule.py index 60c06748..97481f51 100644 --- a/tests/unit/model/helpers/test_cachingrule.py +++ b/tests/unit/model/helpers/test_cachingrule.py @@ -16,7 +16,7 @@ import ddt -from cdn.model.helpers import cachingrule +from poppy.model.helpers import cachingrule from tests.unit import base diff --git a/tests/unit/model/helpers/test_domain.py b/tests/unit/model/helpers/test_domain.py index 162c6667..f2632daf 100644 --- a/tests/unit/model/helpers/test_domain.py +++ b/tests/unit/model/helpers/test_domain.py @@ -16,7 +16,7 @@ import ddt -from cdn.model.helpers import domain +from poppy.model.helpers import domain from tests.unit import base diff --git a/tests/unit/model/helpers/test_link.py b/tests/unit/model/helpers/test_link.py index 730d20d3..4982b214 100644 --- a/tests/unit/model/helpers/test_link.py +++ b/tests/unit/model/helpers/test_link.py @@ -16,7 +16,7 @@ import ddt -from cdn.model.helpers import link +from poppy.model.helpers import link from tests.unit import base diff --git a/tests/unit/model/helpers/test_origin.py b/tests/unit/model/helpers/test_origin.py index d26ce9ca..09bc6479 100644 --- a/tests/unit/model/helpers/test_origin.py +++ b/tests/unit/model/helpers/test_origin.py @@ -16,7 +16,7 @@ import ddt -from cdn.model.helpers import origin +from poppy.model.helpers import origin from tests.unit import base diff --git a/tests/unit/model/helpers/test_restriciton.py b/tests/unit/model/helpers/test_restriciton.py index 2b63351e..3e79bc1d 100644 --- a/tests/unit/model/helpers/test_restriciton.py +++ b/tests/unit/model/helpers/test_restriciton.py @@ -16,7 +16,7 @@ import ddt -from cdn.model.helpers import restriction +from poppy.model.helpers import restriction from tests.unit import base diff --git a/tests/unit/model/helpers/test_rule.py b/tests/unit/model/helpers/test_rule.py index b5bae795..329036b3 100644 --- a/tests/unit/model/helpers/test_rule.py +++ b/tests/unit/model/helpers/test_rule.py @@ -16,7 +16,7 @@ import ddt -from cdn.model.helpers import rule +from poppy.model.helpers import rule from tests.unit import base diff --git a/tests/unit/model/test_service.py b/tests/unit/model/test_service.py index 7c53b27b..53deefcc 100644 --- a/tests/unit/model/test_service.py +++ b/tests/unit/model/test_service.py @@ -16,9 +16,9 @@ import ddt -from cdn.model.helpers import domain -from cdn.model.helpers import origin -from cdn.model import service +from poppy.model.helpers import domain +from poppy.model.helpers import origin +from poppy.model import service from tests.unit import base diff --git a/tests/unit/provider/fastly/test_driver.py b/tests/unit/provider/fastly/test_driver.py index b91ef5bf..67fc0711 100644 --- a/tests/unit/provider/fastly/test_driver.py +++ b/tests/unit/provider/fastly/test_driver.py @@ -13,13 +13,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -import fastly import mock -from cdn.provider.fastly import driver +import fastly from oslo.config import cfg + +from poppy.provider.fastly import driver from tests.unit import base + FASTLY_OPTIONS = [ cfg.StrOpt('apikey', default='123456', @@ -55,7 +57,7 @@ class TestDriver(base.TestCase): client = provider.client() self.assertNotEquals(client, None) - @mock.patch('cdn.provider.fastly.controllers.ServiceController') + @mock.patch('poppy.provider.fastly.controllers.ServiceController') @mock.patch.object(driver, 'FASTLY_OPTIONS', new=FASTLY_OPTIONS) def test_service_controller(self, MockController): provider = driver.CDNProvider(self.conf) diff --git a/tests/unit/provider/fastly/test_services.py b/tests/unit/provider/fastly/test_services.py index 33dd5f02..98d7d734 100644 --- a/tests/unit/provider/fastly/test_services.py +++ b/tests/unit/provider/fastly/test_services.py @@ -18,7 +18,7 @@ import fastly import mock import random -from cdn.provider.fastly import services +from poppy.provider.fastly import services from tests.unit import base @@ -29,8 +29,8 @@ class TestServices(base.TestCase): @mock.patch('fastly.FastlyConnection') @mock.patch('fastly.FastlyService') @mock.patch('fastly.FastlyVersion') - @mock.patch('cdn.provider.fastly.services.ServiceController.client') - @mock.patch('cdn.provider.fastly.driver.CDNProvider') + @mock.patch('poppy.provider.fastly.services.ServiceController.client') + @mock.patch('poppy.provider.fastly.driver.CDNProvider') def test_create(self, service_json, mock_connection, mock_service, mock_version, mock_controllerclient, mock_driver): @@ -122,8 +122,8 @@ class TestServices(base.TestCase): @mock.patch('fastly.FastlyConnection') @mock.patch('fastly.FastlyService') - @mock.patch('cdn.provider.fastly.services.ServiceController.client') - @mock.patch('cdn.provider.fastly.driver.CDNProvider') + @mock.patch('poppy.provider.fastly.services.ServiceController.client') + @mock.patch('poppy.provider.fastly.driver.CDNProvider') def test_delete(self, mock_connection, mock_service, mock_client, mock_driver): driver = mock_driver() @@ -155,8 +155,8 @@ class TestServices(base.TestCase): controller.client.delete_service.assert_called_once_with(service.id) self.assertIn('domain', resp[driver.provider_name]) - @mock.patch('cdn.provider.fastly.services.ServiceController.client') - @mock.patch('cdn.provider.fastly.driver.CDNProvider') + @mock.patch('poppy.provider.fastly.services.ServiceController.client') + @mock.patch('poppy.provider.fastly.driver.CDNProvider') @ddt.file_data('data_service.json') def test_update(self, mock_get_client, mock_driver, service_json): service_name = 'whatsitnamed' @@ -166,7 +166,7 @@ class TestServices(base.TestCase): resp = controller.update(service_name, service_json) self.assertIn('domain', resp[driver.provider_name]) - @mock.patch('cdn.provider.fastly.driver.CDNProvider') + @mock.patch('poppy.provider.fastly.driver.CDNProvider') def test_client(self, mock_driver): driver = mock_driver() controller = services.ServiceController(driver) diff --git a/tests/unit/provider/mock/test_mock_driver.py b/tests/unit/provider/mock/test_mock_driver.py index f7ff75cc..e0d9ad7d 100644 --- a/tests/unit/provider/mock/test_mock_driver.py +++ b/tests/unit/provider/mock/test_mock_driver.py @@ -15,7 +15,7 @@ from oslo.config import cfg -from cdn.provider.mock import driver +from poppy.provider.mock import driver from tests.unit import base diff --git a/tests/unit/storage/cassandra/test_driver.py b/tests/unit/storage/cassandra/test_driver.py index a40b8b85..cd44afdb 100644 --- a/tests/unit/storage/cassandra/test_driver.py +++ b/tests/unit/storage/cassandra/test_driver.py @@ -18,15 +18,15 @@ import mock from oslo.config import cfg -from cdn.storage.cassandra import driver -from cdn.storage.cassandra import services +from poppy.storage.cassandra import driver +from poppy.storage.cassandra import services from tests.unit import base CASSANDRA_OPTIONS = [ cfg.ListOpt('cluster', default='mock_ip', help='Cassandra Cluster contact points'), - cfg.StrOpt('keyspace', default='mock_cdn', + cfg.StrOpt('keyspace', default='mock_poppy', help='Keyspace for all queries made in session'), ] @@ -44,7 +44,7 @@ class CassandraStorageServiceTests(base.TestCase): self.assertEquals(self.cassandra_driver.cassandra_conf['cluster'], ['mock_ip']) self.assertEquals(self.cassandra_driver.cassandra_conf.keyspace, - 'mock_cdn') + 'mock_poppy') def test_is_alive(self): self.assertEquals(self.cassandra_driver.is_alive(), True) @@ -52,7 +52,7 @@ class CassandraStorageServiceTests(base.TestCase): @mock.patch.object(cassandra.cluster.Cluster, 'connect') def test_connection(self, mock_cluster): self.cassandra_driver.connection() - mock_cluster.assert_called_with('mock_cdn') + mock_cluster.assert_called_with('mock_poppy') def test_service_controller(self): sc = self.cassandra_driver.service_controller @@ -64,4 +64,4 @@ class CassandraStorageServiceTests(base.TestCase): @mock.patch.object(cassandra.cluster.Cluster, 'connect') def test_service_database(self, mock_cluster): self.cassandra_driver.service_database - mock_cluster.assert_called_with('mock_cdn') + mock_cluster.assert_called_with('mock_poppy') diff --git a/tests/unit/storage/cassandra/test_services.py b/tests/unit/storage/cassandra/test_services.py index 50839438..1b775e92 100644 --- a/tests/unit/storage/cassandra/test_services.py +++ b/tests/unit/storage/cassandra/test_services.py @@ -19,8 +19,8 @@ import mock from oslo.config import cfg -from cdn.storage.cassandra import driver -from cdn.storage.cassandra import services +from poppy.storage.cassandra import driver +from poppy.storage.cassandra import services from tests.unit import base diff --git a/tests/unit/storage/mockdb/test_mockdb_driver.py b/tests/unit/storage/mockdb/test_mockdb_driver.py index 6509158b..e8aa9b24 100644 --- a/tests/unit/storage/mockdb/test_mockdb_driver.py +++ b/tests/unit/storage/mockdb/test_mockdb_driver.py @@ -15,7 +15,7 @@ from oslo.config import cfg -from cdn.storage.mockdb import driver +from poppy.storage.mockdb import driver from tests.unit import base diff --git a/tests/unit/test_bootstrap.py b/tests/unit/test_bootstrap.py index adfdab8e..170d1b68 100644 --- a/tests/unit/test_bootstrap.py +++ b/tests/unit/test_bootstrap.py @@ -18,7 +18,7 @@ import os import mock from oslo.config import cfg -from cdn import bootstrap +from poppy import bootstrap from tests.unit import base @@ -32,7 +32,7 @@ class TestBootStrap(base.TestCase): bootstrap_obj = bootstrap.Bootstrap(cfg.CONF) - mock_path = 'cdn.transport.pecan.driver.simple_server' + mock_path = 'poppy.transport.pecan.driver.simple_server' with mock.patch(mock_path) as mocked_module: mock_server = mock.Mock() mocked_module.make_server = mock.Mock(return_value=mock_server) diff --git a/tests/unit/transport/pecan/test_driver.py b/tests/unit/transport/pecan/test_driver.py index cb4bad09..2c1fea62 100644 --- a/tests/unit/transport/pecan/test_driver.py +++ b/tests/unit/transport/pecan/test_driver.py @@ -18,7 +18,7 @@ import os import mock from oslo.config import cfg -from cdn.transport import pecan +from poppy.transport import pecan from tests.unit import base @@ -32,7 +32,7 @@ class PecanTransportDriverTest(base.TestCase): conf_path = os.path.join(tests_path, 'etc', 'default_functional.conf') cfg.CONF(args=[], default_config_files=[conf_path]) - mock_path = 'cdn.transport.pecan.driver.simple_server' + mock_path = 'poppy.transport.pecan.driver.simple_server' with mock.patch(mock_path) as mocked_module: mock_server = mock.Mock() mocked_module.make_server = mock.Mock(return_value=mock_server) diff --git a/tox.ini b/tox.ini index 28c7330b..3179e67d 100644 --- a/tox.ini +++ b/tox.ini @@ -35,4 +35,4 @@ builtins = __CDN_SETUP__ exclude = .venv*,venv*,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*.egg,.update-venv [hacking] -import_exceptions = cdn.openstack.common.gettextutils._ +import_exceptions = poppy.openstack.common.gettextutils._