From https://docs.python.org/3/whatsnew/3.8.html#changes-in-python-behavior:
The compiler now produces a SyntaxWarning when identity
checks (is and is not) are used with certain types of
literals (e.g. strings, numbers). These can often work
by accident in CPython, but are not guaranteed by the
language spec. The warning advises users to use
equality tests (== and !=) instead.
Test Plan:
PASS Apply patch test the output of fm alarm-list on Debian 11.
PASS Apply patch test the output of fm alarm-list on Centos 7.
Closes-Bug: 1960958
Signed-off-by: Chuck Short <charles.short@windriver.com>
Change-Id: I12c43f336a449876fab8592e34eace674518d0da
current fmclient does not support --insecure parameter
and this cause that fm command doesn't work when
endpoint is configured with private signed certificates.
Closes-Bug: 1958262
Test Plan:
PASS: configure endpoint with private signed certificates
and run rm command with --insecure to get the alarm-list.
PASS: set FMCLIENT_INSECURE=true environment variable and
run fm alarm-list.
Signed-off-by: Giana Francisco <francisco.giana@windriver.com>
Change-Id: I2c2a33d24fb544147bd02fda2e0a89eafd48c818
Fix lintian errors when building python3-fmclient
for Debian.
Story: 2009101
Task: 43050
Signed-off-by: Charles Short <charles.short@windriver.com>
Change-Id: I852c9ff0e38bb0387015886d060d51fe6de28749
Add packaging infrastructure for python-fmclient.
Story: 2009101
Task: 43050
Signed-off-by: Charles Short <charles.short@windriver.com>
Change-Id: I0691edccd28199e0cdb17994da68d4f4bb80eed7
Python3 bytes object needs to be encoded before the md5 hash
operation otherwise an a TypeError exception will be raised.
Story: 2006796
Task: 42811
Signed-off-by: Charles Short <charles.short@windriver.com>
Change-Id: I58bc974c1a7420e7824b025faccc39927f4d1c9e
(cherry picked from commit 86f90e0f12)
- use absolute path imports to compat python3
- Replace dict.keys() with list(dict.keys()) to get a list on Python
3. On Python 3, dict.keys() now returns a view.
- Fix iteritems to use items for python3.
Testing:
1. Built packaging with new python3 packaging.
2. Built resulting ISO with new python-fmclient package.
3. Ran "fm" under python3. Verifified that no tracebacks
happened because it could not find common_wrappers.py.
4. Ran fm alarm-list to verify that output was displayed.
5. Ran fm event-list to display the events.
6. Ran fm alarm-show to show an active alarm.
Story: 2006796
Task: 42257
Signed-off-by: Charles Short <charles.short@windriver.com>
Change-Id: I5081d0685c7ad200076a76b7709cbe4f39c7b456
(cherry picked from commit 5d2dfab5f9)
flake8 2.5.5 fails on ubuntu-focal zuul machines running python3.8
with the following error:
AttributeError: 'FlakesChecker' object has no attribute 'CONSTANT'
Fixed:
E117 over-indented
E741 ambiguous variable name
F841 local variable is assigned to but never used
Per-Line-Suppressed:
E402 module level import not at top of file
F632 use ==/!= to compare constant literals
Global Suppress:
W504 line break after binary operator
W605 invalid escape sequence
The suppressed errors can be fixed by later submissions.
Change-Id: I2df3ece427f0c84ce16c1a82f4d9f0c9a5a6982b
Partial-Bug: 1895054
Signed-off-by: albailey <Al.Bailey@windriver.com>
This update changed the TIS_PATCH_VER to use the PKG_GITREVCOUNT
variable to auto-version the packages.
Adds an upper constraint to fm-rest-api to pass zuul.
Story: 2006740
Task: 39842
Change-Id: I4a180f1395ff9764ecc9d617a514e265db670b9c
Signed-off-by: Teresa Ho <teresa.ho@windriver.com>
Some of the fault components rely on having all the dependencies
installed in the StarlingX ISO so having missing dependencies listed
in the spec files is not an issue. However, when we take those compo-
nents and run them in a non StarlingX installation these problems
started to arise.
This patch is the result of the analysis of all imports and a manual
execution of the fault components in opensuse. This is a summary of
the findings:
- fm-api: This component imports `fm_core` which is provided by
`fm-common` but not listed in the dependencies. Same
case for `six` module.
- fm-mgr: `fmManager` links to `libfmcommon` but is not listed in the
requirements. Also, it expects to find the `/etc/fm/events.yaml`
file which is provided by `fm-doc`.
- fm-rest-api: A set of imports that are missing. This component also
depends on other StarlingX compoments.
- python-fmclient: Missing python imports.
Story: 2006684
Task: 36971
Change-Id: I6719ab8a8d9a35d105be1c6f7dac57b855da543e
Signed-off-by: Erich Cordoba <erich.cordoba.malibran@intel.com>
The rpmlint tool complains about having duplicated files in these
two packages. The %fdupes macro helps to remove these duplicated
files and thus pass rpmlint checks.
Story: 2006508
Task: 36867
Change-Id: I031352e06c74da65dc62b9a6c51dbb87371432d1
Signed-off-by: Erich Cordoba <erich.cordoba.malibran@intel.com>
These files are part of OBS infrastructure and shouldn't be part of
this repository.
Story: 2006508
Task: 36862
Change-Id: I8cc056a49a888352d8dbb03b2a55e86549e6a45a
Signed-off-by: Erich Cordoba <erich.cordoba.malibran@intel.com>
All opensuse version are being standardize with the same format,
this requires that all components will change from 1.0 to 1.0.0.
Story: 2006508
Task: 36811
Change-Id: I301759895e4ed816633daa6595d5f60f2f1d59c7
Signed-off-by: Erich Cordoba <erich.cordoba.malibran@intel.com>
The rpmlintrc files helps to configure the behavior of the rpm linter
executed by the opensuse build system. This patch adds the rpmlintrc
files that were defined in the opensuse build system.
Story: 2006508
Task: 36799
Change-Id: If75264e809bb78bbcff1dd474b1a5fc1819ac193
Signed-off-by: Erich Cordoba <erich.cordoba.malibran@intel.com>
As the tarballs are now created by the _service definition in the
opensuse build system, it requires now to include the specfiles
within the tarballs. This means that the `-n` option needs to be
set for `%autosetup`.
Story: 2006508
Task: 36780
Change-Id: Ib89a440d4911200ead2a3a35d731564e86b0b447
Signed-off-by: Erich Cordoba <erich.cordoba.malibran@intel.com>
In the opensuse build system (OBS) the `_service` files are being
standardized to generate tarballs with gz compression. The fault's
specfiles were created before this decision, therefore an update
in the extension is required.
Story: 2006508
Task: 36670
Change-Id: I96cb185a9a0e089e4f8e184e8fdeaa709f77915e
Signed-off-by: Erich Cordoba <erich.cordoba.malibran@intel.com>
This commit adds the RPM specfile that supports openSUSE, these
include the _service file which creates the tarball, the changes
files and specfile itself.
These are all built via the OpenBuildService (OBS) and can be
found here:
https://build.opensuse.org/project/show/Cloud:StarlingX:2.0
Change-Id: I676aae8cb9554eab2740232fd0dd77e0ed876506
Signed-off-by: Saul Wold <sgw@linux.intel.com>
The dependency resolver for RPM relies on the shebang to have the
interperter that will be used in order to get things right, so
change shebang to /usr/bin/python.
In other cases, the shebang is not needed at all as these are not
really executable python files, they are part of the python package.
RPMLINT finds these and complains that a non-executable has a shebang.
Change-Id: Ie90a846d6addffca1225e59fd8b6f3753d2991a4
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Flake8 currently ignores the following errors:
H233: Python 3.x incompatible use of print operator
H236: Python 3.x incompatible __metaclass__
H238: Old style class declaration, use new style
Enable them for python3 compability
Change-Id: I8959f3a78ce683eb93a16234908662189dd7c8a5
Story: 2004515
Task: 29304
Signed-off-by: Eric Barrett <eric.barrett@windriver.com>
These functions do a number of things, specifically they handles the
DevStack USE_PYTHON3 switch transparently so we can run both major
Python versions.
The new setup.cfg files are only used by setup_*() right now, making
the switch to use pbr is beyond what I want to do here.
Change-Id: Ib9753119235b1ce23030a2b3de0169ed6f8819e0
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
Spec files no longer requires specific remote-clients SDK actions.
With the StarlingX move to supporting pure upstream OpenStack, the
majority of the SDK Modules are related to functionality no longer
supported. The remaining SDK Modules will be moved to StarlingX
documentation.
Story: 2005275
Task: 30154
Change-Id: I6ed8de0f8ba438088aff27b1d1947c428e79fb4b
Signed-off-by: Kristine Bujold <kristine.bujold@windriver.com>
Issue:
for the alarm_show/alarm_delete/event_show api, if the input UUID
string is not valid, http server side will return error code 500
(Internal Server Error), due to the error code is not set correctly.
Solution:
Correct the error code in server, and add client code to handle
"HTTP 404 - Not Found" error code correctly.
Test:
Run "fm alarm-show/alarm-delete/event-show" with valid/invalid
UUID, and the response is correct. For invalid UUID, response
string will like below. "xxx" for the invalid UUID string.
"Alarm not found: xxx"
"Event log not found: xxx"
Closes-Bug: 1806927
Change-Id: I8d17c5bc55733f269d875ae835ab6295fed4d899
Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>
Include the optional “expand” option to the get list for alarms and
events so the entire set of data can be returned and not just a
subset. “expand” is and optional parameter and defaults to False.
Story: 2004818
Task: 29096
Change-Id: Ife3b900d90c56564e9aeaa820e57f69d15194eb3
Signed-off-by: Kristine Bujold <kristine.bujold@windriver.com>
This update adds hooks to the spec files for the following packages
to generate wheels for the python modules:
- fm-api
- fm-common
- fm-rest-api
- python-fmclient
Change-Id: I0542650b52b9c5b0627023a2ce1996176135411d
Story: 2003907
Task: 27525
Signed-off-by: Don Penney <don.penney@windriver.com>
This update removes the version from fmclient setup metadata.
The fmclient setup will use the build tag instead
Change-Id: Iee2d1ffab867279a6700325b46a79decdbb97b7a
Signed-off-by: Tao Liu <tao.liu@windriver.com>
The fm-rest-api and python-fmclient packages have incorrect License
in the PKG-INFO and spec files.
This update changes the license to Apache-2.0 in the PKG-INFO and
spec files.
Change-Id: I012c87818d87d1f55032241cd15ff90ad82ef661
Signed-off-by: Tao Liu <tao.liu@windriver.com>
Add bash completion script for FM shell.
Story: 2002828
Task: 22747
Change-Id: I3ac3262573d198ab5b9cfe8bcfd5e52dd9910ebd
Signed-off-by: Tao Liu <tao.liu@windriver.com>
Create fault management REST API service
Create fault management client and CLI shell
Add a python extension for fault management application APIs
Update fault management python APIs to use the python extension
Update fault manager to retrieve the SNMP configuration from the config file
Story: 2002828
Task: 22747
Depends-On: https://review.openstack.org/#/c/592176/
Change-Id: I888d8d23edf75d05d51594ccca55570ae366c848
Signed-off-by: Tao Liu <tao.liu@windriver.com>