1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-12-02 12:23:47 +03:00
Commit Graph

1060 Commits

Author SHA1 Message Date
Daniel P. Berrangé
1a25fc35b6 gitlab: rename centos-stream to centos-stream-8
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-05-25 11:03:49 +01:00
Daniel P. Berrangé
418409301f gitlab: drop Fedora 32 container and build
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-05-25 11:02:42 +01:00
Daniel P. Berrangé
333af99d7d gitlab: drop centos-7 container and build
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-05-25 11:01:53 +01:00
Michal Privoznik
f234192eb0 generator.py: Untangle virNodeDevice name fixup
The way that virNodeDevice method name fixup is written makes it
hard to find via grep (matching the virNodeDevice prefix and then
matching only the operation like "Get", "Lookup", ...). Expand
the string matching to match the pattern of other cases.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
v7.3.0
2021-04-15 13:12:53 +02:00
Michal Privoznik
6851c5c8df generator.py: Fix method names for new virNodeDevice*() APIs
In the 7.3.0 release we are going to have three new public APIs:

  virNodeDeviceDefineXML()
  virNodeDeviceUndefine()
  virNodeDeviceCreate()

The first one is slightly problematic, because it takes
virConnectPtr argument and thus our generator wants to put its
wrapper under virConnect python class, which is correct, but
what's incorrect is the name it chooses for the method:
defineXML(). Such method already exists and wraps
virDomainDefineXML() around. Also, the name is rather confusing
anyway - it's missing the 'nodeDevice' prefix.

Fortunately, the fix is easy - add another case into nameFixup().

The story with virNodeDeviceCreate() is similar. Except, this time
the class in which the method was put is correct. But the name is
still wrong, because our generator matched 'virNodeDeviceCreate'
thinking it's the good old virNodeDeviceCreateXML() API and
"fixed" the name of the method to nodeDeviceCreate().

Luckily, virNodeDeviceUndefine() is just fine.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2021-04-15 13:12:29 +02:00
Ján Tomko
80ed19052f spec: use pytest instead of nose
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2021-04-12 17:39:22 +00:00
Daniel P. Berrangé
220818affc rpm: use HTTPS for URLs
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-04-12 18:12:48 +01:00
Daniel P. Berrangé
38bb83e914 Don't run sanity checks by default
The sanity check scripts verify that the binding covers all APIs in the
libvirt library/headers being built against. This is primarily there for
libvirt maintainers to identify when there are gaps in API coverage.

This is not something downstream consumers of libvirt-python should be
running themselves, so we shouldn't added it to tests by default.

In addition if people are working on branches or submitting merge
requests for python changes, we shouldn't block their work for failed
API coverage sanity tests, if the python binding otherwise builds fine
and passes regular unit tests.

Thus, we introduce a new gitlab job "api-coverage" with some conditions:

 - If pushing to a branch, the job is treated as non-fatal
 - For regular scheduled builds, it is mandatory
 - Don't run in any other scenarios

This job uses the artifacts from the centos-8-git-build job and re-runs
the test suite, requesting the sanity tests to be run too.

This will achieve the result of letting us see missing API coverage
in nightly builds, without blocking other contributions.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-04-09 16:40:42 +01:00
Ján Tomko
32a925a6d0 tests: use assertEqual instead of assertEquals
tests/test_conn.py:17: DeprecationWarning: Please use assertEqual instead.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
2021-04-07 17:10:36 +02:00
Ján Tomko
fa69ccf212 ci: refresh containers for nose->pytest switch
Matches libvirt-ci commit facd5d855c97bf5b127ff9bf245c8fdf514dd916

Signed-off-by: Ján Tomko <jtomko@redhat.com>
2021-04-07 17:10:36 +02:00
Ján Tomko
a376a2abb0 setup: use pytest instead of nose to run the test suite
The software we use for running tests - nose - has been
deprecated in favor of nose2.

We don't use anything nose-specific, just unittest.TestCase,
which pytest can handle just fine.

