Loading
Commits on Source 51
-
Convert a project name to a Project object using a text fixture, so that tests do not have to differentiate public and internal projects. Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
Instead of using global variables or singletons, make the tests use pytest fixtures. Module-level caching to avoid excessive test runtimes once singletons are removed, but the fixture are not defined in conftest.py so that this can be changed in specific test modules if desired. Sometimes, the objects are needed to list the test parameters, and therefore must be instantiated at collection time. In that case, the globals are named _NAME and the fixtures simply return them; however, for consistency and cleanliness the tests never ever access the globals themselves. Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
Config() is always created by Application and dies with it, so it need not be a singleton. This also removes the ugly test code to undo its "singleton"ness. Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
Prepare for making the Inventory not a singleton: add an inventory to each formatter and push the creation of the inventory up to the same code that creates the formatters. For now all formatters point to the same object, but this can be changed as soon as each user of formatters receives the Inventory object from its creator. Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
Prepare for making the Inventory not a singleton: add an inventory to the Manifest object and push the creation of the inventory up the same code that creates the manifest. For now all manifests point to the same object, but this can be changed as soon as each user of manifests receives the Inventory object from its creator. Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
Now that each user of Inventory receives the object from the caller, Inventory need not be a singleton anymore. Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
The method needs to access a lot of the internals of Projects, whch is a sign that it belongs there rather than in Project. Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
Make sure that it is possible for each Project to retrieve the "right" Projects object, by tracking them in an internal field. This requires removing @staticmethod from the loading methods. Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
Make the inventory represent the global state loaded from the facts/ directory and the data directory. All places that need an inventory *and* projects object already have the inventory, so it's easy to retrieve the projects object from there. For now all inventories point to the same object, but this can be changed as soon as each user of Inventory receives the Projects object from its creator. Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
There are no external references to Projects() anymore, so it need not be a singleton. Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
Application is created once by bin/lcitool, there is no need for it to be a singleton. Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
"x.projects" is not clearly saying that it is a collection of Project objects; it might be a Projects object instead, especially after singletons are removed. Clean up by renaming _projects to _public and _internal_projects to _internal, plus the corresponding rename of the properties. Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
The purpose of the Target object is to group together a target name and cross_arch pair, for use in both Projects and Formatter. Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
This removes an argument to Formatters.format(), and enables formatters to pass around a Target object instead of a mix of facts and cross_arch. Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
Remove the indirection of generator_prepare, since two of the three values it builds are available anyway in the Target object. Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
Remove redundant arguments by replacing cross_arch and facts with the target object. Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
Formatters do not use Inventory anymore, instead they retrieve the facts from a Target object. So they only need a Projects object at construction time. Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
Pass the target object instead of facts + cross_arch. Later on, the target object will also mediate between a new class to store the package mappings and Projects. Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
The target object can also be passed to CrossPackage, replacing cross_arch and the packaging format, which can both be retrieved from the target object. Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
Compute the keys in __init__ and the package name in _eval. Make the arguments of _eval the same for all subclasses, by pushing its invocation in Package.__init__. Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
The target information is passed to PackageFactory half at construction time and half at get_package time. Keep only the latter; the facts are only used to cache the mapping keys, but really it's just as simple to build the keys when needed. Alternatively, they could also be cached in the target object. Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
Instances of the class will shortly become long-lived, follow the naming used e.g. by the Projects class. Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
Extract the knowledge of package mappings out of Projects, so that it is entirely included within PackageFactory---now renamed Packages. This is now another long-lived object embedded in Inventory, like the instance of Projects. Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
Make it consistent with projects, targets and tests/test_packages.py. Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
Andrea Bolognani authored
No longer used by the project as of commit commit d907c69f1cb0ab40bce1f4c53e6560aaf9392961 Author: Michal Privoznik <mprivozn@redhat.com> Date: Wed Dec 7 12:43:29 2022 +0100 configure: Drop imagick Signed-off-by:Andrea Bolognani <abologna@redhat.com>
-
Erik Skultety authored
Recent changes introducing a new object Target broke Ansible executions as we started to index the group_vars dictionary with object IDs instead of target names. Fixes: be6a054f Signed-off-by:
Erik Skultety <eskultet@redhat.com>
-
Erik Skultety authored
Introduce a new target - Fedora 37. Signed-off-by: Erik Skultety
-
Erik Skultety authored
Signed-off-by:Erik Skultety <eskultet@redhat.com>
-
Erik Skultety authored
All related places were already replaced with Fedora 37, so we can now safely drop Fedora-35 as a target. Signed-off-by:Erik Skultety <eskultet@redhat.com>
-
Erik Skultety authored
In the comment we say that we erase everything except that we use '--none' with the 'clearpart' directive. It just so happens that this has always been a NOP since the default for VMs created by lcitool is to always create a new qcow2 disk. FWIW, use the right option so that the statement is actually correct. Signed-off-by:Erik Skultety <eskultet@redhat.com>
-
Erik Skultety authored
Starting Fedora 37, the default partition scheme is GPT instead of MBR which means a biosboot partition is now required. Ideally we'd want to convert all supported distro installations to GPT + LVM, however, for the time being, let's force the MBR scheme for RHEL-like distros while still keeping things consistent. Signed-off-by:Erik Skultety <eskultet@redhat.com>
-
Versioned package names can include the "<" or ">" characters, which need quoting. Take care of that when creating the commands in _align, as that already assumes shell syntax. Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
https://github.com/readthedocs/sphinx_rtd_theme/blob/master/setup.cfg shows that sphinx-rtd-theme does not want versions of docutils starting with 0.18. For distro-installed packages we can assume that the packager knew this, but when installing from PyPI the package version needs to be constrained by hand. In order to do this, add the docutils package explicitly to the qemu project file. If a target needs docutils from PyPI (which is never the case currently, but it happened to me while playing with CentOS 8's Python 3.8 packages), the output of lcitool will force the installation of docutils<0.18 instead of picking whatever release it wants and then failing: Step 3/9 : RUN /usr/bin/pip3.8 install meson==0.63.2 pillow sphinx sphinx-rtd-theme ... Collecting docutils<0.20,>=0.14 Downloading https://files.pythonhosted.org/packages/93/69/e391bd51bc08ed9141ecd899a0ddb61ab6465309f1eb470905c0c8868081/docutils-0.19-py3-none-any.whl (570kB) ... ERROR: sphinx-rtd-theme 1.1.1 has requirement docutils<0.18, but you'll have docutils 0.19 which is incompatible. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
With the introduction of a Targets class, using "Target" for the OS+arch pair becomes confusing. In the future "Target" could be used possibly for the object that Targets holds onto, similar to Project vs. Projects; right now it does not make much sense, because Target would be a glorified dict holding the facts with no other projects or methods. Still, avoid the confusion *now* by renaming the class to BuildTarget. Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
The relevant part of the Projects object has actually been extracted into Packages. Projects are completely independent of targets, and as such they can be constructed separately from the Inventory. Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
This is a generic function that can be used by more data files than just target facts, so move it to a common module. Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
Free that name for the instance of the Packages class. Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
Just store the target_facts[] element in the BuildTarget object. Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
As a first step in separating Targets from Inventory, make Targets just an alias of Inventory. All clients that do not care about the host facts are changed to use "targets" and "Targets" respectively as the variable and the class name. This makes little sense code-wise, but it makes it possible to separate the mechanical part of the change. Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
Make Inventory deal only with hosts for the Ansible functionality; target facts are stored in Targets, which now becomes a real class. This way, the complete lack of tests for Inventory() is clear. Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
Put all the common fixtures in tests/conftest.py (it is not possible to keep e.g. targets() in tests_targets.py and so on, because there are circular references between the test files). Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
This allows tests to use a custom path if the Config instance is monkeypatched. Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
This isolate the "white box" part of the test and allows some code reuse in the inventory tests. Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
Signed-off-by:Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
vars is a builtin that returns the __dict__ attribute of an object. Do not shadow it, instead rename the variable now that it has been split out of a function that already used "group_vars" for something else. Suggested-by:
Erik Skultety <eskultet@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>