
import weblab.configuration_doc as configuration_doc
import weblab.db.exc as DbErrors
import voodoo.configuration as CfgErrors

class AbstractDatabaseGateway(object):
    def __init__(self, cfg_manager):

        try:
            self.host          = cfg_manager.get_doc_value(configuration_doc.DB_HOST)
            self.database_name = cfg_manager.get_doc_value(configuration_doc.DB_DATABASE)
            self.engine_name   = cfg_manager.get_doc_value(configuration_doc.DB_ENGINE)
        except CfgErrors.KeyNotFoundError as knfe:
            raise DbErrors.DbMisconfiguredError(
                    "Configuration manager didn't provide values for at least one parameter: %s" % knfe,
                    knfe
                )



import weblab.configuration_doc as configuration_doc
import weblab.db.exc as DbErrors
import voodoo.configuration as CfgErrors

class AbstractDatabaseGateway(object):
    def __init__(self, cfg_manager):
        self.cfg_manager = cfg_manager
        try:
            self.host          = cfg_manager.get_doc_value(configuration_doc.DB_HOST)
            self.database_name = cfg_manager.get_doc_value(configuration_doc.DB_DATABASE)
            self.engine_name   = cfg_manager.get_doc_value(configuration_doc.DB_ENGINE)
        except CfgErrors.KeyNotFoundError as knfe:
            raise DbErrors.DbMisconfiguredError(
                    "Configuration manager didn't provide values for at least one parameter: %s" % knfe,
                    knfe
                )


Fix cfg_manager not existing in AbstractDatabaseGateway
Fix cfg_manager not existing in AbstractDatabaseGateway

  
  import weblab.configuration_doc as configuration_doc
  import weblab.db.exc as DbErrors
  import voodoo.configuration as CfgErrors
  
  class AbstractDatabaseGateway(object):
      def __init__(self, cfg_manager):
- 
+         self.cfg_manager = cfg_manager
          try:
              self.host          = cfg_manager.get_doc_value(configuration_doc.DB_HOST)
              self.database_name = cfg_manager.get_doc_value(configuration_doc.DB_DATABASE)
              self.engine_name   = cfg_manager.get_doc_value(configuration_doc.DB_ENGINE)
          except CfgErrors.KeyNotFoundError as knfe:
              raise DbErrors.DbMisconfiguredError(
                      "Configuration manager didn't provide values for at least one parameter: %s" % knfe,
                      knfe
                  )
  
  
Fix cfg_manager not existing in AbstractDatabaseGateway
## Code Before:

import weblab.configuration_doc as configuration_doc
import weblab.db.exc as DbErrors
import voodoo.configuration as CfgErrors

class AbstractDatabaseGateway(object):
    def __init__(self, cfg_manager):

        try:
            self.host          = cfg_manager.get_doc_value(configuration_doc.DB_HOST)
            self.database_name = cfg_manager.get_doc_value(configuration_doc.DB_DATABASE)
            self.engine_name   = cfg_manager.get_doc_value(configuration_doc.DB_ENGINE)
        except CfgErrors.KeyNotFoundError as knfe:
            raise DbErrors.DbMisconfiguredError(
                    "Configuration manager didn't provide values for at least one parameter: %s" % knfe,
                    knfe
                )


## Instruction:
Fix cfg_manager not existing in AbstractDatabaseGateway
## Code After:

import weblab.configuration_doc as configuration_doc
import weblab.db.exc as DbErrors
import voodoo.configuration as CfgErrors

class AbstractDatabaseGateway(object):
    def __init__(self, cfg_manager):
        self.cfg_manager = cfg_manager
        try:
            self.host          = cfg_manager.get_doc_value(configuration_doc.DB_HOST)
            self.database_name = cfg_manager.get_doc_value(configuration_doc.DB_DATABASE)
            self.engine_name   = cfg_manager.get_doc_value(configuration_doc.DB_ENGINE)
        except CfgErrors.KeyNotFoundError as knfe:
            raise DbErrors.DbMisconfiguredError(
                    "Configuration manager didn't provide values for at least one parameter: %s" % knfe,
                    knfe
                )

