diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-10-18 11:33:38 -0400 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-10-30 09:11:53 -0400 |
commit | 63a5b62dba190007634e1e0f2f834057b63aeafd (patch) | |
tree | beb6d51675d43fe8303aff62a3c9272e82e67520 /src/lib/Bcfg2/Server/Plugin/interfaces.py | |
parent | 7b9987d1835ff422e21f0b2f36c93d956192bf4b (diff) | |
download | bcfg2-63a5b62dba190007634e1e0f2f834057b63aeafd.tar.gz bcfg2-63a5b62dba190007634e1e0f2f834057b63aeafd.tar.bz2 bcfg2-63a5b62dba190007634e1e0f2f834057b63aeafd.zip |
added Git.Update RMI, ability to base bcfg2 VCS repo at a different directory than the repo root
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugin/interfaces.py')
-rw-r--r-- | src/lib/Bcfg2/Server/Plugin/interfaces.py | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/src/lib/Bcfg2/Server/Plugin/interfaces.py b/src/lib/Bcfg2/Server/Plugin/interfaces.py index 894165858..cba3e8145 100644 --- a/src/lib/Bcfg2/Server/Plugin/interfaces.py +++ b/src/lib/Bcfg2/Server/Plugin/interfaces.py @@ -506,7 +506,7 @@ class GoalValidator(object): raise NotImplementedError -class Version(object): +class Version(Plugin): """ Version plugins interact with various version control systems. """ #: The path to the VCS metadata file or directory, relative to the @@ -514,26 +514,23 @@ class Version(object): #: be ".svn" __vcs_metadata_path__ = None - def __init__(self, datastore): - """ - :param datastore: The path to the Bcfg2 repository on the - filesystem - :type datastore: string - :raises: :class:`Bcfg2.Server.Plugin.exceptions.PluginInitError` - - .. autoattribute:: __vcs_metadata_path__ - """ + def __init__(self, core, datastore): + Plugin.__init__(self, core, datastore) - self.datastore = datastore if self.__vcs_metadata_path__: - self.vcs_path = os.path.join(datastore, self.__vcs_metadata_path__) - - if os.path.exists(self.vcs_path): - self.get_revision() + if core.setup['vcs_root']: + self.vcs_root = core.setup['vcs_root'] else: + self.vcs_root = datastore + self.vcs_path = os.path.join(self.vcs_root, + self.__vcs_metadata_path__) + + if not os.path.exists(self.vcs_path): raise PluginInitError("%s is not present" % self.vcs_path) else: self.vcs_path = None + __init__.__doc__ = Plugin.__init__.__doc__ + """ +.. autoattribute:: __vcs_metadata_path__ """ def get_revision(self): """ Return the current revision of the Bcfg2 specification. |