class DbMigration(object): """ This class represents the workflow step for migrating the database """ def __init__(self, step, config): self.__log = logging.getLogger(DbMigration.__name__) self.__step = step self.__config = config self.__replicator = DbReplicator(self.__config, '- [step %d] ' % self.__step) def execute(self): self.__log.info('- [step %d] performing %s backup and restore ...' % (self.__step, 'full' if self.__config[Constants['DB_MIGRATION_FULL']] else 'differential')) self.__replicator.execute() self.__log.info('- [step %d] backup and restore completed' % self.__step) def done(self): pass
def __init__(self, step, config): self.__log = logging.getLogger(DbMigration.__name__) self.__step = step self.__config = config self.__replicator = DbReplicator(self.__config, '- [step %d] ' % self.__step)