Esempio n. 1
0
 def test_object_modules(self):
     example_module = 'neutron.tests.unit.tests.example.dir.example_module'
     sys.modules.pop(example_module, None)
     modules = utils.import_modules_recursively(
         os.path.dirname(tests.__file__))
     self.assertIn(example_module, modules)
     self.assertIn(example_module, sys.modules)
Esempio n. 2
0
 def test_recursion(self):
     expected_modules = (
         'neutron.tests.unit.tests.example.dir.example_module',
         'neutron.tests.unit.tests.example.dir.subdir.example_module',
     )
     for module in expected_modules:
         sys.modules.pop(module, None)
     modules = utils.import_modules_recursively(
         os.path.dirname(tests.__file__))
     for module in expected_modules:
         self.assertIn(module, modules)
         self.assertIn(module, sys.modules)
Esempio n. 3
0
    def test_recursion(self, separator):
        expected_modules = (
            'neutron.tests.unit.tests.example.dir.example_module',
            'neutron.tests.unit.tests.example.dir.subdir.example_module',
        )
        for module in expected_modules:
            sys.modules.pop(module, None)

        topdir = re.sub(r'[/\\]+', separator, os.path.dirname(tests.__file__))
        modules = utils.import_modules_recursively(topdir)
        for module in expected_modules:
            self.assertIn(module, modules)
            self.assertIn(module, sys.modules)
Esempio n. 4
0
    def test_recursion(self, separator):
        expected_modules = (
            'neutron.tests.unit.tests.example.dir.example_module',
            'neutron.tests.unit.tests.example.dir.subdir.example_module',
        )
        for module in expected_modules:
            sys.modules.pop(module, None)

        topdir = re.sub(r'[/\\]+', separator, os.path.dirname(tests.__file__))
        modules = utils.import_modules_recursively(topdir)
        for module in expected_modules:
            self.assertIn(module, modules)
            self.assertIn(module, sys.modules)
Esempio n. 5
0
 def setUp(self):
     super(TestObjectVersions, self).setUp()
     # NOTE(ihrachys): seed registry with all objects under neutron.objects
     # before validating the hashes
     utils.import_modules_recursively(os.path.dirname(objects.__file__))
Esempio n. 6
0
def register_objects():
    # local import to avoid circular import failure
    from neutron.common import utils
    utils.import_modules_recursively(sys.modules[__name__].__file__)
Esempio n. 7
0
Based on this comparison database can be healed with healing migration.

"""

import os.path

from neutron_lib.db import model_base

from neutron.common import utils
from neutron.db import agentschedulers_db  # noqa
from neutron.db.extra_dhcp_opt import models as edo_models  # noqa
from neutron.db import l3_dvrscheduler_db  # noqa
from neutron.db import l3_gwmode_db  # noqa
from neutron.db import models
from neutron.db import models_v2  # noqa
from neutron.db.port_security import models as ps_models  # noqa
from neutron.db.qos import models as qos_models  # noqa
from neutron.db.quota import models as quota_models  # noqa
from neutron.db import rbac_db_models  # noqa
from neutron.ipam.drivers.neutrondb_ipam import db_models  # noqa
from neutron.plugins.ml2 import models as ml2_models  # noqa
from neutron.services.auto_allocate import models as aa_models  # noqa
from neutron.services.trunk import models as trunk_models  # noqa


utils.import_modules_recursively(os.path.dirname(models.__file__))


def get_metadata():
    return model_base.BASEV2.metadata
Esempio n. 8
0
from neutron.db import l3_hamode_db  # noqa
from neutron.db.metering import metering_db  # noqa
from neutron.db import model_base
from neutron.db import models
from neutron.db import models_v2  # noqa
from neutron.db.port_security import models as ps_models  # noqa
from neutron.db import portbindings_db  # noqa
from neutron.db import provisioning_blocks  # noqa
from neutron.db.qos import models as qos_models  # noqa
from neutron.db.quota import models as quota_models  # noqa
from neutron.db import rbac_db_models  # noqa
from neutron.db import segments_db  # noqa
from neutron.db import servicetype_db  # noqa
from neutron.db import tag_db  # noqa
from neutron.ipam.drivers.neutrondb_ipam import db_models  # noqa
from neutron.plugins.ml2.drivers import type_flat  # noqa
from neutron.plugins.ml2.drivers import type_geneve  # noqa
from neutron.plugins.ml2.drivers import type_vlan  # noqa
from neutron.plugins.ml2.drivers import type_vxlan  # noqa
from neutron.plugins.ml2 import models as ml2_models  # noqa
from neutron.services.auto_allocate import models as aa_models  # noqa
from neutron.services.segments import db  # noqa
from neutron.services.trunk import models as trunk_models  # noqa


utils.import_modules_recursively(os.path.dirname(models.__file__))


def get_metadata():
    return model_base.BASEV2.metadata
Esempio n. 9
0
def register_objects():
    # local import to avoid circular import failure
    # pylint: disable=import-outside-toplevel
    from neutron.common import utils
    dirn = os.path.dirname(sys.modules[__name__].__file__)
    utils.import_modules_recursively(dirn)
Esempio n. 10
0
def register_objects():
    # local import to avoid circular import failure
    from neutron.common import utils
    dirn = os.path.dirname(sys.modules[__name__].__file__)
    utils.import_modules_recursively(dirn)