diff --git a/.gitignore b/.gitignore index dfe851d..d9af490 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ # Packages *.egg +*.eggs *.egg-info dist build diff --git a/oslo_reports/__init__.py b/oslo_reports/__init__.py index e69de29..100171b 100644 --- a/oslo_reports/__init__.py +++ b/oslo_reports/__init__.py @@ -0,0 +1,25 @@ +# Copyright 2013 Red Hat, Inc. +# +# 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. + +"""Provides a way to generate serializable reports + +This package/module provides mechanisms for defining reports +which may then be serialized into various data types. Each +report ( :class:`oslo_reports.report.BasicReport` ) +is composed of one or more report sections +( :class:`oslo_reports.report.BasicSection` ), +which contain generators which generate data models +( :class:`oslo_reports.models.base.ReportModels` ), +which are then serialized by views. +""" diff --git a/oslo_reports/report/__init__.py b/oslo_reports/_utils.py similarity index 55% rename from oslo_reports/report/__init__.py rename to oslo_reports/_utils.py index 35390ec..eaf5299 100644 --- a/oslo_reports/report/__init__.py +++ b/oslo_reports/_utils.py @@ -12,14 +12,13 @@ # License for the specific language governing permissions and limitations # under the License. -"""Provides a way to generate serializable reports +"""Various utilities for report generation -This package/module provides mechanisms for defining reports -which may then be serialized into various data types. Each -report ( :class:`openstack.common.report.report.BasicReport` ) -is composed of one or more report sections -( :class:`openstack.common.report.report.BasicSection` ), -which contain generators which generate data models -( :class:`openstack.common.report.models.base.ReportModels` ), -which are then serialized by views. +This module includes various utilities +used in generating reports. """ + +class StringWithAttrs(str): + """A String that can have arbitrary attributes""" + + pass diff --git a/oslo_reports/report/generators/__init__.py b/oslo_reports/generators/__init__.py similarity index 92% rename from oslo_reports/report/generators/__init__.py rename to oslo_reports/generators/__init__.py index 68473f2..4daf75e 100644 --- a/oslo_reports/report/generators/__init__.py +++ b/oslo_reports/generators/__init__.py @@ -15,7 +15,7 @@ """Provides Data Model Generators This module defines classes for generating data models -( :class:`openstack.common.report.models.base.ReportModel` ). +( :class:`oslo_reports.models.base.ReportModel` ). A generator is any object which is callable with no parameters and returns a data model. """ diff --git a/oslo_reports/report/generators/conf.py b/oslo_reports/generators/conf.py similarity index 88% rename from oslo_reports/report/generators/conf.py rename to oslo_reports/generators/conf.py index 619e489..cdb8c43 100644 --- a/oslo_reports/report/generators/conf.py +++ b/oslo_reports/generators/conf.py @@ -16,19 +16,19 @@ This module defines a class for configuration generators for generating the model in -:mod:`openstack.common.report.models.conf`. +:mod:`oslo_reports.models.conf`. """ from oslo_config import cfg -from openstack.common.report.models import conf as cm +from oslo_reports.models import conf as cm class ConfigReportGenerator(object): """A Configuration Data Generator This generator returns - :class:`openstack.common.report.models.conf.ConfigModel`, + :class:`oslo_reports.models.conf.ConfigModel`, by default using the configuration options stored in :attr:`oslo_config.cfg.CONF`, which is where OpenStack stores everything. diff --git a/oslo_reports/report/generators/process.py b/oslo_reports/generators/process.py similarity index 89% rename from oslo_reports/report/generators/process.py rename to oslo_reports/generators/process.py index 9c2151f..2749ff2 100644 --- a/oslo_reports/report/generators/process.py +++ b/oslo_reports/generators/process.py @@ -22,14 +22,14 @@ import os import psutil -from openstack.common.report.models import process as pm +from oslo_reports.models import process as pm class ProcessReportGenerator(object): """A Process Data Generator This generator returns a - :class:`openstack.common.report.models.process.ProcessModel` + :class:`oslo_reports.models.process.ProcessModel` based on the current process (which will also include all subprocesses, recursively) using the :class:`psutil.Process` class`. """ diff --git a/oslo_reports/report/generators/threading.py b/oslo_reports/generators/threading.py similarity index 71% rename from oslo_reports/report/generators/threading.py rename to oslo_reports/generators/threading.py index b3038cf..9d68f90 100644 --- a/oslo_reports/report/generators/threading.py +++ b/oslo_reports/generators/threading.py @@ -16,27 +16,43 @@ This module defines classes for threading-related generators for generating the models in -:mod:`openstack.common.report.models.threading`. +:mod:`oslo_reports.models.threading`. """ from __future__ import absolute_import +import gc import sys import threading -import greenlet +from oslo_reports.models import threading as tm +from oslo_reports.models import with_default_views as mwdv +from oslo_reports.views.text import generic as text_views -from openstack.common.report.models import threading as tm -from openstack.common.report.models import with_default_views as mwdv -from openstack.common.report import utils as rutils -from openstack.common.report.views.text import generic as text_views + +def _find_objects(t): + """Find Objects in the GC State + + This horribly hackish method locates objects of a + given class in the current python instance's garbage + collection state. In case you couldn't tell, this is + horribly hackish, but is necessary for locating all + green threads, since they don't keep track of themselves + like normal threads do in python. + + :param class t: the class of object to locate + :rtype: list + :returns: a list of objects of the given type + """ + + return [o for o in gc.get_objects() if isinstance(o, t)] class ThreadReportGenerator(object): """A Thread Data Generator This generator returns a collection of - :class:`openstack.common.report.models.threading.ThreadModel` + :class:`oslo_reports.models.threading.ThreadModel` objects by introspecting the current python state using :func:`sys._current_frames()` . Its constructor may optionally be passed a frame object. This frame object will be interpreted @@ -67,19 +83,21 @@ class GreenThreadReportGenerator(object): """A Green Thread Data Generator This generator returns a collection of - :class:`openstack.common.report.models.threading.GreenThreadModel` + :class:`oslo_reports.models.threading.GreenThreadModel` objects by introspecting the current python garbage collection state, and sifting through for :class:`greenlet.greenlet` objects. .. seealso:: - Function :func:`openstack.common.report.utils._find_objects` + Function :func:`_find_objects` """ def __call__(self): + import greenlet + threadModels = [ tm.GreenThreadModel(gr.gr_frame) - for gr in rutils._find_objects(greenlet.greenlet) + for gr in _find_objects(greenlet.greenlet) ] return mwdv.ModelWithDefaultViews(threadModels, diff --git a/oslo_reports/report/generators/version.py b/oslo_reports/generators/version.py similarity index 89% rename from oslo_reports/report/generators/version.py rename to oslo_reports/generators/version.py index c87390a..cce638a 100644 --- a/oslo_reports/report/generators/version.py +++ b/oslo_reports/generators/version.py @@ -17,17 +17,17 @@ This module defines a class for OpenStack version and package information generators for generating the model in -:mod:`openstack.common.report.models.version`. +:mod:`oslo_reports.models.version`. """ -from openstack.common.report.models import version as vm +from oslo_reports.models import version as vm class PackageReportGenerator(object): """A Package Information Data Generator This generator returns - :class:`openstack.common.report.models.version.PackageModel`, + :class:`oslo_reports.models.version.PackageModel`, extracting data from the given version object, which should follow the general format defined in Nova's version information (i.e. it should contain the methods vendor_string, product_string, and diff --git a/oslo_reports/report/guru_meditation_report.py b/oslo_reports/guru_meditation_report.py similarity index 96% rename from oslo_reports/report/guru_meditation_report.py rename to oslo_reports/guru_meditation_report.py index bff9234..ed62338 100644 --- a/oslo_reports/report/guru_meditation_report.py +++ b/oslo_reports/guru_meditation_report.py @@ -58,11 +58,11 @@ import sys from oslo_utils import timeutils -from openstack.common.report.generators import conf as cgen -from openstack.common.report.generators import process as prgen -from openstack.common.report.generators import threading as tgen -from openstack.common.report.generators import version as pgen -from openstack.common.report import report +from oslo_reports.generators import conf as cgen +from oslo_reports.generators import process as prgen +from oslo_reports.generators import threading as tgen +from oslo_reports.generators import version as pgen +from oslo_reports import report class GuruMeditation(object): diff --git a/oslo_reports/report/models/__init__.py b/oslo_reports/models/__init__.py similarity index 100% rename from oslo_reports/report/models/__init__.py rename to oslo_reports/models/__init__.py diff --git a/oslo_reports/report/models/base.py b/oslo_reports/models/base.py similarity index 100% rename from oslo_reports/report/models/base.py rename to oslo_reports/models/base.py diff --git a/oslo_reports/report/models/conf.py b/oslo_reports/models/conf.py similarity index 93% rename from oslo_reports/report/models/conf.py rename to oslo_reports/models/conf.py index 2342937..e56a5cd 100644 --- a/oslo_reports/report/models/conf.py +++ b/oslo_reports/models/conf.py @@ -18,8 +18,8 @@ This module defines a class representing the data model for :mod:`oslo_config` configuration options """ -from openstack.common.report.models import with_default_views as mwdv -from openstack.common.report.views.text import generic as generic_text_views +from oslo_reports.models import with_default_views as mwdv +from oslo_reports.views.text import generic as generic_text_views class ConfigModel(mwdv.ModelWithDefaultViews): diff --git a/oslo_reports/report/models/process.py b/oslo_reports/models/process.py similarity index 94% rename from oslo_reports/report/models/process.py rename to oslo_reports/models/process.py index d953b94..16c57d9 100644 --- a/oslo_reports/report/models/process.py +++ b/oslo_reports/models/process.py @@ -18,8 +18,8 @@ This module defines a class representing a process, potentially with subprocesses. """ -import openstack.common.report.models.with_default_views as mwdv -import openstack.common.report.views.text.process as text_views +import oslo_reports.models.with_default_views as mwdv +import oslo_reports.views.text.process as text_views class ProcessModel(mwdv.ModelWithDefaultViews): diff --git a/oslo_reports/report/models/threading.py b/oslo_reports/models/threading.py similarity index 95% rename from oslo_reports/report/models/threading.py rename to oslo_reports/models/threading.py index a3ffc86..5caca3c 100644 --- a/oslo_reports/report/models/threading.py +++ b/oslo_reports/models/threading.py @@ -20,8 +20,8 @@ thread, and stack trace data models import traceback -from openstack.common.report.models import with_default_views as mwdv -from openstack.common.report.views.text import threading as text_views +from oslo_reports.models import with_default_views as mwdv +from oslo_reports.views.text import threading as text_views class StackTraceModel(mwdv.ModelWithDefaultViews): diff --git a/oslo_reports/report/models/version.py b/oslo_reports/models/version.py similarity index 90% rename from oslo_reports/report/models/version.py rename to oslo_reports/models/version.py index 89e73d4..50d2f6c 100644 --- a/oslo_reports/report/models/version.py +++ b/oslo_reports/models/version.py @@ -18,8 +18,8 @@ This module defines a class representing the data model for OpenStack package and version information """ -from openstack.common.report.models import with_default_views as mwdv -from openstack.common.report.views.text import generic as generic_text_views +from oslo_reports.models import with_default_views as mwdv +from oslo_reports.views.text import generic as generic_text_views class PackageModel(mwdv.ModelWithDefaultViews): diff --git a/oslo_reports/report/models/with_default_views.py b/oslo_reports/models/with_default_views.py similarity index 84% rename from oslo_reports/report/models/with_default_views.py rename to oslo_reports/models/with_default_views.py index 058fbb2..cce9d88 100644 --- a/oslo_reports/report/models/with_default_views.py +++ b/oslo_reports/models/with_default_views.py @@ -14,10 +14,10 @@ import copy -from openstack.common.report.models import base as base_model -from openstack.common.report.views.json import generic as jsonviews -from openstack.common.report.views.text import generic as textviews -from openstack.common.report.views.xml import generic as xmlviews +from oslo_reports.models import base as base_model +from oslo_reports.views.json import generic as jsonviews +from oslo_reports.views.text import generic as textviews +from oslo_reports.views.xml import generic as xmlviews class ModelWithDefaultViews(base_model.ReportModel): @@ -35,11 +35,11 @@ class ModelWithDefaultViews(base_model.ReportModel): The default 'default views' are text - :class:`openstack.common.report.views.text.generic.KeyValueView` + :class:`oslo_reports.views.text.generic.KeyValueView` xml - :class:`openstack.common.report.views.xml.generic.KeyValueView` + :class:`oslo_reports.views.xml.generic.KeyValueView` json - :class:`openstack.common.report.views.json.generic.KeyValueView` + :class:`oslo_reports.views.json.generic.KeyValueView` .. function:: to_type() diff --git a/oslo_reports/report/report.py b/oslo_reports/report.py similarity index 91% rename from oslo_reports/report/report.py rename to oslo_reports/report.py index 1eb937b..eafe791 100644 --- a/oslo_reports/report/report.py +++ b/oslo_reports/report.py @@ -19,7 +19,7 @@ All reports take the form of a report class containing various report sections. """ -from openstack.common.report.views.text import header as header_views +from oslo_reports.views.text import header as header_views class BasicReport(object): @@ -45,7 +45,7 @@ class BasicReport(object): list. The view is called on the model which results from the generator when the report is run. A generator is simply a method or callable object which takes no arguments and - returns a :class:`openstack.common.report.models.base.ReportModel` + returns a :class:`oslo_reports.models.base.ReportModel` or similar object. :param view: the top-level view for the section @@ -110,11 +110,11 @@ class ReportOfType(BasicReport): .. seealso:: - Class :class:`openstack.common.report.models.with_default_view.ModelWithDefaultView` # noqa + Class :class:`oslo_reports.models.with_default_view.ModelWithDefaultView` # noqa (the entire class) - Class :class:`openstack.common.report.models.base.ReportModel` - :func:`openstack.common.report.models.base.ReportModel.set_current_view_type` # noqa + Class :class:`oslo_reports.models.base.ReportModel` + :func:`oslo_reports.models.base.ReportModel.set_current_view_type` # noqa :param str tp: the type of the report """ @@ -167,13 +167,13 @@ class TextReport(ReportOfType): list. The view is called on the model which results from the generator when the report is run. A generator is simply a method or callable object which takes no arguments and - returns a :class:`openstack.common.report.models.base.ReportModel` + returns a :class:`oslo_reports.models.base.ReportModel` or similar object. The model is told to serialize as text (if possible) at serialization time by wrapping the generator. The view model's attached view (if any) is wrapped in a - :class:`openstack.common.report.views.text.header.TitledView` + :class:`oslo_reports.views.text.header.TitledView` :param str heading: the title for the section :param generator: the method or class which generates the model diff --git a/oslo_reports/report/utils.py b/oslo_reports/report/utils.py deleted file mode 100644 index fb71e36..0000000 --- a/oslo_reports/report/utils.py +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright 2013 Red Hat, Inc. -# -# 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. - -"""Various utilities for report generation - -This module includes various utilities -used in generating reports. -""" - -import gc - - -class StringWithAttrs(str): - """A String that can have arbitrary attributes - """ - - pass - - -def _find_objects(t): - """Find Objects in the GC State - - This horribly hackish method locates objects of a - given class in the current python instance's garbage - collection state. In case you couldn't tell, this is - horribly hackish, but is necessary for locating all - green threads, since they don't keep track of themselves - like normal threads do in python. - - :param class t: the class of object to locate - :rtype: list - :returns: a list of objects of the given type - """ - - return [o for o in gc.get_objects() if isinstance(o, t)] diff --git a/oslo_reports/tests/reports/__init__.py b/oslo_reports/tests/reports/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/oslo_reports/tests/reports/test_base_report.py b/oslo_reports/tests/test_base_report.py similarity index 97% rename from oslo_reports/tests/reports/test_base_report.py rename to oslo_reports/tests/test_base_report.py index db655fc..29cad5d 100644 --- a/oslo_reports/tests/reports/test_base_report.py +++ b/oslo_reports/tests/test_base_report.py @@ -17,8 +17,8 @@ import re from oslotest import base -from openstack.common.report.models import base as base_model -from openstack.common.report import report +from oslo_reports.models import base as base_model +from oslo_reports import report class BasicView(object): diff --git a/oslo_reports/tests/reports/test_guru_meditation_report.py b/oslo_reports/tests/test_guru_meditation_report.py similarity index 98% rename from oslo_reports/tests/reports/test_guru_meditation_report.py rename to oslo_reports/tests/test_guru_meditation_report.py index 68e8ea5..ed836e7 100644 --- a/oslo_reports/tests/reports/test_guru_meditation_report.py +++ b/oslo_reports/tests/test_guru_meditation_report.py @@ -27,8 +27,8 @@ import mock from oslotest import base import six -from openstack.common.report import guru_meditation_report as gmr -from openstack.common.report.models import with_default_views as mwdv +from oslo_reports import guru_meditation_report as gmr +from oslo_reports.models import with_default_views as mwdv class FakeVersionObj(object): diff --git a/oslo_reports/tests/reports/test_openstack_generators.py b/oslo_reports/tests/test_openstack_generators.py similarity index 93% rename from oslo_reports/tests/reports/test_openstack_generators.py rename to oslo_reports/tests/test_openstack_generators.py index cb2b916..caf2e24 100644 --- a/oslo_reports/tests/reports/test_openstack_generators.py +++ b/oslo_reports/tests/test_openstack_generators.py @@ -20,10 +20,10 @@ import mock from oslo_config import cfg from oslotest import base -from openstack.common.report.generators import conf as os_cgen -from openstack.common.report.generators import threading as os_tgen -from openstack.common.report.generators import version as os_pgen -from openstack.common.report.models import threading as os_tmod +from oslo_reports.generators import conf as os_cgen +from oslo_reports.generators import threading as os_tgen +from oslo_reports.generators import version as os_pgen +from oslo_reports.models import threading as os_tmod class TestOpenstackGenerators(base.BaseTestCase): @@ -49,7 +49,7 @@ class TestOpenstackGenerators(base.BaseTestCase): def __init__(self, thread_id, tb): self.traceback = tb - with mock.patch('openstack.common.report.models' + with mock.patch('oslo_reports.models' '.threading.ThreadModel', FakeModel): model = os_tgen.ThreadReportGenerator("fake traceback")() curr_thread = model.get(threading.current_thread().ident, None) diff --git a/oslo_reports/tests/test_reports.py b/oslo_reports/tests/test_reports.py deleted file mode 100644 index 748731a..0000000 --- a/oslo_reports/tests/test_reports.py +++ /dev/null @@ -1,28 +0,0 @@ -# -*- coding: utf-8 -*- - -# 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. - -""" -test_reports ----------------------------------- - -Tests for `reports` module. -""" - -from oslotest import base - - -class TestReports(base.BaseTestCase): - - def test_something(self): - pass diff --git a/oslo_reports/tests/reports/test_views.py b/oslo_reports/tests/test_views.py similarity index 97% rename from oslo_reports/tests/reports/test_views.py rename to oslo_reports/tests/test_views.py index f3762fe..7370628 100644 --- a/oslo_reports/tests/reports/test_views.py +++ b/oslo_reports/tests/test_views.py @@ -17,12 +17,12 @@ import copy import mock from oslotest import base -from openstack.common.report.models import base as base_model -from openstack.common.report.models import with_default_views as mwdv -from openstack.common.report import report -from openstack.common.report.views import jinja_view as jv -from openstack.common.report.views.json import generic as json_generic -from openstack.common.report.views.text import generic as text_generic +from oslo_reports.models import base as base_model +from oslo_reports.models import with_default_views as mwdv +from oslo_reports import report +from oslo_reports.views import jinja_view as jv +from oslo_reports.views.json import generic as json_generic +from oslo_reports.views.text import generic as text_generic def mwdv_generator(): diff --git a/oslo_reports/report/views/__init__.py b/oslo_reports/views/__init__.py similarity index 100% rename from oslo_reports/report/views/__init__.py rename to oslo_reports/views/__init__.py diff --git a/oslo_reports/report/views/jinja_view.py b/oslo_reports/views/jinja_view.py similarity index 100% rename from oslo_reports/report/views/jinja_view.py rename to oslo_reports/views/jinja_view.py diff --git a/oslo_reports/report/views/json/__init__.py b/oslo_reports/views/json/__init__.py similarity index 100% rename from oslo_reports/report/views/json/__init__.py rename to oslo_reports/views/json/__init__.py diff --git a/oslo_reports/report/views/json/generic.py b/oslo_reports/views/json/generic.py similarity index 94% rename from oslo_reports/report/views/json/generic.py rename to oslo_reports/views/json/generic.py index a8814ea..b8911c1 100644 --- a/oslo_reports/report/views/json/generic.py +++ b/oslo_reports/views/json/generic.py @@ -17,7 +17,7 @@ This modules defines several basic views for serializing data to JSON. Submodels that have already been serialized as JSON may have their string values marked with `__is_json__ -= True` using :class:`openstack.common.report.utils.StringWithAttrs` += True` using :class:`oslo_reports._utils.StringWithAttrs` (each of the classes within this module does this automatically, and non-naive serializers check for this attribute and handle such strings specially) @@ -27,7 +27,7 @@ import copy from oslo_serialization import jsonutils as json -from openstack.common.report import utils as utils +from oslo_reports import _utils as utils class BasicKeyValueView(object): diff --git a/oslo_reports/report/views/text/__init__.py b/oslo_reports/views/text/__init__.py similarity index 100% rename from oslo_reports/report/views/text/__init__.py rename to oslo_reports/views/text/__init__.py diff --git a/oslo_reports/report/views/text/generic.py b/oslo_reports/views/text/generic.py similarity index 100% rename from oslo_reports/report/views/text/generic.py rename to oslo_reports/views/text/generic.py diff --git a/oslo_reports/report/views/text/header.py b/oslo_reports/views/text/header.py similarity index 100% rename from oslo_reports/report/views/text/header.py rename to oslo_reports/views/text/header.py diff --git a/oslo_reports/report/views/text/process.py b/oslo_reports/views/text/process.py similarity index 90% rename from oslo_reports/report/views/text/process.py rename to oslo_reports/views/text/process.py index edd2be7..887f6d6 100644 --- a/oslo_reports/report/views/text/process.py +++ b/oslo_reports/views/text/process.py @@ -18,14 +18,14 @@ This module provides a view for visualizing processes in human-readable formm """ -import openstack.common.report.views.jinja_view as jv +import oslo_reports.views.jinja_view as jv class ProcessView(jv.JinjaView): """A Process View This view displays process models defined by - :class:`openstack.common.report.models.process.ProcessModel` + :class:`oslo_reports.models.process.ProcessModel` """ VIEW_TEXT = ( diff --git a/oslo_reports/report/views/text/threading.py b/oslo_reports/views/text/threading.py similarity index 88% rename from oslo_reports/report/views/text/threading.py rename to oslo_reports/views/text/threading.py index f8b208d..5b84f30 100644 --- a/oslo_reports/report/views/text/threading.py +++ b/oslo_reports/views/text/threading.py @@ -19,14 +19,14 @@ visualizing threads, green threads, and stack traces in human-readable form. """ -from openstack.common.report.views import jinja_view as jv +from oslo_reports.views import jinja_view as jv class StackTraceView(jv.JinjaView): """A Stack Trace View This view displays stack trace models defined by - :class:`openstack.common.report.models.threading.StackTraceModel` + :class:`oslo_reports.models.threading.StackTraceModel` """ VIEW_TEXT = ( @@ -52,7 +52,7 @@ class GreenThreadView(object): """A Green Thread View This view displays a green thread provided by the data - model :class:`openstack.common.report.models.threading.GreenThreadModel` + model :class:`oslo_reports.models.threading.GreenThreadModel` """ FORMAT_STR = "------{thread_str: ^60}------" + "\n" + "{stack_trace}" @@ -68,7 +68,7 @@ class ThreadView(object): """A Thread Collection View This view displays a python thread provided by the data - model :class:`openstack.common.report.models.threading.ThreadModel` # noqa + model :class:`oslo_reports.models.threading.ThreadModel` # noqa """ FORMAT_STR = "------{thread_str: ^60}------" + "\n" + "{stack_trace}" diff --git a/oslo_reports/report/views/xml/__init__.py b/oslo_reports/views/xml/__init__.py similarity index 100% rename from oslo_reports/report/views/xml/__init__.py rename to oslo_reports/views/xml/__init__.py diff --git a/oslo_reports/report/views/xml/generic.py b/oslo_reports/views/xml/generic.py similarity index 96% rename from oslo_reports/report/views/xml/generic.py rename to oslo_reports/views/xml/generic.py index 13b6a0a..392b604 100644 --- a/oslo_reports/report/views/xml/generic.py +++ b/oslo_reports/views/xml/generic.py @@ -17,7 +17,7 @@ This modules defines several basic views for serializing data to XML. Submodels that have already been serialized as XML may have their string values marked with `__is_xml__ -= True` using :class:`openstack.common.report.utils.StringWithAttrs` += True` using :class:`oslo_reports._utils.StringWithAttrs` (each of the classes within this module does this automatically, and non-naive serializers check for this attribute and handle such strings specially) @@ -29,7 +29,7 @@ import xml.etree.ElementTree as ET import six -from openstack.common.report import utils as utils +from oslo_reports import _utils as utils class KeyValueView(object): diff --git a/requirements.txt b/requirements.txt index c299e3b..e7649e9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,10 @@ # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. +pbr>=0.11,<2.0 +Jinja2>=2.6 # BSD License (3 clause) Babel>=1.3 +oslo.serialization>=1.4.0 # Apache-2.0 +psutil>=1.1.1,<2.0.0 +six>=1.9.0 +oslo.i18n>=1.5.0 # Apache-2.0 diff --git a/test-requirements.txt b/test-requirements.txt index 15f08a0..fa360ae 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -8,3 +8,8 @@ oslotest>=1.5.1 # These are needed for docs generation oslosphinx>=2.5.0 sphinx!=1.2.0,!=1.3b1,<1.3,>=1.1.2 + +# for testing optional parts +oslo.config>=1.11.0 # Apache-2.0 +eventlet>=0.17.3 +greenlet>=0.3.2