Commit Graph

35 Commits

Author SHA1 Message Date
Luis Sampaio 5d4ba83910 Update debian package versions to use git commits
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
2023-02-10 10:14:48 -08:00
Chuck Short 0ce70917de debian: Simplify sm-client packaging
Make sure that the python is installed correctly.

Test Plan
PASS Build and test ISO.

Story: 2009101
Task: 44678

Signed-off-by: Chuck Short <charles.short@windriver.com>
Change-Id: I6ab99380a8a0a0be960bcf2c6f5b0a97463ff146
2022-03-08 19:54:43 +00:00
Matheus Machado Guilhermino 6ffad90d16 Handle PEP479 issues on ha
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
2022-02-18 14:45:44 -03:00
Zuul d2c1785496 Merge "Re-enable important py3k checks for ha" 2021-11-02 18:37:09 +00:00
Bernardo Decco 43ca8bc29c Re-enable important py3k checks for ha
Re-enabling some of the disabled tox warnings present on
the pylint.rc file

Re-enabling:

print-statement (E1601)

Test Plan: Sanity test run on AIO-SX:

PASS: test_system_health_pre_session[pods]
PASS: test_system_health_pre_session[alarms]
PASS: test_system_health_pre_session[system_apps]
PASS: test_wr_analytics[deploy_and_remove]
PASS: test_horizon_host_inventory_display
PASS: test_lock_unlock_host[controller]
PASS: test_pod_to_pod_connection
PASS: test_pod_to_service_connection
PASS: test_host_to_service_connection

Story: 2006796
Task: 43434
Signed-off-by: Bernardo Decco <bernardo.deccodesiqueira@windriver.com>
Change-Id: I4b8b1dcec40d1255edccaa8873af558c382a4f67
2021-10-28 17:10:41 -03:00
Leonardo Fagundes Luz Serrano c8a95f1ae0 Add debian package for service-mgmt-client
Add debian packaging infrastructure for service-mgmt-client
to build a debian package.

Story: 2009101
Task: 43643

Signed-off-by: Leonardo Fagundes Luz Serrano <Leonardo.FagundesLuzSerrano@windriver.com>
Change-Id: Ie199336731e5b11c6f580059120b7b9414c92f6e
2021-10-28 14:28:54 -03:00
Zuul f10b06cd76 Merge "Remove openstack.common.importutils.py" 2021-08-12 13:50:24 +00:00
Charles Short 865e55a292 Remove openstack.common.importutils.py
Remove the deprecated openstack.common.importutils
in favor or oslo_utils.importutils

Story: 2006796
Task: 42848

Signed-off-by: Charles Short <charles.short@windriver.com>
Change-Id: I9220e22b8db6c6330ca26ba9bb7a8569527826e0
(cherry picked from commit 8655ae2aa1)
2021-08-12 12:50:31 +00:00
Charles Short 79607cdf94 py3: Use StringIO from six
StringIO was moved in Python3.

Use StringIO from six to maintain compatibility with python2
and python3.

Story: 2006796
Task: 42816

Signed-off-by: Charles Short <charles.short@windriver.com>
Change-Id: Ib698aa4e5815ea74e9c73c8579f95a9b411d3010
(cherry picked from commit 144f6f8113)
2021-08-12 12:50:10 +00:00
Charles Short 1f48745689 Fix python3 compatibility
- 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)
2021-08-10 21:19:25 -04:00
Charles Short 82e179be82 Remove rootwrap
The rootwrap code dates back to openstack projects maintained
common code and was later replaced by oslo.rootwrap.

Remove openstack.commmon.rootwrap code since it was not being used
anywhere.

Story: 2006796
Task: 42694

Signed-off-by: Charles Short <charles.short@windriver.com>
Change-Id: I0b08117571cd75db17e346c751800c9d3ddfc173
2021-06-25 10:32:34 -04:00
Zuul f0b1eaf618 Merge "Add auto-version for remaining stx/ha packages" 2020-12-17 22:35:48 +00:00
albailey 6ab82889af Fix zuul jobs broken due to pip upversion
The install_command for docs, newnote and api-ref
needed to be overridden to not use upper constraints.

The bandit requirement needed to be made python3 only.

The bandit scan was failing, so it is now updated to
allow individual bandit failures to be suppressed in tox.ini

Need to include a py file change in order for bandit to be
triggered by zuul.

