Skip to content
This repository has been archived by the owner on Jul 13, 2021. It is now read-only.

Multiple ini files inside module #310

Open
MajoDurco opened this issue Sep 6, 2017 · 2 comments
Open

Multiple ini files inside module #310

MajoDurco opened this issue Sep 6, 2017 · 2 comments
Labels

Comments

@MajoDurco
Copy link
Collaborator

When PA generates group.xml file for each module it ussualy collects data only from module.ini. Problem is when in module are multiple ini files, then it generates wrong xml (with multiple roots elements).

Error looks like:

ExpatError: Encountered a parse error in file /tmp/preupgradeSOPbRF/FOOBAR6_7/failed/group.xml.
Details: junk after document element: line 51, column 0

From:

self.ret[self.dirname] = ElementTree.parse(xml_path).getroot()

@MajoDurco MajoDurco added the bug label Sep 6, 2017
@bocekm bocekm changed the title Multilpe ini files inside module Multiple ini files inside module Sep 13, 2017
@bocekm
Copy link
Collaborator

bocekm commented Sep 25, 2017

Per #281 (comment), this issue will be mitigated by PR #311 by that preupg-content-creator will not generate 2 INIs. However the thing that the Preupgrade Assistant crashes because preupg-xccdf-compose generates gibberish when it encounters multiple INIs, will still persist.

@pirat89
Copy link
Collaborator

pirat89 commented Sep 26, 2017

I still don't understand why multiple INIs should affect the preupg-xccdf-compose when it should look only for module.ini file in the module - peculiarly group.ini in case it is superior directory of the module. In case that module.ini occurs in directory everything else should be ignored, otherwise check whether the group.ini file exists. Optionally, when both the files exists inside same directore, the warning could be displayed.

The reason of this behaviour is the most probably instide the find_all_ini function, concretely here:

if dir_name.endswith(".ini"):

The variable dir_name actually contains name of file.

pirat89 added a commit that referenced this issue Feb 11, 2018
Previously building of module set has been corrupted when directory
with the module contained more than one file with the ".ini"
extentions. Build of the module set shouldn't be affected by various
INI files, that are not related to the module set structure.

So the scan is now read only group.ini and module.ini files whose
names are reserved for PA purposes. In addition we expect only one
of those files in each directory, so the ModuleSetFormatError
exception is raised when both are detected in the same directory.

Resolves #310
pirat89 added a commit that referenced this issue Feb 11, 2018
Previously building of module set has been corrupted when directory
with the module contained more than one file with the ".ini"
extentions. Build of the module set shouldn't be affected by various
INI files, that are not related to the module set structure.

So the scan is now read only group.ini and module.ini files whose
names are reserved for PA purposes. In addition we expect only one
of those files in each directory, so the ModuleSetFormatError
exception is raised when both are detected in the same directory.

- removed unused import of ModuleSetUtils

Resolves #310
pirat89 added a commit that referenced this issue Feb 11, 2018
Use settings.module_ini and settings.group_ini in tests.

Related #310
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants