
"""Base class for classes that need modular database access."""

from oslo.config import cfg

from nova.openstack.common import importutils

db_driver_opt = cfg.StrOpt('db_driver',
                           default='nova.db',
                           help='The driver to use for database access')

CONF = cfg.CONF
CONF.register_opt(db_driver_opt)


class Base(object):
    """DB driver is injected in the init method."""

    def __init__(self, db_driver=None):
        if not db_driver:
            db_driver = CONF.db_driver
        self.db = importutils.import_module(db_driver)  # pylint: disable=C0103


"""Base class for classes that need modular database access."""

from oslo.config import cfg

from nova.openstack.common import importutils

db_driver_opt = cfg.StrOpt('db_driver',
                           default='nova.db',
                           help='The driver to use for database access')

CONF = cfg.CONF
CONF.register_opt(db_driver_opt)


class Base(object):
    """DB driver is injected in the init method."""

    def __init__(self, db_driver=None):
        super(Base, self).__init__()
        if not db_driver:
            db_driver = CONF.db_driver
        self.db = importutils.import_module(db_driver)  # pylint: disable=C0103

Add super call to db Base class
Add super call to db Base class

Without this call, multiple inheritance involving the db Base
class does not work correctly.

Change-Id: Iac6b99d34f00babb8b66fede4977bf75f0ed61d4

  
  """Base class for classes that need modular database access."""
  
  from oslo.config import cfg
  
  from nova.openstack.common import importutils
  
  db_driver_opt = cfg.StrOpt('db_driver',
                             default='nova.db',
                             help='The driver to use for database access')
  
  CONF = cfg.CONF
  CONF.register_opt(db_driver_opt)
  
  
  class Base(object):
      """DB driver is injected in the init method."""
  
      def __init__(self, db_driver=None):
+         super(Base, self).__init__()
          if not db_driver:
              db_driver = CONF.db_driver
          self.db = importutils.import_module(db_driver)  # pylint: disable=C0103
  
Add super call to db Base class
## Code Before:

"""Base class for classes that need modular database access."""

from oslo.config import cfg

from nova.openstack.common import importutils

db_driver_opt = cfg.StrOpt('db_driver',
                           default='nova.db',
                           help='The driver to use for database access')

CONF = cfg.CONF
CONF.register_opt(db_driver_opt)


class Base(object):
    """DB driver is injected in the init method."""

    def __init__(self, db_driver=None):
        if not db_driver:
            db_driver = CONF.db_driver
        self.db = importutils.import_module(db_driver)  # pylint: disable=C0103

## Instruction:
Add super call to db Base class
## Code After:

"""Base class for classes that need modular database access."""

from oslo.config import cfg

from nova.openstack.common import importutils

db_driver_opt = cfg.StrOpt('db_driver',
                           default='nova.db',
                           help='The driver to use for database access')

CONF = cfg.CONF
CONF.register_opt(db_driver_opt)


class Base(object):
    """DB driver is injected in the init method."""

    def __init__(self, db_driver=None):
        super(Base, self).__init__()
        if not db_driver:
            db_driver = CONF.db_driver
        self.db = importutils.import_module(db_driver)  # pylint: disable=C0103
