Пример #1
0
    def _misc(self):
        uninstall_files = []
        self.environment[
            osetupcons.CoreEnv.REGISTER_UNINSTALL_GROUPS
        ].addFiles(
            group='ovirt_dwh_files',
            fileList=uninstall_files,
        )
        self.environment[otopicons.CoreEnv.MAIN_TRANSACTION].append(
            filetransaction.FileTransaction(
                name=(
                    odwhcons.FileLocations.
                    OVIRT_ENGINE_DWHD_SERVICE_CONFIG_UUID
                ),
                content='DWH_UUID={uuid}\n'.format(
                    uuid=self.environment[odwhcons.CoreEnv.UUID],
                ),
                modifiedList=uninstall_files,
            )
        )

        engine_db_timekeeping.updateValueInTimekeeping(
            statement=self.environment[oenginecons.EngineDBEnv.STATEMENT],
            name=engine_db_timekeeping.DB_KEY_HOSTNAME,
            value=self.environment[osetupcons.ConfigEnv.FQDN]
        )
        engine_db_timekeeping.updateValueInTimekeeping(
            statement=self.environment[oenginecons.EngineDBEnv.STATEMENT],
            name=engine_db_timekeeping.DB_KEY_UUID,
            value=self.environment[odwhcons.CoreEnv.UUID]
        )
Пример #2
0
 def _misc(self):
     try:
         statement = self.environment[odwhcons.EngineDBEnv.STATEMENT]
         db_dwh_uuid = engine_db_timekeeping.getValueFromTimekeeping(
             statement=statement,
             name=engine_db_timekeeping.DB_KEY_UUID
         )
         if self.environment[odwhcons.CoreEnv.UUID] != db_dwh_uuid:
             self.logger.debug('_ is %s' % _)
             self.logger.warning(
                 _(
                     'Not updating engine database to disconnect from dwh '
                     '- seems like a different dwh was already setup for it'
                 )
             )
         else:
             engine_db_timekeeping.updateValueInTimekeeping(
                 statement=statement,
                 name=engine_db_timekeeping.DB_KEY_HOSTNAME,
                 value=''
             )
             engine_db_timekeeping.updateValueInTimekeeping(
                 statement=statement,
                 name=engine_db_timekeeping.DB_KEY_UUID,
                 value=''
             )
     except Exception as e:
         self.logger.debug('exception', exc_info=True)
         self.logger.warning(
             _(
                 'Cannot update Engine database: {error}'
             ).format(
                 error=e,
             )
         )
Пример #3
0
 def _misc(self):
     try:
         statement = self.environment[odwhcons.EngineDBEnv.STATEMENT]
         db_dwh_uuid = engine_db_timekeeping.getValueFromTimekeeping(
             statement=statement, name=engine_db_timekeeping.DB_KEY_UUID)
         if self.environment[odwhcons.CoreEnv.UUID] != db_dwh_uuid:
             self.logger.debug('_ is %s' % _)
             self.logger.warning(
                 _('Not updating engine database to disconnect from dwh '
                   '- seems like a different dwh was already setup for it'))
         else:
             engine_db_timekeeping.updateValueInTimekeeping(
                 statement=statement,
                 name=engine_db_timekeeping.DB_KEY_HOSTNAME,
                 value='')
             engine_db_timekeeping.updateValueInTimekeeping(
                 statement=statement,
                 name=engine_db_timekeeping.DB_KEY_UUID,
                 value='')
     except Exception as e:
         self.logger.debug('exception', exc_info=True)
         self.logger.warning(
             _('Cannot update Engine database: {error}').format(error=e, ))
Пример #4
0
 def _misc(self):
     engine_db_timekeeping.updateValueInTimekeeping(
         statement=self.environment[oenginecons.EngineDBEnv.STATEMENT],
         name=engine_db_timekeeping.DB_KEY_HOSTNAME,
         value=self.environment[osetupcons.RenameEnv.FQDN]
     )