Example #1
0
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)
Example #2
0
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)
Example #3
0
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
Example #4
0
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
Example #5
0
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
Example #6
0
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
Example #7
0
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))
Example #8
0
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))
Example #9
0
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))
Example #10
0
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))
Example #11
0
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))
Example #12
0
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))