This commit is to change the swact precheck logic. The new
logic will unblock the swact precheck for host state sync state
if the USM endpoint is not present. This change is needed for
the release that doesn't have USM endpoint present.
Test Plan:
PASS: swact back to controller 0 after legacy upgrade to 24.09
PaSS: swact between controllers in 24.09
Task: 49826
Story: 2010676
Change-Id: I6824f00589057f4d48c8df04425431cb22361e8e
Signed-off-by: junfeng-li <junfeng.li@windriver.com>
This is to fix the USM endpoint URL not appended properly
using .join() function.
The way .join() was used only append the endpoint resource
to a empty string.
Test Plan:
PASS: Run the host-swact
Depends-on: https://review.opendev.org/c/starlingx/update/+/911003
Task: 49660
Story: 2010676
Change-Id: Icf47494843d7ea6c9fcd73e9256d9be352d8f76f
Signed-off-by: junfeng-li <junfeng.li@windriver.com>
This commit is to ensure both controllers
deployment state is in synced before host
swact during platform upgrade.
If the USM deploy is not started, this host swact
pre-check is always passed.
During the pre-swact check, the SM calls
USM REST API endpoint to get the controller
sync status. If the controllers deployment state
is not in sync, the host swact is stopped.
Depends-on: https://review.opendev.org/c/starlingx/update/+/906005
Test Plan:
PASS: executed host swact when controllers are in sync
PASS: executed host swact when controllers are not in sync
Task: 49425
Story: 2010676
Change-Id: I8d262a731583f691fd0d85a33ddebcbb12f549e8
Signed-off-by: junfeng-li <junfeng.li@windriver.com>
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.
Test Plan:
PASS: build-pkgs -p sm-common
PASS: build-pkgs -p sm-db
PASS: build-pkgs -p sm
PASS: build-pkgs -p sm-api
PASS: build-pkgs -p sm-client
PASS: build-pkgs -p sm-tools
PASS: build-pkgs -p stx-ocf-scripts
Story: 2010550
Task: 47341
Signed-off-by: Luis Sampaio <luis.sampaio@windriver.com>
Change-Id: I54cde0fe252c3bcef669969a1b0675a2df8b3d69
Remove the installation of per-package preset installs
since they are centrally managed now by the ISO install
for the following packages:
- sm-api
- sm-common
- sm-eru
- sm
Story: 2009968
Task: 46406
Test Plan
PASS Build package
PASS Build ISO
PASS Check for non-existant preset file in /etc/systemd/system-preset
Depends-On: https://review.opendev.org/c/starlingx/integ/+/853653
Signed-off-by: Charles Short <charles.short@windriver.com>
Change-Id: I537a013c77c7603e48cbf92837a4174282d70032
Removed conf files from /etc/pmon.d/
as they are being moved to another location.
This is part of an effort to allow pmon conf files
to be selected at runtime by kickstarts.
The change is debian-only, since centos support
will be dropped soon.
Centos' pmon conf files remain in /etc/pmon.d/
Test Plan:
PASS - deb doesn't install anything to /etc/pmon.d/
PASS - rpm files unchanged
PASS - AIOSX unlocked-enabled-available
PASS - Standard 2+2 unlocked-enabled-available
Story: 2010211
Task: 46304
Depends-On: https://review.opendev.org/c/starlingx/metal/+/855095
Signed-off-by: Leonardo Fagundes Luz Serrano <Leonardo.FagundesLuzSerrano@windriver.com>
Change-Id: Ie2f8e73f8664746d0213e98bba17e56d98d93b4f
Created a duplicate install of /etc/pmon.d/*.conf files
to /usr/share/starlingx/pmon.d/
This is part of an effort to allow pmon conf files
to be selected at runtime by kickstarts.
Test Plan:
PASS: duplicate conf on deb
Story: 2010211
Task: 46114
Signed-off-by: Leonardo Fagundes Luz Serrano <Leonardo.FagundesLuzSerrano@windriver.com>
Change-Id: Ia3774ac59b1df40aa1726bb182390b4b58812141
mtcAgent get response code 500 from sm-api.
Tests on AIO-DX:
CentOS:
PASS: unlocked enabled available controller-1
Debian:
integration not far enough to test controller-1 unlock
PASS: mtcAgent gets a proper response from sm-api
Story: 2009968
Task: 45504
Closes-Bug: 1976515
Signed-off-by: Dan Voiculeasa <dan.voiculeasa@windriver.com>
Change-Id: I5912f8d506d220775e2346f4b8771758cf818e3c
- Removed unneeded dependencies.
- Install systemd services in the correct directory.
- Enabled systemd preset so that the packaging is starting
correctly when the server boots.
Test Plan
PASS Build and test ISO.
PASS Check sm service has started.
Story: 2009101
Task: 44678
Depends-On: https://review.opendev.org/c/starlingx/integ/+/831950
Signed-off-by: Chuck Short <charles.short@windriver.com>
Change-Id: I05f7f559f14892eaede069930398359b3d26f6e5
This reverts commit 8b2820f90f.
This introduces a build error when building sm, due to sm-db
dependency. When installing sm-db the shared library is now
moved to another location. Linking will fail when building.
/usr/bin/ld: cannot find -lsm_db
collect2: error: ld returned 1 exit status
Story: 2009101
Task: 44597
Change-Id: I58796e3d285777e5e5b3cf7123acd8bfbf6e6332
Modified sm to address the following failing
services on Debian:
sm.service
sm-eru.service
sm-watchdog.service
sm-shutdown.service
sm-api.service
Applied fix:
- Included modified .service files for debian
directly into into the deb_folder.
- Changed the script file to set the environmental
variable LD_LIBRARY_PATH to the path of the
libsm_db and libsm_common libs.
- Included "override_dh_installsystemd" section
to rules in order to install services.
- Included postinst file to move the lib files
and to start two services.
Test Plan:
PASS: Package installed and ISO built successfully.
PASS: Services are on the expected state after iso install.
PASS: Services are running after bootstrap on Debian.
PASS: CentOS sm package is built and installed successfully
Story: 2009101
Task: 44597
Signed-off-by: lbonatti <LuizEduardo.Bonatti@windriver.com>
Change-Id: Iaa6e5087d6abe89b4fbfea464b2a19521faaa868
Similar to how PEP479 was handled on config[1].
Instances of "raise StopIteration" were changed to
a plain 'return' statement in order to avoid breaking
the existing logic.
CentOS 7 tests:
PASS: Build & install
PASS: Successful Bootstrap
Debian Bullseye tests:
PASS: Build & install
PASS: Successful Bootstrap
[1] https://review.opendev.org/c/starlingx/config/+/825447
Story: 2009101
Task: 44513
Signed-off-by: Matheus Machado Guilhermino <Matheus.MachadoGuilhermino@windriver.com>
Change-Id: Ibe4717e64fcee159c1bc4a17acf623adbfae3908
Except keywords expects a tuple containing only base classes,
or a base class as the exception type in Python3.
This is compatible with Python2.
Convert lists to tuples, and expand nested tuples.
Suppress pylint warnings.
This was taken from d41f3fe19939f1759ca3cf73874724bd75eebe43
in the starlingx/config repo.
Story: 2006796
Task: 42866
Signed-off-by: Charles Short <charles.short@windriver.com>
Change-Id: I129302b5a6199b705b3533ffb77e7700e815df2f
(cherry picked from commit 702ea92596)
"/" 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.
Story: 2006796
Task: 42817
Signed-off-by: Charles Short <charles.short@windriver.com>
Change-Id: Id8ac605d0184e70aa92717d8d3ce97bf8b7922cf
(cherry picked from commit bcf4a4915f)
- Use six.moves for urllib2
- Use six.moves.xmlrpc_client
- Use six.moves.zip
- Adapt gettextutils
- Fix set() order dismatch for python 2/3
- Change dict key to list
Test:
- Build RPM with applied changes.
- Installed simplex controller checked to see if sm-api was running.
Story: 2006796
Task: 42388
Signed-off-by: Charles Short <charles.short@windriver.com>
Change-Id: I29a81755f732b55f67321748604b2e5d951935c9
Signed-off-by: Mihnea Saracin <Mihnea.Saracin@windriver.com>
(cherry picked from commit cdc4757a46)
The "min()" function works for None arguments
in Python 2 but in Python 3 raises an error.
We add a check to ensure that the function is not
called with the None argument in Python 3.
Story: 2006796
Task: 42388
Depends-On: I29a81755f732b55f67321748604b2e5d951935c9
Change-Id: I2199e0b87d342cec305edbb10483c6c038ad591c
Signed-off-by: Mihnea Saracin <Mihnea.Saracin@windriver.com>
(cherry picked from commit f2186d04c0)
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.
Story: 2008455
Task: 41447
Signed-off-by: Don Penney <don.penney@windriver.com>
Change-Id: Idf5ef476192cdf4923d6c903f1a15e03cfe9d03f
Renaming a config entry as it causes a name conflict with
the latest version of oslo utils introduced during the stein rebase
Change-Id: Idc581b7dc389b00863461f2b30b7f6ae283ffdc5
Story: 2004765
Task: 28883
Signed-off-by: Tyler Smith <tyler.smith@windriver.com>
Flake8 is failing due to bugbear updating with new error codes:
B009: Do not call getattr with a constant attribute value
B010: Do not call setattr with a constant attribute value
Fix these errors by using normal property access instead
Change-Id: Ib857d229ae86e88cb5dbf69e826b25d6018c8547
Signed-off-by: Eric Barrett <eric.barrett@windriver.com>
Flake8 currently ignores do not use mutable default arguments error
Enable B006 for more thorough testing of code
Change-Id: I5b08a56f945158c3b3c23574c048363e59da6001
Story: 2004515
Task: 30172
Signed-off-by: Eric Barrett <eric.barrett@windriver.com>
below issures are removed from ignore cases:
E114 indentation is not a multiple of four (comment)
E116 unexpected indentation (comment)
E121 continuation line under-indented for hanging indent
E122 continuation line missing indentation or outdented
E123 closing bracket does not match indentation of opening bracket's line
E124 closing bracket does not match visual indentation
E125 continuation line with same indent as next logical line
E126 continuation line over-indented for hanging indent
E127 continuation line over-indented for visual indent
E128 continuation line under-indented for visual indent
E129 visually indented line with same indent as next logical line
E131 continuation line unaligned for hanging indent
E201 whitespace after '('
E228 missing whitespace around modulo operator
E231 missing whitespace after ','
E241 multiple spaces after ':'
E251 unexpected spaces around keyword / parameter equals
E265 block comment should start with '#'
E271 multiple spaces after keyword
E302 expected 2 blank lines, found 1
E303 too many blank lines
E305 expected 2 blank lines after class or function definition, found 1
E704 multiple statements on one line (def)
E713 test for membership should be 'not in'
E714 test for object identity should be 'is not'
E722 do not use bare except'
E731 do not assign a lambda expression, use a def
E999 SyntaxError: invalid syntax (this is likely python3)
F401 <foo> imported but unused
F841 local variable 'foo' is assigned to but never used
H201: no 'except:'
H233: Python 3.x incompatible use of print operator
B001 Do not use bare `except:`
B004 Using `hasattr(x, '__call__')` to test
if `x` is callable is unreliable.
B305 `.next()` is not a thing on Python 3. Use the `next()` builtin.
B306 `BaseException.message` has been deprecated as of Python 2.6
and is removed in Python 3.
B007 Loop control variable 'key' not used within the loop body.
remain below issues in ignores:
E402 module level import not at top of file
./service-mgmt-api/sm-api/sm_api/cmd/__init__.py:25
Hxxx since which are related with document format
F811 redefinition of unused '<foo>' from line <x>
./service-mgmt-tools/sm-tools/sm_tools/sm_configure.py:18
F821 undefined name 'e'
./service-mgmt-api/sm-api/sm_api/common/utils.py:448
B006 Do not use mutable data structures for argument defaults.
./service-mgmt-api/sm-api/sm_api/common/service.py:59
B008 Do not perform calls in argument defaults.
./service-mgmt-api/sm-api/sm_api/openstack/common/timeutils.py:117
Test have been done:Build,Deploy,some smc command,such as smc service-list,
smc service-show, sm-dump, etc
Story: 2003430
Task: 26524
Change-Id: I3e2a4a31f87e3ff66cfce86f54285e830ee1c3dc
Signed-off-by: Sun Austin <austin.sun@intel.com>
Fix: "reduce" issue in
service-mgmt-api/sm-api/sm_api/openstack/common/rpc/impl_zmq.py
- from functools import reduce to support python 3
Fix: "long" issue in
service-mgmt-api/sm-api/sm_api/openstack/common/jsonutils.py
- remove long type if for python 3
- change to six.integer_types
Fix: "funcattrs" issue in
service-mgmt-api/sm-api/sm_api/openstack/common/db/sqlalchemy/session.py
- change f.func_name to f.__name__
Fix: "zip" and "methodattrs" issues in
service-mgmt-api/sm-api/sm_api/common/safe_utils.py
- change zip() to list(zip())
- change function.im_self to function.__self__
Fix: "itertools" issue in
service-mgmt-api/sm-api/sm_api/openstack/common/log.py
- from six import moves and use moves.filter
Story: 2003430
Task: 26523
Change-Id: I37b47a12a24ef05fb4d57823b2a91086b6ca537f
Signed-off-by: Sun Austin <austin.sun@intel.com>
remove "__metaclass__ = abc.ABCMeta"
and adding decorator "@six.add_metaclass(abc.ABCMeta)" on class
and removing pep8 ignore case
Story: 2003430
Task: 27476
Change-Id: If60b8d5662d9a87b217a9b1d48a2c3e9b037884b
Signed-off-by: Sun Austin <austin.sun@intel.com>
This update adds hooks to the spec files for the following packages
to generate wheels for the python modules:
- sm-api
- sm-client
- sm-tools
Change-Id: If6ebbdaaad5ee7623cbbaa07b48d216461a16dec
Story: 2003907
Task: 27527
Signed-off-by: Don Penney <don.penney@windriver.com>
use from six import reraise as raise_
to re-implement raise
Story:2003430
Task:27478
Change-Id: I34373ce7f233f7f908da3d92bcc000a9e924375d
Signed-off-by: Sun Austin <austin.sun@intel.com>
change "except ValueError, e:"
to "except ValueError as e:"
and remove tox H231 from ignore for pep8 check
Story:2003430
Task: 26522
Change-Id: I06c7646c375ada7f8f06f870a7bdb0d7fc282e5a
Signed-off-by: Sun Austin <austin.sun@intel.com>
change x.next() to next(x)
and
add __next__() for class
Story: 2003430
Task: 26519
Change-Id: I4cda6f1d679e05b7f533b94840e0eb561213aa76
Signed-off-by: Sun Austin <austin.sun@intel.com>
The W291,W292,W391,W503,W601 warnings were fixed and
tox.ini updated accordingly.
Story: 2002803
Task: 26911
Change-Id: I1e5f0b1f72b06ad8b5cac07921e9d14171623ba0
Signed-off-by: Erich Cordoba <erich.cordoba.malibran@intel.com>
The voting linters job will now run pylint on the python code.
All failing pylint codes are currently suppressed.
Further tasks will be created to cleanup those failing tests.
The only code changes were comments which perform inline suppression
of pylint warnings. Those lines are not meant to be fixed since those
imports cannot succeed in a tox env.
Story: 2002803
Task: 26883
Change-Id: I4a25599fb60f58b168dbec001d3f2d24e0e2c235
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
Add logging when a service sm-api request is received.
Change-Id: Ifaf38eeeeeb44110a700976fedc247e30b0c7206
Related-Bug: #1791381
Signed-off-by: Bin Qian <bin.qian@windriver.com>
This decouples the build and packaging of guest-server, guest-agent from
mtce, by splitting guest component into stx-nfv repo.
This leaves existing C++ code, scripts, and resource files untouched,
so there is no functional change. Code refactoring is beyond the scope
of this update.
Makefiles were modified to include devel headers directories
/usr/include/mtce-common and /usr/include/mtce-daemon.
This ensures there is no contamination with other system headers.
The cgts-mtce-common package is renamed and split into:
- repo stx-metal: mtce-common, mtce-common-dev
- repo stx-metal: mtce
- repo stx-nfv: mtce-guest
- repo stx-ha: updates package dependencies to mtce-pmon for
service-mgmt, sm, and sm-api
mtce-common:
- contains common and daemon shared source utility code
mtce-common-dev:
- based on mtce-common, contains devel package required to build
mtce-guest and mtce
- contains common library archives and headers
mtce:
- contains components: alarm, fsmon, fsync, heartbeat, hostw, hwmon,
maintenance, mtclog, pmon, public, rmon
mtce-guest:
- contains guest component guest-server, guest-agent
Story: 2002829
Task: 22748
Depends-On: https://review.openstack.org/603435
Change-Id: I1a66c28bfa592d8034074a18e2328f69122da89b
Signed-off-by: Jim Gauld <james.gauld@windriver.com>