The Debian packaging has been changed to reflect all the
git commits under the directory, and not just the commits
to the metadata folder.
This ensures that any new code submissions under those
directories will increment the versions.
Note:
nfv uses GITREVCOUNT because its src_path is 'None'
Test Plan:
PASS: build-iso and unlock AIO-SX
PASS: build-pkgs -p nfv
PASS: build-pkgs -p nova-api-proxy
PASS: commit a file change under nfv, and rebuild and
see that the nfv version has increased.
PASS: commit a file change one directory before nfv, and
rebuild and see that the nfv version has not increased.
Story: 2010550
Task: 47222
Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: I06804af6e356174b608b18219b1f1c8176c99375
Since the platform migration to Debian, it was observed that the
following Nova actions stopped working:
- pause;
- unpause;
- suspend;
- resume;
- live-migration.
The reason behind that is that some packages related to Nova, which have
already been migrated to Debian, still have some incompatibilities with
Python 3. Consequently, whenever these Nova actions were executed, some
exceptions occurred on the nova-api-proxy and NFV side, preventing them
from working.
Therefore, this change aims to improve this compatibility.
Most of the changes were necessary due to the fact that in Python 3
there is more of a distinction between `bytes` and `str`, whereas in
Python 2 `bytes` is just an alias for `str`.
Test Plan (on AIO-DX):
PASS - Successfully perform a VM pause, unpause, suspend, resume.
PASS - Successfully perform a VM live-migration.
Closes-Bug: 2003813
Signed-off-by: Luan Nunes Utimura <LuanNunes.Utimura@windriver.com>
Change-Id: I918fe6e3deaa68630c797449649012e9fbf16fe4
This change enables building the stx-nova-api-proxy image within the
Debian build framework. It is now based on stx-debian and following the
new convention for StarlingX images.
Test Plan:
PASS: Build stx-nova-api-proxy image
PASS: Manually upload built image to a system, use helm-override to
change the nova-api-proxy container image and apply stx-openstack
PASS: Ensure the nova-api-proxy pod successfully starts and is running
PASS: Ensure nova-api-proxy pod liveness and readiness probes are
healthy
Depends-On: https://review.opendev.org/c/starlingx/root/+/871314
Story: 2010072
Task: 47217
Signed-off-by: Luan Nunes Utimura <LuanNunes.Utimura@windriver.com>
Change-Id: I80e4a046e6ae89b1dae2f583fb14723713194e45
mock module has been deprecated in favor of unittest.mock
which is part of the standard python library.
This review removes mock as a third party dependency, and
updates all unittest imports to use unittest.mock instead.
nova-api-proxy had mock as a test requirement, however it
was not using it.
This change has no impact on runtime code.
Test Plan:
PASS: tox passing for nfv
PASS: build-pkgs -p nfv
PASS: tox passing for nova-api-proxy
PASS: build-pkgs -p nova-api-proxy
Story: 2010531
Task: 47142
Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: I991d07e87fbdc7fecc4e790550df2472b9b5b24b
tox changes:
- remove python2.7 and python3.6 unit test targets
from tox.ini since only python 3.9 is supported
- remove the (junk) functional target from tox.ini
- fix yamllint target in tox.ini so it will actually
process files. Also added a basic yammlint settings file.
- nova-api-proxy tox jobs are now setup for py39
- Removed the py27 limitations from requirements files.
- Removed the upper limits for pylint and astroid.
- Added additional suppressions for new pylint codes.
Zuul changes:
- remove py27 job from zuul
- remove the unused (never working) devstack job
- set the parent zuul jobs to be the jobs defined under
openstack-zuul-jobs rather than just zuul-jobs
- Specify debian-bullseye (python3.9) as the nodeset.
ubuntu-jammy iss python3.10, ubuntu-focal is python3.8
- override tox constraints file to use the STX constraints
This means starlingx/root needs to be a required project
- Removed the nodeset from the pep8 jobs.
Note: these changes do not affect runtime for NFV.
Test Plan:
Pass tox in nfv directory of (debian) dev env.
Pass tox in nova-api-proxy directory of (debian) dev env.
build-pkgs -p nfv
Story: 2010531
Task: 47146
Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: I6dad77bec40e9b64a9314b237270af046728efb3
This change will allow this repo to pass zuul now
that this has merged:
https://review.opendev.org/c/zuul/zuul-jobs/+/866943
Tox 4 deprecated whitelist_externals.
Replace whitelist_externals with allowlist_externals
Partial-Bug: #2000399
Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: I2dc26705317a5e6194318991ffad5c9d14f52922
Recently, LOCI changed its default so images are python3 if nothing is
specified at the *docker_image files. With the recent upversion of LOCI
in the build tools [1], we need to explictly set PYTHON3=no to images
that are still using python2. This commit fixes the StarlingX images to
use this parameter
TEST PLAN
PASS build the stx-nova-api-proxy image on the stable branch
[1] 00bd632a68
Closes-Bug: #1958696
Signed-off-by: Thiago Brito <thiago.brito@windriver.com>
Change-Id: I3b0a1e1d4b64527ce03192fb0f38bb7eba0d05c0
The api-proxy.service fails to start because it is not
able to find the /usr/bin/nova-api-proxy. Fix the debian package
to install the python module and the executable.
Story: 2009101
Task: 44055
Signed-off-by: Charles Short <charles.short@windriver.com>
Change-Id: Iee618464179d1429ef02a751af4fe9fc13edc5cb
The following changes were made to source files:
* Remove a null pointer from a log format in guestHttpSvr.cpp.
* Add a local variable for inet_ntoa instead of logging it directly.
* Added local_fs requirement to guestAgent and guestServer scripts.
* Changed guestAgent.ocf script from /bin/sh to /bin/bash.
Syntax of script was invalid for sh.
Testing:
* Debian build succeeds.
* Centos build succeeds.
Story: 2009101
Task: 43392
Signed-off-by: Tracey Bogue <tracey.bogue@windriver.com>
Change-Id: Iedfecda0c448800ff60216258946ed520f913c5f
Re-enabling some of the disabled tox warnings present on
the pylint.rc file
Re-enabling:
W1645: exception-message-attribute
Story: 2006796
Task: 43450
Signed-off-by: Bernardo Decco <bernardo.deccodesiqueira@windriver.com>
Change-Id: I959e37c16917da7d40b5466e7a72498c2e2c6bb4
A lot of work has gone into making sure that StarlingX is python3
compatible. To ensure future compatibility, enable the python3
portability checks. Disable the checks that are raising errors.
Another set of commits will address the offending code.
Add following suppress warnings in pylint.rc:
- W1618: no-absolute-import
- W1645: exception-message-attribute
Story: 2006796
Task: 43274
Signed-off-by: Fabricio Henrique Ramos <fabriciohenrique.ramos@windriver.com>
Change-Id: Icf304783ecfc98f3493f74faef6f2638c331dc5f
There is incompatible urllib usage.
Use six library instead of urllib.quote to fix incompatibility.
The Request object add_data method doesn't exist anymore. Use direct
access to data field instead.
This commit extracted urllib.parse.quote usage from Charles Short's
work Iecfe9b83245847b07aaaa0ec1aadad4734a9d118. Added changes
for Request.add_data usage on top of it.
Story: 2008454
Task: 42727
Co-authored-by: Charles Short <charles.short@windriver.com>
Signed-off-by: Dan Voiculeasa <dan.voiculeasa@windriver.com>
Change-Id: Ifd82ea8d4134a2a6301e5b10d4b0546833ed6193
(cherry picked from commit 522a3b3660e280d58352d1efe33bfdb8ab2e0461)
"/" operator using integers as both left-hand and right-hand
expressions returns floor division in python2 and real
division in python3.
Use "//" instead to do real division for both python versions.
This commit is split from Charles Short's work
Iecfe9b83245847b07aaaa0ec1aadad4734a9d118.
Story: 2008454
Task: 42727
Co-authored-by: Charles Short <charles.short@windriver.com>
Signed-off-by: Dan Voiculeasa <dan.voiculeasa@windriver.com>
Change-Id: I69ddfc4ba17d43158f1897fe291751210fb3d1f9
(cherry picked from commit f9149780fb44c33ef57d095f00442320452ff829)
The upgrade test was written to copy a file required for
the test, but did not handle the file already being processed.
This fix adjusts the setup for the unit test to handle this
and allows the recreate to be removed, thus reducing designer
tox testing time (40 seconds down to 4 when re-running a single test)
This also aligns the version of hacking and pylint as the same as
other starlingx repos. A new pylint was released which was
breaking tox.
The code changes are to fix whitespace (rather than suppressing):
E305 expected 2 blank lines after class or function definition
E117 over-indented
Three new hacking warnings are being suppressed:
W503 line break before binary operator
W504 line break after binary operator
W605 invalid escape sequence
Un-suppress these codes which are not broken in the code:
E123 closing bracket does not match indentation of opening bracket
E501 line too long (tox sets max length instead to a large val)
F823 local variable referenced before assignment
yamllint 1.26.1 does not work with py2 or py3 in our env, so clamp it.
Story: 2008137
Task: 42200
Signed-off-by: albailey <Al.Bailey@windriver.com>
Change-Id: Ia623315c5f1a690d20f597242b7722601776f26d
Update remaining StarlingX packages with hardcoded TIS_PATCH_VER to
use PKG_GITREVCOUNT where possible, with offsets as needed to ensure
the version is incremented above the hardcoded version.
Change-Id: I9adc5f2648fda75b14215a27075c93a851bc6faa
Story: 2008455
Task: 41453
Signed-off-by: Don Penney <don.penney@windriver.com>
A newer version of flake8 needed to be used, and
several error codes are no longer being suppressed.
Closes-Bug: 1906529
Signed-off-by: albailey <Al.Bailey@windriver.com>
Change-Id: Ifc38b664722da533fbf46614d59c00670c8f8780
This file is a non-executable file and shouldn't include a shebang.
The opensuse build system enforces to remove shebangs from files that
are not directly executed.
It is safe to remove this shebang as the executable file is created
by the setup.py file in nova-api-proxy.
Story: 2006508
Task: 36909
Change-Id: Ie5ef47a1ee9a54e135983f5665ae5cd4e55e2ec0
Signed-off-by: Erich Cordoba <erich.cordoba.malibran@intel.com>
There were some issues in the nova-api-proxy specfile for
opensuse, like unneeded variable definitions and missing configuration
lines. This patch address those problems.
Story: 2006508
Task: 36908
Change-Id: Ia82f7ce8ba2f975aafb544100a037e3451dde124
Signed-off-by: Erich Cordoba <erich.cordoba.malibran@intel.com>
The nfv components were enabled in the opensuse build system,
however to improve maintenance it was decided to move these files
to the official repositories.
The Open Build Service (OBS) project can be found here:
https://build.opensuse.org/project/show/Cloud:StarlingX:2.0
Story: 2006508
Task: 36809
Change-Id: Ie4084c3f0dbfc9683eb8fb023cc6531d59dc3b1a
Signed-off-by: Erich Cordoba <erich.cordoba.malibran@intel.com>
This updates the upper-constraints.txt used by tox for
installing python modules to reference the stable/stein
constraints.
Change-Id: If3880fba415ce3023e497ff557efae1b2b65ccff
Partial-Bug: 1834216
Signed-off-by: Don Penney <don.penney@windriver.com>
This update removes pike and master wheel and/or image files,
as these have been replaced with stable/dev.
Change-Id: Iefc8cbc8a03e8891fb4d240d16ba10cf1b0fcc64
Story: 2005248
Task: 30326
Signed-off-by: Don Penney <don.penney@windriver.com>
This update supports the migration to stable/dev build streams by
setting up the stable/dev wheels.inc and image build files.
Change-Id: I61e0cde00ae17f4530202cf86b7f75be6c418459
Story: 2005248
Task: 30104
Depends-On: Ib5dc9a7c1d8c37368d073e28d83eeb883766ee3f
Signed-off-by: Don Penney <don.penney@windriver.com>
replace unicode by six.text_type
replace urlparse by six.moves.urllib.parse
remove the ignore for F821 from the flake8 config
PS: as there is a bug of pylint 1.9, six.moves.urllib.parse
should be import as follows:
e.g.
from doc of module six:
from six.moves.urllib.parse import urlparse
urlparse(endpoint).path
here:
from six.moves import urllib
urllib.parse.urlparse(endpoint).path
pylint bug: https://github.com/PyCQA/pylint/issues/2180
Story: 2003427
Task: 24605
Task: 24608
Change-Id: I098ba8093dbf08dd91acaf403291ebb469195558
Signed-off-by: SidneyAn <ran1.an@intel.com>
when dict keys/values/items as a list
replace keylist = heights.keys()
to keylist = list(heights)
replace valuelist = heights.values()
valuelist = list(heights.values())
when Iterating through dict keys/values/items
keep for key in heights.keys()
Story: 2003427
Task: 24607
Change-Id: I22c8e1c5494a6763821b394a77a4d93ec837edc0
Signed-off-by: SidneyAn <ran1.an@intel.com>
This commit re-orders the imports alphabetically.
This following pep8 warning is no longer suppressed
for nova-api-proxy:
H306: imports not in alphabetical order
This change should have no functional impact on the code
Story: 2004515
Task: 28555
Change-Id: Ia60f9b4fcf030658e49ce350cb58721480358c19
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
This commit cleans up pylint error:
W0107 unnecessary-pass
Python rules dictate that a pass statement is only needed
if it is the only code in a particular block.
These changes have no runtime impact on the code.
Story: 2004515
Task: 28249
Change-Id: Ib805496c1123708cb67af82458f0b354a7b8e279
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
This update defines the docker image directives file for nova-api-proxy
to support building the service image with openstack master branch.
Change-Id: I940cdc9365023807624b81d41f38a843d84e0daf
Story: 2003907
Task: 28176
Signed-off-by: Don Penney <don.penney@windriver.com>
This update adds the docker image build directives file for
stx-nova-api-proxy and creates the centos_pike_docker_images.inc.
Change-Id: I6da3f01ebfe3d787f115bdacbc671ee08ad16b04
Story: 2003907
Task: 27936
Signed-off-by: Don Penney <don.penney@windriver.com>
The new flake8 version 3.6.0 introduces new warnings that cause
the check and gate jobs to fail. Locking down the flake8 version
to avoid these surprises in the future. We can later increment
the flake8 version and fix the new warnings in a controlled
manner.
Change-Id: Ia1eac379feb67b9d2efd5bb67611fd60c2bf83ef
Partial-Bug: 1799721
Signed-off-by: Bart Wensley <barton.wensley@windriver.com>
Replace module_name macro in nova-api-proxy.spec with name
Change-Id: I2c561cdb60a9c89acc40607896d980b22b47ce1a
Story: 2003907
Task: 27528
Signed-off-by: Don Penney <don.penney@windriver.com>
This update adds hooks to the spec files for the following packages
to generate wheels for the python modules:
- nfv
- nova-api-proxy
Change-Id: Ibda4e57c840b8aa5da5d33a92c1146759a3f9a77
Story: 2003907
Task: 27528
Signed-off-by: Don Penney <don.penney@windriver.com>
This changes the logging backend to oslo_log, from native python logging
This is required for the containerization of the nova-api-proxy
Change-Id: I0fb847c2d6b3178c15e78d063eb7c356a6c61979
Story: 2004007
Task: 27607
Depends-On: https://review.openstack.org/612427
Signed-off-by: Lachlan Plant <lachlan.plant@windriver.com>
Added a python3 tool called bugbear as part of flake8
Moved the tox.ini for nfv to a new location.
Removed nfv tox calls from the bottom level tox.ini file
Specified the queens upper-constraint. This is because the
kubernetes client from pike is not what is shipped.
Adds a separate tox.ini for nova-api-proxy.
Fix two of the errors flagged by bugbear:
B006: Do not use mutable data structures for argument defaults.
B306: BaseException.message has been deprecated as of Python 2.6
and is removed in Python 3.
Fix unused imports in Flake8
F401 '<module>' imported but unused
Clean up two pylint errors:
W0102 dangerous-default-value
W0631 undefined-loop-variable
Story: 2003499
Task: 26410
Change-Id: I61deb6a002f963cd58fe019bb54a4c3296809391
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
These errors are no longer suppressed:
E225 missing whitespace around operator
E226 missing whitespace around arithmetic operator
E231 missing whitespace after ','
E241 multiple spaces after ','
Story: 2003499
Task: 26386
Change-Id: Ic97e46b0a3b57456740a2a5935a8a3e6d3b81427
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
Flake8 and Hacking offer stricter style checks than pep8.
This submission fixes these codes:
E305 expected 2 blank lines after class or function definition, found 1
E722 do not use bare except'
F841 local variable 'blah' is assigned to but never used
H101: Use TODO(NAME)
H201: no 'except:' at least use 'except Exception:'
H237: module commands is removed in Python 3
H238: old style class declaration, use new style(inherit from `object`)
This submission enables 2 additional checks that are off by default
H106 vim config in files
H203 Use assertIs(Not)None to check for None
8 hacking codes and 2 flake8 types were added to the ignore list
and will be fixed by later updates.
An optional hacking code H904 will be enabled and the code fixed
by a later commit
Story: 2003499
Task: 26195
Change-Id: I48f99fc0dd41addc574c81cee6662600faeb8e75
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
The following pep8/flake8 warnings are no longer
being suppressed:
E101 indentation contains mixed spaces and tabs
E203 whitespace before ':'
E211 whitespace before '('
E228 missing whitespace around modulo operator
E251 unexpected spaces around keyword / parameter equal
E302 expected 2 blank lines, found 1
E303 too many blank lines
Story: 2003499
Task: 26190
Change-Id: I8df57783417e4372a008f876365f9c24d2c0cb4b
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
The code has over 2000 warnings related to indentation and line length
Suppressing these warnings allow us to fix those warnings in manageable code chunks
In addition to suppressing many of the warnings, this submission fixes
W191 indentation contains tabs
W291 trailing whitespace
W292 no newline at end of file
W293 blank line contains whitespace
W391 blank line at end of file
W503 line break before binary operator
Change-Id: If40f73d7312aec574d8141ea1af2cc6f1b4b8a46