diff options
-rw-r--r-- | .zuul.yaml | 19 | ||||
-rw-r--r-- | pyeclib/ec_iface.py | 4 | ||||
-rw-r--r-- | src/c/pyeclib_c/pyeclib_c.c | 5 |
3 files changed, 25 insertions, 3 deletions
@@ -1,6 +1,7 @@ - project: templates: - openstack-python-jobs + - libec-pyeclib-jobs-arm64 check: jobs: - openstack-tox-py35 @@ -62,3 +63,21 @@ timeout: 1800 vars: tox_envlist: py39-compilelibs + +- job: + name: libec-pyeclib-unit-arm64 + parent: libec-pyeclib-unit + nodeset: ubuntu-focal-arm64 + description: | + Run unit tests for an OpenStack Python project under cPython + version 3.9 on top of arm64 architecture. + +- project-template: + name: libec-pyeclib-jobs-arm64 + description: | + Runs pyeclib unit tests designated for testing on top of + ARM64 architecture + check-arm64: + jobs: + - libec-pyeclib-unit-arm64: + voting: false diff --git a/pyeclib/ec_iface.py b/pyeclib/ec_iface.py index c7dfcac..bd69861 100644 --- a/pyeclib/ec_iface.py +++ b/pyeclib/ec_iface.py @@ -312,7 +312,7 @@ class ECDriver(object): available_fragment_payloads, missing_fragment_indexes) def fragments_needed(self, reconstruction_indexes, - exclude_indexes=[]): + exclude_indexes=None): """ Determine which fragments are needed to reconstruct some subset of missing fragments. @@ -329,6 +329,8 @@ class ECDriver(object): :raises: ECDriverError if there is an error during decoding or there are not sufficient fragments to decode """ + if exclude_indexes is None: + exclude_indexes = [] return self.ec_lib_reference.fragments_needed(reconstruction_indexes, exclude_indexes) diff --git a/src/c/pyeclib_c/pyeclib_c.c b/src/c/pyeclib_c/pyeclib_c.c index 4e2646c..1968b80 100644 --- a/src/c/pyeclib_c/pyeclib_c.c +++ b/src/c/pyeclib_c/pyeclib_c.c @@ -26,6 +26,7 @@ #include <stdio.h> #include <paths.h> +#define PY_SSIZE_T_CLEAN #include <Python.h> #include <math.h> #include <bytesobject.h> @@ -492,7 +493,7 @@ pyeclib_c_encode(PyObject *self, PyObject *args) char **encoded_parity = NULL; /* array of m parity buffers */ PyObject *list_of_strips = NULL; /* list of encoded strips to return */ char *data; /* param, data buffer to encode */ - int data_len; /* param, length of data buffer */ + Py_ssize_t data_len; /* param, length of data buffer */ uint64_t fragment_len; /* length, in bytes of the fragments */ int i; /* a counter */ int ret = 0; @@ -1040,7 +1041,7 @@ pyeclib_c_get_metadata(PyObject *self, PyObject *args) char *fragment = NULL; /* param, fragment from caller */ fragment_metadata_t c_fragment_metadata; /* structure to hold metadata */ PyObject *fragment_metadata = NULL; /* metadata object to return */ - int fragment_len; /* fragment length */ + Py_ssize_t fragment_len; /* fragment length */ int formatted; /* format the metadata in a dict */ int ret; |