Partial-Bug: #1907678
Signed-off-by: albailey <Al.Bailey@windriver.com>
Change-Id: Ic73d0ea590ab1b7857f7275fa9c71828b0d343ee
2020-12-17 13:40:42 -06:00
Don Penney df739b210e Add auto-version for remaining stx/ha packages
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
2020-12-17 13:27:02 -05:00
Zuul f69bba0b34 Merge "openSUSE: Runtime Dependencies" 2019-10-23 03:39:15 +00:00
Zuul bb2cafa72c Merge "openSUSE: Open Build Service Artifacts" 2019-10-23 03:35:40 +00:00
Abraham Arce 03b3f990ea openSUSE: Runtime Dependencies
Resolve runtime dependencies for the following service manager
components:

- sm-client
- sm-tools
- sm-api

High availability OBS workspace has been moved to xe1gyq home
project [0], adding repository
Cloud_StarlingX_2.0_openSUSE_Leap_15.1 [1] in order to:

- allow all succesfull packages appear under xe1gyq
  repository [2].
- automatically include other flock dependencies
  (e.g. mtce-devel).

Refer to the following OBS workspaces to verify all service
management packages have built successfully under repository
Cloud_StarlingX_2.0_openSUSE_Leap_15.1:

- https://build.opensuse.org/package/show/home:xe1gyq/sm-db
- https://build.opensuse.org/package/show/home:xe1gyq/sm-common
- https://build.opensuse.org/package/show/home:xe1gyq/sm
- https://build.opensuse.org/package/show/home:xe1gyq/sm-client
- https://build.opensuse.org/package/show/home:xe1gyq/sm-tools
- https://build.opensuse.org/package/show/home:xe1gyq/sm-api

[0] https://build.opensuse.org/project/show/home:xe1gyq
[1] https://build.opensuse.org/repositories/home:xe1gyq
[2] https://download.opensuse.org/repositories/home:/xe1gyq/

Depends-On: https://review.opendev.org/#/c/679686

Story: 2006684
Task: 36968
Task: 36969
Task: 36970

Change-Id: I0a21652fff83b5da8acdfb0191df87165b88389e
Signed-off-by: Abraham Arce <abraham.arce.moreno@intel.com>
2019-10-09 10:05:54 -05:00
Abraham Arce f38de3f45f openSUSE: Open Build Service Artifacts
OBS is a generic system to build and distribute binary packages
from sources [0], StarlingX OBS Project:

- Cloud:StarlingX:2.0 [1]

Build Service Management uses Open Build Service (OBS) with the
following base artifacts under Service Management repository:

- Specfiles
- Changelogs
- Rpmlintrcs

The following components are included and succesfully building,
(with their source OBS repository):

- sm        [2]
- sm-common [3]
- sm-db     [4]
- sm-api    [5]
- sm-client [6]
- sm-tools  [7]

The following considerations are taken for Gerrit files:

- Added %changelog directive to all specfiles

The following considerations are taken for OBS _service files:

- Added parameter "extract" to get spec, changes and rpmlintrc files.
- All component version standardized to 1.0.0

[0] openbuildservice.org
[1] https://build.opensuse.org/project/show/Cloud:StarlingX:2.0
[2] https://build.opensuse.org/package/show/home:xe1gyq:branches:Cloud:StarlingX:2.0/sm
[3] https://build.opensuse.org/package/show/home:xe1gyq:branches:Cloud:StarlingX:2.0/sm-common
[4] https://build.opensuse.org/package/show/home:xe1gyq:branches:Cloud:StarlingX:2.0/sm-db
[5] https://build.opensuse.org/package/show/home:xe1gyq:branches:Cloud:StarlingX:2.0/sm-api
[6] https://build.opensuse.org/package/show/home:xe1gyq:branches:Cloud:StarlingX:2.0/sm-client
[7] https://build.opensuse.org/package/show/home:xe1gyq:branches:Cloud:StarlingX:2.0/sm-tools

Story: 2006508
Task: 36495
Task: 36496
Task: 36497
Task: 36498
Task: 36534
Task: 36794

Change-Id: I06a7e132de4892b846d99977ff1bfc5bf240ade4
Co-authored-by: Erich Cordoba <erich.cordoba.malibran@intel.com>
Signed-off-by: Abraham Arce <abraham.arce.moreno@intel.com>
2019-10-09 10:05:20 -05:00
Erich Cordoba 59321f0438 Remove not needed shebangs in sm_client
The linters in the Opensuse build service are failing because sm_client has
unneeded python shebangs in the code. This is because a python source code
file that is not intended to be executed shouldn't include this shebang.