Switch to using pytest, which we already use for libvirt-dbus.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
2021-04-07 17:09:54 +02:00
Ján Tomko
98b9db087f setup: drop have_libvirtaio
This function says we have libvirtaio on Python >= 3.3,
however we already mandate Python >= 3.5 at the start of the file.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
2021-04-07 16:25:45 +02:00
Andrea Bolognani
ce6d4369ba ci: Move dco job to sanity_checks stage
If the DCO check fails we still want the pipeline to fail, but
that doesn't mean there's no value in running the other jobs to
get a better picture.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2021-04-07 13:56:24 +02:00
Andrea Bolognani
3a9f2eacf2 ci: Use 'extends' GitLab CI feature
This is the recommended way to use templates in job
definitions.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2021-04-07 13:56:24 +02:00
Ján Tomko
bded4a72c8 ci: drop openSUSE leap 15.1 in favor of 15.2
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2021-04-06 20:29:08 +02:00
Ján Tomko
8e1398f31f ci: refresh dockerfiles
Refresh to match libvirt-ci commit 94c25bde639eb31ff2071fb6abfd3d5c777f4ab2

Signed-off-by: Ján Tomko <jtomko@redhat.com>
2021-04-06 20:28:14 +02:00
Jiri Denemark
5e96c84a37 Post-release version bump to 7.3.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2021-04-01 12:22:45 +02:00
Jiri Denemark
7e75a36b06 Post-release version bump to 7.2.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
v7.2.0
2021-03-01 11:59:46 +01:00
renlei4
fd069ac85c Fix wrong type for BlockThreshold Callback
type of threshold and excess are unsigned long long,
but PyObject_CallMethod incorrectly set it to int.

if threshold or excess greater than 0x7FFFFFFF(max int),
those variables will overflow.

Signed-off-by: Ren Lei <ren.lei4@zte.com.cn>
v7.1.0
2021-03-01 16:51:40 +08:00
Daniel P. Berrangé
75c053e49e Add impl override for virDomainGetMessages
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-15 16:02:21 +00:00
Beraldo Leal
ac2647f958 improving readme with requirements
When installing this library in a fresh system, some basic packages are
necessary to compile and run. This patch will add basic instructions
with some requirements to help new contributors and users.

Signed-off-by: Beraldo Leal <bleal@redhat.com>
2021-02-09 10:35:52 -03:00
Jiri Denemark
53065adece Post-release version bump to 7.1.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2021-01-15 09:54:11 +01:00
Daniel P. Berrangé
d2dff0b775 ci: refresh containers for CentOS-8 PowerTools repo rename
A recent CentOS-8 update renamed the "PowerTools" repo to "powertools"
and since dnf is case sensitive wrt repo names, this broke ability to
build new containers.

The refresh fixes the repo name and pulls in other misc improvements
to containers.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
v7.0.0
2020-12-15 10:44:30 +00:00
Daniel P. Berrangé
9b942039ca Avoid signed/unsigned warnings in loop over SSH keys
libvirt-override.c: In function ‘libvirt_virDomainAuthorizedSSHKeysGet’:
libvirt-override.c:10455:19: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare]
10455 |     for (i = 0; i < nkeys; i++)
      |                   ^

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-12-03 11:57:25 +00:00
Daniel P. Berrangé
0b10d9cba8 gitlab: replace "libvirt-" prefix with "ci-" in dockerfiles
This makes the dockerfile name match the output container name

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-12-01 16:52:33 +00:00
Daniel P. Berrangé
d91aadf443 gitlab: refresh containers with lcitool for fully minimized base
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-12-01 16:52:33 +00:00
Daniel P. Berrangé
b37f39e4f7 gitlab: re-generate container images from lcitool
This introduces Fedora 33 and removes some redundant packages.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-12-01 16:52:31 +00:00
Daniel P. Berrangé
2110591acf gitlab: move dockerfiles into ci/containers sub-directory
This brings the repo into alignment with the main libvirt.git practice.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-12-01 16:17:35 +00:00
Jiri Denemark
f49e204c28 Post-release version bump to 7.0.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2020-12-01 09:55:41 +01:00
Erik Skultety
167276ae0e MANIFEST.in: Distribute MANIFEST.in in the source tarball
Follow the same procedure as we do with specfiles in the main library
where we distribute libvirt.spec.in along with the generated
libvirt.spec inside the tarball.

Fixes: https://gitlab.com/libvirt/libvirt-python/-/issues/5

