diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2015-01-14 23:35:22 +0100 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2015-01-16 04:55:00 +0100 |
commit | 7d6032e82ea26baf82c64435925d6991d812e768 (patch) | |
tree | a05dff1ea4422759445783569b7fd6f4e0d3b54c /src/lib/Bcfg2/Server/Plugins/Packages/Yum.py | |
parent | 4609569ec9a7b9ea083c5546fa38ef401bba5fa8 (diff) | |
download | bcfg2-7d6032e82ea26baf82c64435925d6991d812e768.tar.gz bcfg2-7d6032e82ea26baf82c64435925d6991d812e768.tar.bz2 bcfg2-7d6032e82ea26baf82c64435925d6991d812e768.zip |
Plugins/Packages: fix initialization of YumSource
During __init__ of the parent class get_repo_name is called. That needs
fields (pump_id) that are defined later in the __init__ of YumSource.
We introduce the new function _init_attributes to parse all attributes
out of the <Source> tag before calling any other functions.
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins/Packages/Yum.py')
-rw-r--r-- | src/lib/Bcfg2/Server/Plugins/Packages/Yum.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py b/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py index 6139a28b5..ae8ac5d6f 100644 --- a/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py +++ b/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py @@ -1028,8 +1028,9 @@ class YumSource(Source): #: YumSource sets the ``type`` on Package entries to "yum" ptype = 'yum' - def __init__(self, basepath, xsource, setup): - Source.__init__(self, basepath, xsource, setup) + def _init_attributes(self, basepath, xsource, setup): + Source._init_attributes(self, basepath, xsource, setup) + self.pulp_id = None if HAS_PULP and xsource.get("pulp_id"): self.pulp_id = xsource.get("pulp_id") @@ -1071,7 +1072,7 @@ class YumSource(Source): self.needed_paths = set() self.file_to_arch = dict() self.yumgroups = dict() - __init__.__doc__ = Source.__init__.__doc__ + _init_attributes.__doc__ = Source._init_attributes.__doc__ @property def use_yum(self): |