diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2013-03-25 11:19:11 -0400 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2013-03-25 11:19:11 -0400 |
commit | 432f448983ff27452d82d62314d91c942f31bce5 (patch) | |
tree | f7f0aeb5f20e928306a37407857afe822713f5cb /src/lib/Bcfg2/Server/Plugins/Packages/PackagesSources.py | |
parent | fe7a3e9c7a7d66cccbd825465cefcf88165a0c3a (diff) | |
download | bcfg2-432f448983ff27452d82d62314d91c942f31bce5.tar.gz bcfg2-432f448983ff27452d82d62314d91c942f31bce5.tar.bz2 bcfg2-432f448983ff27452d82d62314d91c942f31bce5.zip |
Packages: properly implemented deepcopy() for PackagesSources objects
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins/Packages/PackagesSources.py')
-rw-r--r-- | src/lib/Bcfg2/Server/Plugins/Packages/PackagesSources.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Packages/PackagesSources.py b/src/lib/Bcfg2/Server/Plugins/Packages/PackagesSources.py index 2735e389a..3069e4068 100644 --- a/src/lib/Bcfg2/Server/Plugins/Packages/PackagesSources.py +++ b/src/lib/Bcfg2/Server/Plugins/Packages/PackagesSources.py @@ -8,13 +8,17 @@ from Bcfg2.Server.Plugins.Packages.Source import SourceInitError class PackagesSources(Bcfg2.Server.Plugin.StructFile, - Bcfg2.Server.Plugin.Debuggable): + Bcfg2.Server.Plugin.Debuggable, + Bcfg2.Server.Plugin.DeepcopyMixin): """ PackagesSources handles parsing of the :mod:`Bcfg2.Server.Plugins.Packages` ``sources.xml`` file, and the creation of the appropriate :class:`Bcfg2.Server.Plugins.Packages.Source.Source` object for each ``Source`` tag. """ + _deepcopy_exclude = Bcfg2.Server.Plugin.DeepcopyMixin._deepcopy_exclude + \ + ['pkg_obj'] + __identifier__ = None def __init__(self, filename, cachepath, fam, packages, setup): @@ -39,6 +43,7 @@ class PackagesSources(Bcfg2.Server.Plugin.StructFile, If ``sources.xml`` cannot be read """ Bcfg2.Server.Plugin.Debuggable.__init__(self) + Bcfg2.Server.Plugin.DeepcopyMixin.__init__(self) try: Bcfg2.Server.Plugin.StructFile.__init__(self, filename, fam=fam, should_monitor=True) @@ -129,7 +134,7 @@ class PackagesSources(Bcfg2.Server.Plugin.StructFile, """ Create a :class:`Bcfg2.Server.Plugins.Packages.Source.Source` subclass object from XML representation of a source in ``sources.xml``. - ``source_from-xml`` determines the appropriate subclass of + ``source_from_xml`` determines the appropriate subclass of ``Source`` to instantiate according to the ``type`` attribute of the ``Source`` tag. @@ -176,3 +181,6 @@ class PackagesSources(Bcfg2.Server.Plugin.StructFile, def __len__(self): return len(self.entries) + + def _deepcopy_constructor_args(self): + return (self.name, self.cachepath, None, None, dict(self.setup)) |