def export_auth(vcstype, authtype): #try: vcs_plugin = fimport("submin.plugins.vcs.%s.%s" % (vcstype, "export"), "submin.plugins.vcs.%s" % vcstype) #except ImportError as e: # raise VCSException(e) vcs_plugin.export_auth(authtype)
def get(model): """Gets the storage-module for a certain model.""" try: storage = fimport("submin.plugins.storage.%s.%s" % (settings.storage, model), "submin.plugins.storage.%s" % settings.storage) except SettingsException as e: raise StorageError(str(e)) return storage
def get(vcstype, model): """Gets the vcs-plugin for a certain type and model.""" try: vcs_plugin = fimport("submin.plugins.vcs.%s.%s" % (vcstype, model), "submin.plugins.vcs.%s" % vcstype) except ImportError as e: raise VCSException(e) return vcs_plugin
def get(model): """Gets the storage-module for a certain model.""" try: storage = fimport( "submin.plugins.storage.%s.%s" % (settings.storage, model), "submin.plugins.storage.%s" % settings.storage) except SettingsException as e: raise StorageError(str(e)) return storage
def open(pass_settings=None): """opens the storage: either opens a database connection or does other initialisation.""" global opened_module if pass_settings: setSettings(pass_settings) try: opened_module = fimport("submin.plugins.storage.%s" % settings.storage, "submin.plugins.storage") opened_module.open(settings) except SettingsException as e: raise StorageError(str(e))
def database_evolve(*args, **kwargs): """Calls database_evolve, this is usually only done when initialising the environment or a new storage is used, or if the code suggests there is a new version of the database, which is not reflected in the production database yet.""" # Calls plugins.storage.<storage>.database_evolve() try: storage_module = fimport("submin.plugins.storage.%s" % settings.storage, "submin.plugins.storage") storage_module.database_backup(settings) storage_module.database_evolve(*args, **kwargs) except SettingsException as e: raise StorageError(str(e))
def database_evolve(*args, **kwargs): """Calls database_evolve, this is usually only done when initialising the environment or a new storage is used, or if the code suggests there is a new version of the database, which is not reflected in the production database yet.""" # Calls plugins.storage.<storage>.database_evolve() try: storage_module = fimport( "submin.plugins.storage.%s" % settings.storage, "submin.plugins.storage") storage_module.database_backup(settings) storage_module.database_evolve(*args, **kwargs) except SettingsException as e: raise StorageError(str(e))
def database_isuptodate(): try: return fimport("submin.plugins.storage.%s" % settings.storage, "submin.plugins.storage").database_isuptodate() except SettingsException as e: raise StorageError(str(e))