Also, the linter fails as `/usr/bin/env python` is used causing that the
dependency discovery tool fails. It is safe to use `/usr/bin/python` as
currently we don't provide any other python version.

Story: 2006508
Task: 36647

Change-Id: If3f83b9562414c3392515828a3c716a5bc23015d
Signed-off-by: Erich Cordoba <erich.cordoba.malibran@intel.com>
2019-09-16 08:34:39 -05:00
Eric Barrett 24c42133f8 Fix Flake8 Bugbear Errors
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>
2019-04-15 17:06:14 -04:00
Eric Barrett 687ed8c747 Enable Do not use Mutable Default Args Error
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>
2019-04-15 12:53:36 -04:00
ZhijunWei 2694a20004 Change openstack-dev to openstack-discuss
Story: 2004582
Task: 28382
Change-Id: Ia27d6a4ffd2d00c271ea54274ba362df78dcc084
2018-12-10 14:46:38 +00:00
Sun Austin da53f143ee Fix flake8 errors and disable ignore case
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>
2018-11-07 08:12:37 +08:00
Don Penney b4049622ec Add hooks for python wheel generation
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>
2018-10-24 17:13:06 +00:00
Sun Austin de91fb2ac1 Fix urllib import issue for Python2/3 compatible code.
change urlparse to 'from six.moves.urllib.parse import urlparse'
and remove obsolete code

Story:2003430
Task:27479

Change-Id: I38e75f5faa55046517f1e479b18ebcef0304e471
Signed-off-by: Sun Austin <austin.sun@intel.com>
2018-10-24 08:39:08 +08:00
Sun Austin f2a6d355a9 Fix next issue for Python 2/3 compatible code.
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>
2018-10-22 09:51:19 +08:00
Sun Austin 7816995e87 Fix filter issue for Python 2/3 compatible code.
Change-Id: I5894ed2a2be0ca7fc14004be3059033df7281791
Story: 2003430
Task: 26520
Signed-off-by: Sun Austin <austin.sun@intel.com>
2018-10-15 13:00:51 +08:00
Sun Austin f21e0c13d7 Fix basestring issue for Python 2/3 compatible code.
replace basestring with six.string_types
need python-six module

Story: 2003430
Task: 26518

Change-Id: If8864a1af26274211d8d0e125071794d18dfed01
Signed-off-by: Sun Austin <austin.sun@intel.com>
2018-10-08 19:11:28 +08:00
Erich Cordoba 54f4802bb1 Unsupress pylint warnings.
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>
2018-10-04 14:19:31 -05:00
Zuul 81060ae8ff Merge "Python 3 compatibility: convert ConfigParser to configparser." 2018-10-02 17:03:46 +00:00
Sun Austin 5c0dcd6e4c Fix dict related issues for Python 2/3 compatible code
Story: 2003430
Task: 26353

Change-Id: Ic673136ece7f0a16177cc6a96377456d127e55bf
Signed-off-by: Sun Austin <austin.sun@intel.com>
2018-09-26 11:27:54 +08:00
zhangyangyang b90a7c9a4a Python 3 compatibility: convert ConfigParser to configparser.
The ConfigParser module in python 2 has been renamed to configparser
in Python 3.

Story: 2003430
Task: 26335

Change-Id: Ie4b29c44f90cc4feaf7f66f2a855fde3a222e058
Signed-off-by: zhangyangyang <zhangyangyang@unionpay.com>
2018-09-07 14:18:45 +00:00
zhangyangyang 75b8c70d9d Python 3 compatibility: use print as a function.
In Python 3 print is a function.
Especially for multiple string print, need to import
print_function from __future__.

Story: 2003430

Task: 24915

Signed-off: zhangyangyang <zhangyangyang@unionpay.com>

Change-Id: I40ae72b8efb7b342489ad2191ad02b0a5fb2898f
2018-08-31 15:42:43 +00:00
Bin Qian 045a37c672 Create independent sm-api client
1. use sm-api.conf for sm-api configuration
2. create sm-api client code and command line entry
3. add keystone authentication for accessing sm-api
4. removed dead sm-api client code

Story: 2002827
Task: 22744

Depends-On: I743f6b0f09c06325d3c9dc6e11902420882e7931
Change-Id: I861a6fa144494e135f6eb67d96e874d25f4db5d4
Signed-off-by: Bin Qian <bin.qian@windriver.com>
2018-08-13 14:16:57 -04:00
Dean Troyer 17c909ec83 StarlingX open source release updates
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
2018-05-31 07:36:26 -07:00