Signed-off-by: Erik Skultety <eskultet@redhat.com>
v6.10.0
2020-11-27 19:09:15 +01:00
Michal Privoznik
767bf23ba6 Implement virDomainAuthorizedSSHKeys{Get,Set}
Both APIs work with string lists (the getter returns it, the
setter gets keys to set from it) -> represent that as a python
list. The rest is kept as is in C.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2020-11-19 18:12:33 +01:00
Daniel P. Berrangé
417b39049e Add support for memory failure event callbacks
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-11-12 14:51:56 +00:00
Daniel P. Berrangé
ae219e3480 Replace deprecated PyEval_CallObject with PyObject_Call
The former is deprecated since Python 3.9, and the latter has existed
for all 3.x and probably before.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-11-12 14:31:54 +00:00
Daniel P. Berrangé
fb2123c28b Pass -Werror when building extension
This ensures we pick up warnings from new python headers or other
problems.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-11-12 13:36:46 +00:00
Daniel P. Berrangé
991ecb5de8 Avoid truncating python version number when running sanity test
The current code assumes the version number string will be only three
characters long, which fails with "3.10".

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-11-12 13:34:14 +00:00
Daniel P. Berrangé
2035a5e2f1 Avoid use of thread function deprecated in 3.9
PyEval_ThreadsInitialized was deprecated in 3.9, with deletion targetted
for 3.11. Furthermore since 3.7 it is guaranteed that threads are always
initialized by Py_Initialize(), so checking it is redundant.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-11-12 13:30:23 +00:00
Daniel P. Berrangé
4a6f381bd9 Add unit tests for openAuth method
Validate that the type hinting is working as expected

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-11-06 10:35:05 +00:00
Jiri Denemark
2822e23156 Post-release version bump to 6.10.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2020-11-02 11:19:00 +01:00
Daniel P. Berrangé
3a4d51e266 gitlab: optimize CI job dependencies
Allow more parallelization by giving explicit dependencies between jobs.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
v6.9.0
2020-10-06 12:34:38 +00:00
Daniel P. Berrangé
1f44167510 tests: start basic unit tests for more APIs
To prevent regressions, especially with generated code, we need to have
test coverage of more APIs. This starts off with coverage for object
creation for all object types supported by the test driver
currently. This exercises constructors which have been broken several
times in the past.

Related https://gitlab.com/libvirt/libvirt-python/-/issues/4
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-10-06 12:25:14 +01:00
Daniel P. Berrangé
613411502d fix constructor param name for virDomainSnapshot / virDomainCheckpoint
Fixes 7f021c21d6
Resolves https://gitlab.com/libvirt/libvirt-python/-/issues/4

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-10-06 11:15:48 +01:00
Jiri Denemark
379a65bd68 Post-release version bump to 6.9.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2020-10-01 09:54:11 +02:00
Philipp Hahn
22bfd4bcab generator: Work around type change
a variable should not change its type.

Signed-off-by: Philipp Hahn <hahn@univention.de>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
v6.8.0
2020-09-01 13:26:01 +00:00
Philipp Hahn
d30d872251 generator: Add PEP 484 type annotations
Signed-off-by: Philipp Hahn <hahn@univention.de>
2020-09-01 13:26:01 +00:00
Philipp Hahn
62d99b6dad generator: Merge common code of print_function_wrapper
Signed-off-by: Philipp Hahn <hahn@univention.de>
2020-09-01 13:26:01 +00:00
Philipp Hahn
7f021c21d6 generator: Merge code for __init__ genration
Signed-off-by: Philipp Hahn <hahn@univention.de>
2020-09-01 13:26:01 +00:00
Philipp Hahn
5a2c12278a generator: Expand tuple to names in for loop
Assign tuple to multiple loop variables for better readability

Signed-off-by: Philipp Hahn <hahn@univention.de>
2020-09-01 13:26:01 +00:00
Philipp Hahn
f87eba2fee generator: break lines in generated code
to be closes to pep8 which makes reading the generated code easier and
reduces the number of issues found by flake8.

Signed-off-by: Philipp Hahn <hahn@univention.de>
2020-09-01 13:26:01 +00:00
Philipp Hahn
f7bd89c0bd generator: Use empty string instead of None
for better type checking: both are bool()==False, but None is not str.

Signed-off-by: Philipp Hahn <hahn@univention.de>
2020-09-01 13:26:01 +00:00
Philipp Hahn
4df8e83808 generator: Convert to defaultdict()
for nested dictionaries allows to remove the case distinction for
"first" from "all other" cases.

Signed-off-by: Philipp Hahn <hahn@univention.de>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2020-09-01 13:26:01 +00:00