Package Ganga :: Package Core :: Package JobRepository :: Module GangaObjectMigration
[hide private]
[frames] | no frames]

Module GangaObjectMigration

source code

This module has to be used to migrate older versions of GangaObjects (plugins) manually or within a script. It is not suitable for repository migration when its internals change. IMPORTANT: Once migrated the plugins may not be backward compatible.

Functions [hide private]
 
migrateGangaObjects(repository, migration_control=None)
This function transforms older versions of GangaObjects to the current versions.
source code
Variables [hide private]
  logger = Ganga.Utility.logging.getLogger()
  _migrate_at_once = 100
  __package__ = 'Ganga.Core.JobRepository'
Function Details [hide private]

migrateGangaObjects(repository, migration_control=None)

source code 

This function transforms older versions of GangaObjects to the current versions. The migration is made in place over repository, i.e. it does not affect the job registry. Therefore the job registry has to be rescanned after the migration. One may use jobs._impl._scan_repository() to do so. Only completely converted jobs will be migrated. No jobs in "incomplete" state will be saved in the repository. IMPORTANT: Once migrated the plugins may not be backward compatible. Arguments: repository - current job repository (can be accessed as jobs._impl._repository) migration_control - migration control object that allows/denies migration of particular plugins (an instance of MigrationControl class) If this argument is ommitted the migration will require interactive input.

Example of usage within a script: from Ganga.GPIDev.Streamers.MigrationControl import MigrationControl migration_control = MigrationControl() migration_control.allow() #allows migration of all possible plugins migrateGangaObjects(jobs._impl.repository, migration_control) jobs._impl._scan_repository()