Subdirectories 'tsconfig ' relocated to repo 'stx-config'
Story: 2006166 Task: 35687 Depends-On: I6c62895f8dda5b8dc4ff56680c73c49f3f3d7935 Depends-On: I665dc7fabbfffc798ad57843eb74dca16e7647a3 Change-Id: I70b6d52a13836e16139a0ca3f42b9e91e06e43b6 Signed-off-by: Scott Little <scott.little@windriver.com> Depends-On: I5618547e7e74b76d174f10897b1c747931738cd6 Signed-off-by: Scott Little <scott.little@windriver.com>
This commit is contained in:
parent
08df660b06
commit
b0559bc151
45
.zuul.yaml
45
.zuul.yaml
|
@ -8,10 +8,6 @@
|
||||||
jobs:
|
jobs:
|
||||||
- flock-devstack-update
|
- flock-devstack-update
|
||||||
- openstack-tox-linters
|
- openstack-tox-linters
|
||||||
- tsconfig-tox-flake8
|
|
||||||
- tsconfig-tox-pylint
|
|
||||||
- tsconfig-tox-py27
|
|
||||||
- tsconfig-tox-py36
|
|
||||||
- patch-tox-flake8
|
- patch-tox-flake8
|
||||||
- patch-tox-pylint
|
- patch-tox-pylint
|
||||||
- patch-tox-py27
|
- patch-tox-py27
|
||||||
|
@ -24,10 +20,6 @@
|
||||||
jobs:
|
jobs:
|
||||||
- flock-devstack-update
|
- flock-devstack-update
|
||||||
- openstack-tox-linters
|
- openstack-tox-linters
|
||||||
- tsconfig-tox-flake8
|
|
||||||
- tsconfig-tox-pylint
|
|
||||||
- tsconfig-tox-py27
|
|
||||||
- tsconfig-tox-py36
|
|
||||||
- patch-tox-flake8
|
- patch-tox-flake8
|
||||||
- patch-tox-pylint
|
- patch-tox-pylint
|
||||||
- patch-tox-py27
|
- patch-tox-py27
|
||||||
|
@ -37,42 +29,6 @@
|
||||||
- patch-alarm-tox-py27
|
- patch-alarm-tox-py27
|
||||||
- patch-alarm-tox-py36
|
- patch-alarm-tox-py36
|
||||||
|
|
||||||
- job:
|
|
||||||
name: tsconfig-tox-flake8
|
|
||||||
parent: tox
|
|
||||||
files:
|
|
||||||
- tsconfig/tsconfig/*
|
|
||||||
vars:
|
|
||||||
tox_envlist: flake8
|
|
||||||
tox_extra_args: -c tsconfig/tsconfig/tox.ini
|
|
||||||
|
|
||||||
- job:
|
|
||||||
name: tsconfig-tox-pylint
|
|
||||||
parent: tox
|
|
||||||
files:
|
|
||||||
- tsconfig/tsconfig/*
|
|
||||||
vars:
|
|
||||||
tox_envlist: pylint
|
|
||||||
tox_extra_args: -c tsconfig/tsconfig/tox.ini
|
|
||||||
|
|
||||||
- job:
|
|
||||||
name: tsconfig-tox-py27
|
|
||||||
parent: tox
|
|
||||||
files:
|
|
||||||
- tsconfig/tsconfig/*
|
|
||||||
vars:
|
|
||||||
tox_envlist: py27
|
|
||||||
tox_extra_args: -c tsconfig/tsconfig/tox.ini
|
|
||||||
|
|
||||||
- job:
|
|
||||||
name: tsconfig-tox-py36
|
|
||||||
parent: tox
|
|
||||||
files:
|
|
||||||
- tsconfig/tsconfig/*
|
|
||||||
vars:
|
|
||||||
tox_envlist: py36
|
|
||||||
tox_extra_args: -c tsconfig/tsconfig/tox.ini
|
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: patch-tox-flake8
|
name: patch-tox-flake8
|
||||||
parent: tox
|
parent: tox
|
||||||
|
@ -175,7 +131,6 @@
|
||||||
devstack_services:
|
devstack_services:
|
||||||
# StarlingX services
|
# StarlingX services
|
||||||
sw-patch: true
|
sw-patch: true
|
||||||
tsconfig: true
|
|
||||||
devstack_plugins:
|
devstack_plugins:
|
||||||
# integ: https://opendev.org/starlingx/integ
|
# integ: https://opendev.org/starlingx/integ
|
||||||
update: https://opendev.org/starlingx/update
|
update: https://opendev.org/starlingx/update
|
||||||
|
|
|
@ -33,7 +33,7 @@ install_command = pip install \
|
||||||
deps = -r{toxinidir}/requirements.txt
|
deps = -r{toxinidir}/requirements.txt
|
||||||
-r{toxinidir}/test-requirements.txt
|
-r{toxinidir}/test-requirements.txt
|
||||||
-e{[tox]stxdir}/config/sysinv/sysinv/sysinv
|
-e{[tox]stxdir}/config/sysinv/sysinv/sysinv
|
||||||
-e{[tox]stxdir}/update/tsconfig/tsconfig
|
-e{[tox]stxdir}/config/tsconfig/tsconfig
|
||||||
|
|
||||||
whitelist_externals = find
|
whitelist_externals = find
|
||||||
sh
|
sh
|
||||||
|
|
|
@ -24,9 +24,6 @@ STXUPDATE_DIR=${GITDIR[$STX_UPDATE_NAME]}
|
||||||
STX_PATCH_DIR=$STXUPDATE_DIR/cgcs-patch
|
STX_PATCH_DIR=$STXUPDATE_DIR/cgcs-patch
|
||||||
GITDIR["sw-patch"]=$STX_PATCH_DIR/cgcs-patch
|
GITDIR["sw-patch"]=$STX_PATCH_DIR/cgcs-patch
|
||||||
|
|
||||||
TSCONFIG_DIR=$STXUPDATE_DIR/tsconfig
|
|
||||||
GITDIR["tsconfig"]=$TSCONFIG_DIR/tsconfig
|
|
||||||
|
|
||||||
# STX_INST_DIR should be a non-root-writable place to install build artifacts
|
# STX_INST_DIR should be a non-root-writable place to install build artifacts
|
||||||
STX_INST_DIR=${STX_INST_DIR:-/usr/local}
|
STX_INST_DIR=${STX_INST_DIR:-/usr/local}
|
||||||
STX_BIN_DIR=${STX_BIN_DIR:-$STX_INST_DIR/bin}
|
STX_BIN_DIR=${STX_BIN_DIR:-$STX_INST_DIR/bin}
|
||||||
|
@ -54,20 +51,10 @@ function install_sw_patch {
|
||||||
$STX_SUDO install -m 500 $STX_PATCH_DIR/bin/sw-patch-agent ${stx_patch_sbindir}/sw-patch-agent
|
$STX_SUDO install -m 500 $STX_PATCH_DIR/bin/sw-patch-agent ${stx_patch_sbindir}/sw-patch-agent
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_tsconfig {
|
|
||||||
setup_dev_lib "tsconfig"
|
|
||||||
|
|
||||||
$STX_SUDO install -d -m 755 $STX_BIN_DIR
|
|
||||||
$STX_SUDO install -p -D -m 700 $TSCONFIG_DIR/tsconfig/scripts/tsconfig $STX_BIN_DIR/tsconfig
|
|
||||||
}
|
|
||||||
|
|
||||||
function install_update {
|
function install_update {
|
||||||
if is_service_enabled sw-patch; then
|
if is_service_enabled sw-patch; then
|
||||||
install_sw_patch
|
install_sw_patch
|
||||||
fi
|
fi
|
||||||
if is_service_enabled tsconfig; then
|
|
||||||
install_tsconfig
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$_XTRACE_STX_UPDATE
|
$_XTRACE_STX_UPDATE
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
|
|
||||||
# Services
|
# Services
|
||||||
# sw-patch
|
# sw-patch
|
||||||
# tsconfig
|
|
||||||
|
|
||||||
# Defaults
|
# Defaults
|
||||||
# --------
|
# --------
|
||||||
|
|
|
@ -34,7 +34,7 @@ deps = -r{toxinidir}/requirements.txt
|
||||||
-r{toxinidir}/test-requirements.txt
|
-r{toxinidir}/test-requirements.txt
|
||||||
-e{[tox]stxdir}/config/sysinv/sysinv/sysinv
|
-e{[tox]stxdir}/config/sysinv/sysinv/sysinv
|
||||||
-e{[tox]stxdir}/fault/fm-api
|
-e{[tox]stxdir}/fault/fm-api
|
||||||
-e{[tox]stxdir}/update/tsconfig/tsconfig
|
-e{[tox]stxdir}/config/tsconfig/tsconfig
|
||||||
-e{[tox]stxdir}/update/cgcs-patch/cgcs-patch
|
-e{[tox]stxdir}/update/cgcs-patch/cgcs-patch
|
||||||
|
|
||||||
whitelist_externals = find
|
whitelist_externals = find
|
||||||
|
|
8
tox.ini
8
tox.ini
|
@ -24,14 +24,11 @@ cgcs_patch_dir = {toxinidir}/cgcs-patch/cgcs-patch
|
||||||
cgcs_patch_src_dir = {[testenv]cgcs_patch_dir}/cgcs_patch
|
cgcs_patch_src_dir = {[testenv]cgcs_patch_dir}/cgcs_patch
|
||||||
patch_alarm_dir = {toxinidir}/patch-alarm/patch-alarm
|
patch_alarm_dir = {toxinidir}/patch-alarm/patch-alarm
|
||||||
patch_alarm_src_dir = {[testenv]patch_alarm_dir}/patch_alarm
|
patch_alarm_src_dir = {[testenv]patch_alarm_dir}/patch_alarm
|
||||||
tsconfig_dir = {toxinidir}/tsconfig/tsconfig
|
|
||||||
tsconfig_src_dir = {[testenv]tsconfig_dir}/tsconfig
|
|
||||||
commands = find {toxinidir} -type f -not -path '{toxinidir}/.tox/*' -not -path '*/__pycache__/*' -name '*.py[c|o]' -delete
|
commands = find {toxinidir} -type f -not -path '{toxinidir}/.tox/*' -not -path '*/__pycache__/*' -name '*.py[c|o]' -delete
|
||||||
deps = -r{toxinidir}/requirements.txt
|
deps = -r{toxinidir}/requirements.txt
|
||||||
-r{toxinidir}/test-requirements.txt
|
-r{toxinidir}/test-requirements.txt
|
||||||
-e{[testenv]cgcs_patch_dir}
|
-e{[testenv]cgcs_patch_dir}
|
||||||
-e{[testenv]patch_alarm_dir}
|
-e{[testenv]patch_alarm_dir}
|
||||||
-e{[testenv]tsconfig_dir}
|
|
||||||
whitelist_externals = find
|
whitelist_externals = find
|
||||||
|
|
||||||
[testenv:linters]
|
[testenv:linters]
|
||||||
|
@ -61,7 +58,6 @@ whitelist_externals = cp
|
||||||
tox
|
tox
|
||||||
recreate = True
|
recreate = True
|
||||||
commands = {[testenv]commands}
|
commands = {[testenv]commands}
|
||||||
tox -c tsconfig/tsconfig -e flake8
|
|
||||||
tox -c cgcs-patch/cgcs-patch -e flake8
|
tox -c cgcs-patch/cgcs-patch -e flake8
|
||||||
tox -c patch-alarm/patch-alarm -e flake8
|
tox -c patch-alarm/patch-alarm -e flake8
|
||||||
|
|
||||||
|
@ -80,7 +76,6 @@ whitelist_externals = cp
|
||||||
tox
|
tox
|
||||||
recreate = True
|
recreate = True
|
||||||
commands = {[testenv]commands}
|
commands = {[testenv]commands}
|
||||||
tox -c tsconfig/tsconfig -e py27
|
|
||||||
tox -c cgcs-patch/cgcs-patch -e py27
|
tox -c cgcs-patch/cgcs-patch -e py27
|
||||||
tox -c patch-alarm/patch-alarm -e py27
|
tox -c patch-alarm/patch-alarm -e py27
|
||||||
|
|
||||||
|
@ -92,7 +87,6 @@ whitelist_externals = cp
|
||||||
tox
|
tox
|
||||||
recreate = True
|
recreate = True
|
||||||
commands = {[testenv]commands}
|
commands = {[testenv]commands}
|
||||||
tox -c tsconfig/tsconfig -e py36
|
|
||||||
tox -c cgcs-patch/cgcs-patch -e py36
|
tox -c cgcs-patch/cgcs-patch -e py36
|
||||||
tox -c patch-alarm/patch-alarm -e py36
|
tox -c patch-alarm/patch-alarm -e py36
|
||||||
|
|
||||||
|
@ -104,7 +98,6 @@ whitelist_externals = cp
|
||||||
tox
|
tox
|
||||||
recreate = True
|
recreate = True
|
||||||
commands = {[testenv]commands}
|
commands = {[testenv]commands}
|
||||||
tox -c tsconfig/tsconfig -e pylint
|
|
||||||
tox -c cgcs-patch/cgcs-patch -e pylint
|
tox -c cgcs-patch/cgcs-patch -e pylint
|
||||||
tox -c patch-alarm/patch-alarm -e pylint
|
tox -c patch-alarm/patch-alarm -e pylint
|
||||||
|
|
||||||
|
@ -116,7 +109,6 @@ whitelist_externals = cp
|
||||||
tox
|
tox
|
||||||
recreate = True
|
recreate = True
|
||||||
commands = {[testenv]commands}
|
commands = {[testenv]commands}
|
||||||
tox -c tsconfig/tsconfig -e cover
|
|
||||||
tox -c cgcs-patch/cgcs-patch -e cover
|
tox -c cgcs-patch/cgcs-patch -e cover
|
||||||
tox -c patch-alarm/patch-alarm -e cover
|
tox -c patch-alarm/patch-alarm -e cover
|
||||||
|
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
!.distro
|
|
||||||
.distro/centos7/rpmbuild/RPMS
|
|
||||||
.distro/centos7/rpmbuild/SRPMS
|
|
||||||
.distro/centos7/rpmbuild/BUILD
|
|
||||||
.distro/centos7/rpmbuild/BUILDROOT
|
|
||||||
.distro/centos7/rpmbuild/SOURCES/tsconfig*tar.gz
|
|
202
tsconfig/LICENSE
202
tsconfig/LICENSE
|
@ -1,202 +0,0 @@
|
||||||
|
|
||||||
Apache License
|
|
||||||
Version 2.0, January 2004
|
|
||||||
http://www.apache.org/licenses/
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
||||||
|
|
||||||
1. Definitions.
|
|
||||||
|
|
||||||
"License" shall mean the terms and conditions for use, reproduction,
|
|
||||||
and distribution as defined by Sections 1 through 9 of this document.
|
|
||||||
|
|
||||||
"Licensor" shall mean the copyright owner or entity authorized by
|
|
||||||
the copyright owner that is granting the License.
|
|
||||||
|
|
||||||
"Legal Entity" shall mean the union of the acting entity and all
|
|
||||||
other entities that control, are controlled by, or are under common
|
|
||||||
control with that entity. For the purposes of this definition,
|
|
||||||
"control" means (i) the power, direct or indirect, to cause the
|
|
||||||
direction or management of such entity, whether by contract or
|
|
||||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
||||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
||||||
|
|
||||||
"You" (or "Your") shall mean an individual or Legal Entity
|
|
||||||
exercising permissions granted by this License.
|
|
||||||
|
|
||||||
"Source" form shall mean the preferred form for making modifications,
|
|
||||||
including but not limited to software source code, documentation
|
|
||||||
source, and configuration files.
|
|
||||||
|
|
||||||
"Object" form shall mean any form resulting from mechanical
|
|
||||||
transformation or translation of a Source form, including but
|
|
||||||
not limited to compiled object code, generated documentation,
|
|
||||||
and conversions to other media types.
|
|
||||||
|
|
||||||
"Work" shall mean the work of authorship, whether in Source or
|
|
||||||
Object form, made available under the License, as indicated by a
|
|
||||||
copyright notice that is included in or attached to the work
|
|
||||||
(an example is provided in the Appendix below).
|
|
||||||
|
|
||||||
"Derivative Works" shall mean any work, whether in Source or Object
|
|
||||||
form, that is based on (or derived from) the Work and for which the
|
|
||||||
editorial revisions, annotations, elaborations, or other modifications
|
|
||||||
represent, as a whole, an original work of authorship. For the purposes
|
|
||||||
of this License, Derivative Works shall not include works that remain
|
|
||||||
separable from, or merely link (or bind by name) to the interfaces of,
|
|
||||||
the Work and Derivative Works thereof.
|
|
||||||
|
|
||||||
"Contribution" shall mean any work of authorship, including
|
|
||||||
the original version of the Work and any modifications or additions
|
|
||||||
to that Work or Derivative Works thereof, that is intentionally
|
|
||||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
||||||
or by an individual or Legal Entity authorized to submit on behalf of
|
|
||||||
the copyright owner. For the purposes of this definition, "submitted"
|
|
||||||
means any form of electronic, verbal, or written communication sent
|
|
||||||
to the Licensor or its representatives, including but not limited to
|
|
||||||
communication on electronic mailing lists, source code control systems,
|
|
||||||
and issue tracking systems that are managed by, or on behalf of, the
|
|
||||||
Licensor for the purpose of discussing and improving the Work, but
|
|
||||||
excluding communication that is conspicuously marked or otherwise
|
|
||||||
designated in writing by the copyright owner as "Not a Contribution."
|
|
||||||
|
|
||||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
||||||
on behalf of whom a Contribution has been received by Licensor and
|
|
||||||
subsequently incorporated within the Work.
|
|
||||||
|
|
||||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
copyright license to reproduce, prepare Derivative Works of,
|
|
||||||
publicly display, publicly perform, sublicense, and distribute the
|
|
||||||
Work and such Derivative Works in Source or Object form.
|
|
||||||
|
|
||||||
3. Grant of Patent License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
(except as stated in this section) patent license to make, have made,
|
|
||||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
||||||
where such license applies only to those patent claims licensable
|
|
||||||
by such Contributor that are necessarily infringed by their
|
|
||||||
Contribution(s) alone or by combination of their Contribution(s)
|
|
||||||
with the Work to which such Contribution(s) was submitted. If You
|
|
||||||
institute patent litigation against any entity (including a
|
|
||||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
||||||
or a Contribution incorporated within the Work constitutes direct
|
|
||||||
or contributory patent infringement, then any patent licenses
|
|
||||||
granted to You under this License for that Work shall terminate
|
|
||||||
as of the date such litigation is filed.
|
|
||||||
|
|
||||||
4. Redistribution. You may reproduce and distribute copies of the
|
|
||||||
Work or Derivative Works thereof in any medium, with or without
|
|
||||||
modifications, and in Source or Object form, provided that You
|
|
||||||
meet the following conditions:
|
|
||||||
|
|
||||||
(a) You must give any other recipients of the Work or
|
|
||||||
Derivative Works a copy of this License; and
|
|
||||||
|
|
||||||
(b) You must cause any modified files to carry prominent notices
|
|
||||||
stating that You changed the files; and
|
|
||||||
|
|
||||||
(c) You must retain, in the Source form of any Derivative Works
|
|
||||||
that You distribute, all copyright, patent, trademark, and
|
|
||||||
attribution notices from the Source form of the Work,
|
|
||||||
excluding those notices that do not pertain to any part of
|
|
||||||
the Derivative Works; and
|
|
||||||
|
|
||||||
(d) If the Work includes a "NOTICE" text file as part of its
|
|
||||||
distribution, then any Derivative Works that You distribute must
|
|
||||||
include a readable copy of the attribution notices contained
|
|
||||||
within such NOTICE file, excluding those notices that do not
|
|
||||||
pertain to any part of the Derivative Works, in at least one
|
|
||||||
of the following places: within a NOTICE text file distributed
|
|
||||||
as part of the Derivative Works; within the Source form or
|
|
||||||
documentation, if provided along with the Derivative Works; or,
|
|
||||||
within a display generated by the Derivative Works, if and
|
|
||||||
wherever such third-party notices normally appear. The contents
|
|
||||||
of the NOTICE file are for informational purposes only and
|
|
||||||
do not modify the License. You may add Your own attribution
|
|
||||||
notices within Derivative Works that You distribute, alongside
|
|
||||||
or as an addendum to the NOTICE text from the Work, provided
|
|
||||||
that such additional attribution notices cannot be construed
|
|
||||||
as modifying the License.
|
|
||||||
|
|
||||||
You may add Your own copyright statement to Your modifications and
|
|
||||||
may provide additional or different license terms and conditions
|
|
||||||
for use, reproduction, or distribution of Your modifications, or
|
|
||||||
for any such Derivative Works as a whole, provided Your use,
|
|
||||||
reproduction, and distribution of the Work otherwise complies with
|
|
||||||
the conditions stated in this License.
|
|
||||||
|
|
||||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
||||||
any Contribution intentionally submitted for inclusion in the Work
|
|
||||||
by You to the Licensor shall be under the terms and conditions of
|
|
||||||
this License, without any additional terms or conditions.
|
|
||||||
Notwithstanding the above, nothing herein shall supersede or modify
|
|
||||||
the terms of any separate license agreement you may have executed
|
|
||||||
with Licensor regarding such Contributions.
|
|
||||||
|
|
||||||
6. Trademarks. This License does not grant permission to use the trade
|
|
||||||
names, trademarks, service marks, or product names of the Licensor,
|
|
||||||
except as required for reasonable and customary use in describing the
|
|
||||||
origin of the Work and reproducing the content of the NOTICE file.
|
|
||||||
|
|
||||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
||||||
agreed to in writing, Licensor provides the Work (and each
|
|
||||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
||||||
implied, including, without limitation, any warranties or conditions
|
|
||||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
||||||
appropriateness of using or redistributing the Work and assume any
|
|
||||||
risks associated with Your exercise of permissions under this License.
|
|
||||||
|
|
||||||
8. Limitation of Liability. In no event and under no legal theory,
|
|
||||||
whether in tort (including negligence), contract, or otherwise,
|
|
||||||
unless required by applicable law (such as deliberate and grossly
|
|
||||||
negligent acts) or agreed to in writing, shall any Contributor be
|
|
||||||
liable to You for damages, including any direct, indirect, special,
|
|
||||||
incidental, or consequential damages of any character arising as a
|
|
||||||
result of this License or out of the use or inability to use the
|
|
||||||
Work (including but not limited to damages for loss of goodwill,
|
|
||||||
work stoppage, computer failure or malfunction, or any and all
|
|
||||||
other commercial damages or losses), even if such Contributor
|
|
||||||
has been advised of the possibility of such damages.
|
|
||||||
|
|
||||||
9. Accepting Warranty or Additional Liability. While redistributing
|
|
||||||
the Work or Derivative Works thereof, You may choose to offer,
|
|
||||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
||||||
or other liability obligations and/or rights consistent with this
|
|
||||||
License. However, in accepting such obligations, You may act only
|
|
||||||
on Your own behalf and on Your sole responsibility, not on behalf
|
|
||||||
of any other Contributor, and only if You agree to indemnify,
|
|
||||||
defend, and hold each Contributor harmless for any liability
|
|
||||||
incurred by, or claims asserted against, such Contributor by reason
|
|
||||||
of your accepting any such warranty or additional liability.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
APPENDIX: How to apply the Apache License to your work.
|
|
||||||
|
|
||||||
To apply the Apache License to your work, attach the following
|
|
||||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
||||||
replaced with your own identifying information. (Don't include
|
|
||||||
the brackets!) The text should be enclosed in the appropriate
|
|
||||||
comment syntax for the file format. We also recommend that a
|
|
||||||
file or class name and description of purpose be included on the
|
|
||||||
same "printed page" as the copyright notice for easier
|
|
||||||
identification within third-party archives.
|
|
||||||
|
|
||||||
Copyright [yyyy] [name of copyright owner]
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
|
@ -1,13 +0,0 @@
|
||||||
Metadata-Version: 1.1
|
|
||||||
Name: tsconfig
|
|
||||||
Version: 1.0
|
|
||||||
Summary: Titanium Cloud Config Info
|
|
||||||
Home-page:
|
|
||||||
Author: Windriver
|
|
||||||
Author-email: info@windriver.com
|
|
||||||
License: Apache-2.0
|
|
||||||
|
|
||||||
Description: Titanium Cloud Config Info
|
|
||||||
|
|
||||||
|
|
||||||
Platform: UNKNOWN
|
|
|
@ -1,2 +0,0 @@
|
||||||
SRC_DIR="tsconfig"
|
|
||||||
TIS_PATCH_VER=10
|
|
|
@ -1,62 +0,0 @@
|
||||||
Summary: Titanium Cloud Config Info
|
|
||||||
Name: tsconfig
|
|
||||||
Version: 1.0
|
|
||||||
Release: %{tis_patch_ver}%{?_tis_dist}
|
|
||||||
License: Apache-2.0
|
|
||||||
Group: base
|
|
||||||
Packager: Wind River <info@windriver.com>
|
|
||||||
URL: unknown
|
|
||||||
Source0: %{name}-%{version}.tar.gz
|
|
||||||
|
|
||||||
%define debug_package %{nil}
|
|
||||||
|
|
||||||
BuildRequires: python-setuptools
|
|
||||||
BuildRequires: python2-pip
|
|
||||||
BuildRequires: python2-wheel
|
|
||||||
|
|
||||||
%description
|
|
||||||
Titanium Cloud Config Info
|
|
||||||
|
|
||||||
%define local_dir /usr/
|
|
||||||
%define local_bindir %{local_dir}/bin/
|
|
||||||
%define pythonroot /usr/lib64/python2.7/site-packages
|
|
||||||
|
|
||||||
%prep
|
|
||||||
%setup
|
|
||||||
|
|
||||||
%build
|
|
||||||
%{__python} setup.py build
|
|
||||||
%py2_build_wheel
|
|
||||||
|
|
||||||
%install
|
|
||||||
%{__python} setup.py install --root=$RPM_BUILD_ROOT \
|
|
||||||
--install-lib=%{pythonroot} \
|
|
||||||
--prefix=/usr \
|
|
||||||
--install-data=/usr/share \
|
|
||||||
--single-version-externally-managed
|
|
||||||
mkdir -p $RPM_BUILD_ROOT/wheels
|
|
||||||
install -m 644 dist/*.whl $RPM_BUILD_ROOT/wheels/
|
|
||||||
|
|
||||||
install -d -m 755 %{buildroot}%{local_bindir}
|
|
||||||
install -p -D -m 700 scripts/tsconfig %{buildroot}%{local_bindir}/tsconfig
|
|
||||||
|
|
||||||
%clean
|
|
||||||
rm -rf $RPM_BUILD_ROOT
|
|
||||||
|
|
||||||
%files
|
|
||||||
%defattr(-,root,root,-)
|
|
||||||
%doc LICENSE
|
|
||||||
%{local_bindir}/*
|
|
||||||
%dir %{pythonroot}/%{name}
|
|
||||||
%{pythonroot}/%{name}/*
|
|
||||||
%dir %{pythonroot}/%{name}-%{version}.0-py2.7.egg-info
|
|
||||||
%{pythonroot}/%{name}-%{version}.0-py2.7.egg-info/*
|
|
||||||
|
|
||||||
%package wheels
|
|
||||||
Summary: %{name} wheels
|
|
||||||
|
|
||||||
%description wheels
|
|
||||||
Contains python wheels for %{name}
|
|
||||||
|
|
||||||
%files wheels
|
|
||||||
/wheels/*
|
|
|
@ -1,14 +0,0 @@
|
||||||
Source: tsconfig
|
|
||||||
Priority: optional
|
|
||||||
Maintainer: The StarlingX Developer Team <starlingx-discuss@lists.starlingx.io>
|
|
||||||
Build-Depends: debhelper,
|
|
||||||
dh-python,
|
|
||||||
python-setuptools,
|
|
||||||
python-all
|
|
||||||
|
|
||||||
Standards-Version: 3.9.6
|
|
||||||
Package: tsconfig
|
|
||||||
Architecture: all
|
|
||||||
Depends: ${misc:Depends}, ${python:Depends}
|
|
||||||
Description: This package contains the StarlingX tsconfig project.
|
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
#!/usr/bin/make -f
|
|
||||||
|
|
||||||
export PYBUILD_INSTALL_ARGS=--install-data=/usr/share --prefix=/usr
|
|
||||||
%:
|
|
||||||
dh $@ --with python2 --buildsystem=pybuild
|
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
[run]
|
|
||||||
branch = True
|
|
||||||
source = tsconfig
|
|
||||||
omit = tsconfig/tests/*
|
|
||||||
|
|
||||||
[report]
|
|
||||||
ignore_errors = True
|
|
|
@ -1,2 +0,0 @@
|
||||||
[DEFAULT]
|
|
||||||
test_path=tsconfig/tests
|
|
|
@ -1,202 +0,0 @@
|
||||||
|
|
||||||
Apache License
|
|
||||||
Version 2.0, January 2004
|
|
||||||
http://www.apache.org/licenses/
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
||||||
|
|
||||||
1. Definitions.
|
|
||||||
|
|
||||||
"License" shall mean the terms and conditions for use, reproduction,
|
|
||||||
and distribution as defined by Sections 1 through 9 of this document.
|
|
||||||
|
|
||||||
"Licensor" shall mean the copyright owner or entity authorized by
|
|
||||||
the copyright owner that is granting the License.
|
|
||||||
|
|
||||||
"Legal Entity" shall mean the union of the acting entity and all
|
|
||||||
other entities that control, are controlled by, or are under common
|
|
||||||
control with that entity. For the purposes of this definition,
|
|
||||||
"control" means (i) the power, direct or indirect, to cause the
|
|
||||||
direction or management of such entity, whether by contract or
|
|
||||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
||||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
||||||
|
|
||||||
"You" (or "Your") shall mean an individual or Legal Entity
|
|
||||||
exercising permissions granted by this License.
|
|
||||||
|
|
||||||
"Source" form shall mean the preferred form for making modifications,
|
|
||||||
including but not limited to software source code, documentation
|
|
||||||
source, and configuration files.
|
|
||||||
|
|
||||||
"Object" form shall mean any form resulting from mechanical
|
|
||||||
transformation or translation of a Source form, including but
|
|
||||||
not limited to compiled object code, generated documentation,
|
|
||||||
and conversions to other media types.
|
|
||||||
|
|
||||||
"Work" shall mean the work of authorship, whether in Source or
|
|
||||||
Object form, made available under the License, as indicated by a
|
|
||||||
copyright notice that is included in or attached to the work
|
|
||||||
(an example is provided in the Appendix below).
|
|
||||||
|
|
||||||
"Derivative Works" shall mean any work, whether in Source or Object
|
|
||||||
form, that is based on (or derived from) the Work and for which the
|
|
||||||
editorial revisions, annotations, elaborations, or other modifications
|
|
||||||
represent, as a whole, an original work of authorship. For the purposes
|
|
||||||
of this License, Derivative Works shall not include works that remain
|
|
||||||
separable from, or merely link (or bind by name) to the interfaces of,
|
|
||||||
the Work and Derivative Works thereof.
|
|
||||||
|
|
||||||
"Contribution" shall mean any work of authorship, including
|
|
||||||
the original version of the Work and any modifications or additions
|
|
||||||
to that Work or Derivative Works thereof, that is intentionally
|
|
||||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
||||||
or by an individual or Legal Entity authorized to submit on behalf of
|
|
||||||
the copyright owner. For the purposes of this definition, "submitted"
|
|
||||||
means any form of electronic, verbal, or written communication sent
|
|
||||||
to the Licensor or its representatives, including but not limited to
|
|
||||||
communication on electronic mailing lists, source code control systems,
|
|
||||||
and issue tracking systems that are managed by, or on behalf of, the
|
|
||||||
Licensor for the purpose of discussing and improving the Work, but
|
|
||||||
excluding communication that is conspicuously marked or otherwise
|
|
||||||
designated in writing by the copyright owner as "Not a Contribution."
|
|
||||||
|
|
||||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
||||||
on behalf of whom a Contribution has been received by Licensor and
|
|
||||||
subsequently incorporated within the Work.
|
|
||||||
|
|
||||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
copyright license to reproduce, prepare Derivative Works of,
|
|
||||||
publicly display, publicly perform, sublicense, and distribute the
|
|
||||||
Work and such Derivative Works in Source or Object form.
|
|
||||||
|
|
||||||
3. Grant of Patent License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
(except as stated in this section) patent license to make, have made,
|
|
||||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
||||||
where such license applies only to those patent claims licensable
|
|
||||||
by such Contributor that are necessarily infringed by their
|
|
||||||
Contribution(s) alone or by combination of their Contribution(s)
|
|
||||||
with the Work to which such Contribution(s) was submitted. If You
|
|
||||||
institute patent litigation against any entity (including a
|
|
||||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
||||||
or a Contribution incorporated within the Work constitutes direct
|
|
||||||
or contributory patent infringement, then any patent licenses
|
|
||||||
granted to You under this License for that Work shall terminate
|
|
||||||
as of the date such litigation is filed.
|
|
||||||
|
|
||||||
4. Redistribution. You may reproduce and distribute copies of the
|
|
||||||
Work or Derivative Works thereof in any medium, with or without
|
|
||||||
modifications, and in Source or Object form, provided that You
|
|
||||||
meet the following conditions:
|
|
||||||
|
|
||||||
(a) You must give any other recipients of the Work or
|
|
||||||
Derivative Works a copy of this License; and
|
|
||||||
|
|
||||||
(b) You must cause any modified files to carry prominent notices
|
|
||||||
stating that You changed the files; and
|
|
||||||
|
|
||||||
(c) You must retain, in the Source form of any Derivative Works
|
|
||||||
that You distribute, all copyright, patent, trademark, and
|
|
||||||
attribution notices from the Source form of the Work,
|
|
||||||
excluding those notices that do not pertain to any part of
|
|
||||||
the Derivative Works; and
|
|
||||||
|
|
||||||
(d) If the Work includes a "NOTICE" text file as part of its
|
|
||||||
distribution, then any Derivative Works that You distribute must
|
|
||||||
include a readable copy of the attribution notices contained
|
|
||||||
within such NOTICE file, excluding those notices that do not
|
|
||||||
pertain to any part of the Derivative Works, in at least one
|
|
||||||
of the following places: within a NOTICE text file distributed
|
|
||||||
as part of the Derivative Works; within the Source form or
|
|
||||||
documentation, if provided along with the Derivative Works; or,
|
|
||||||
within a display generated by the Derivative Works, if and
|
|
||||||
wherever such third-party notices normally appear. The contents
|
|
||||||
of the NOTICE file are for informational purposes only and
|
|
||||||
do not modify the License. You may add Your own attribution
|
|
||||||
notices within Derivative Works that You distribute, alongside
|
|
||||||
or as an addendum to the NOTICE text from the Work, provided
|
|
||||||
that such additional attribution notices cannot be construed
|
|
||||||
as modifying the License.
|
|
||||||
|
|
||||||
You may add Your own copyright statement to Your modifications and
|
|
||||||
may provide additional or different license terms and conditions
|
|
||||||
for use, reproduction, or distribution of Your modifications, or
|
|
||||||
for any such Derivative Works as a whole, provided Your use,
|
|
||||||
reproduction, and distribution of the Work otherwise complies with
|
|
||||||
the conditions stated in this License.
|
|
||||||
|
|
||||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
||||||
any Contribution intentionally submitted for inclusion in the Work
|
|
||||||
by You to the Licensor shall be under the terms and conditions of
|
|
||||||
this License, without any additional terms or conditions.
|
|
||||||
Notwithstanding the above, nothing herein shall supersede or modify
|
|
||||||
the terms of any separate license agreement you may have executed
|
|
||||||
with Licensor regarding such Contributions.
|
|
||||||
|
|
||||||
6. Trademarks. This License does not grant permission to use the trade
|
|
||||||
names, trademarks, service marks, or product names of the Licensor,
|
|
||||||
except as required for reasonable and customary use in describing the
|
|
||||||
origin of the Work and reproducing the content of the NOTICE file.
|
|
||||||
|
|
||||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
||||||
agreed to in writing, Licensor provides the Work (and each
|
|
||||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
||||||
implied, including, without limitation, any warranties or conditions
|
|
||||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
||||||
appropriateness of using or redistributing the Work and assume any
|
|
||||||
risks associated with Your exercise of permissions under this License.
|
|
||||||
|
|
||||||
8. Limitation of Liability. In no event and under no legal theory,
|
|
||||||
whether in tort (including negligence), contract, or otherwise,
|
|
||||||
unless required by applicable law (such as deliberate and grossly
|
|
||||||
negligent acts) or agreed to in writing, shall any Contributor be
|
|
||||||
liable to You for damages, including any direct, indirect, special,
|
|
||||||
incidental, or consequential damages of any character arising as a
|
|
||||||
result of this License or out of the use or inability to use the
|
|
||||||
Work (including but not limited to damages for loss of goodwill,
|
|
||||||
work stoppage, computer failure or malfunction, or any and all
|
|
||||||
other commercial damages or losses), even if such Contributor
|
|
||||||
has been advised of the possibility of such damages.
|
|
||||||
|
|
||||||
9. Accepting Warranty or Additional Liability. While redistributing
|
|
||||||
the Work or Derivative Works thereof, You may choose to offer,
|
|
||||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
||||||
or other liability obligations and/or rights consistent with this
|
|
||||||
License. However, in accepting such obligations, You may act only
|
|
||||||
on Your own behalf and on Your sole responsibility, not on behalf
|
|
||||||
of any other Contributor, and only if You agree to indemnify,
|
|
||||||
defend, and hold each Contributor harmless for any liability
|
|
||||||
incurred by, or claims asserted against, such Contributor by reason
|
|
||||||
of your accepting any such warranty or additional liability.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
APPENDIX: How to apply the Apache License to your work.
|
|
||||||
|
|
||||||
To apply the Apache License to your work, attach the following
|
|
||||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
||||||
replaced with your own identifying information. (Don't include
|
|
||||||
the brackets!) The text should be enclosed in the appropriate
|
|
||||||
comment syntax for the file format. We also recommend that a
|
|
||||||
file or class name and description of purpose be included on the
|
|
||||||
same "printed page" as the copyright notice for easier
|
|
||||||
identification within third-party archives.
|
|
||||||
|
|
||||||
Copyright [yyyy] [name of copyright owner]
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
|
@ -1,218 +0,0 @@
|
||||||
[MASTER]
|
|
||||||
# Specify a configuration file.
|
|
||||||
rcfile=pylint.rc
|
|
||||||
|
|
||||||
# Python code to execute, usually for sys.path manipulation such as pygtk.require().
|
|
||||||
#init-hook=
|
|
||||||
|
|
||||||
# Add files or directories to the blacklist. They should be base names, not paths.
|
|
||||||
ignore=tests
|
|
||||||
|
|
||||||
# Pickle collected data for later comparisons.
|
|
||||||
persistent=yes
|
|
||||||
|
|
||||||
# List of plugins (as comma separated values of python modules names) to load,
|
|
||||||
# usually to register additional checkers.
|
|
||||||
load-plugins=
|
|
||||||
|
|
||||||
|
|
||||||
[MESSAGES CONTROL]
|
|
||||||
# Enable the message, report, category or checker with the given id(s). You can
|
|
||||||
# either give multiple identifier separated by comma (,) or put this option
|
|
||||||
# multiple time.
|
|
||||||
#enable=
|
|
||||||
|
|
||||||
# Disable the message, report, category or checker with the given id(s). You
|
|
||||||
# can either give multiple identifier separated by comma (,) or put this option
|
|
||||||
# multiple time (only on the command line, not in the configuration file where
|
|
||||||
# it should appear only once).
|
|
||||||
# W0603 Using the global statement warning
|
|
||||||
# W0612 Unused variable warning
|
|
||||||
# W0613 Unused argument warning
|
|
||||||
# W0702 bare-except
|
|
||||||
# W0703 broad except warning
|
|
||||||
# W1201 logging-not-lazy
|
|
||||||
disable=C, R, W0603, W0612, W0613, W0702, W0703, W1201
|
|
||||||
|
|
||||||
|
|
||||||
[REPORTS]
|
|
||||||
# Set the output format. Available formats are text, parseable, colorized, msvs
|
|
||||||
# (visual studio) and html
|
|
||||||
output-format=text
|
|
||||||
|
|
||||||
# Put messages in a separate file for each module / package specified on the
|
|
||||||
# command line instead of printing them on stdout. Reports (if any) will be
|
|
||||||
# written in a file name "pylint_global.[txt|html]".
|
|
||||||
files-output=no
|
|
||||||
|
|
||||||
# Tells whether to display a full report or only the messages
|
|
||||||
reports=no
|
|
||||||
|
|
||||||
# Python expression which should return a note less than 10 (10 is the highest
|
|
||||||
# note). You have access to the variables errors warning, statement which
|
|
||||||
# respectively contain the number of errors / warnings messages and the total
|
|
||||||
# number of statements analyzed. This is used by the global evaluation report
|
|
||||||
# (RP0004).
|
|
||||||
evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
|
|
||||||
|
|
||||||
|
|
||||||
[SIMILARITIES]
|
|
||||||
# Minimum lines number of a similarity.
|
|
||||||
min-similarity-lines=4
|
|
||||||
|
|
||||||
# Ignore comments when computing similarities.
|
|
||||||
ignore-comments=yes
|
|
||||||
|
|
||||||
# Ignore docstrings when computing similarities.
|
|
||||||
ignore-docstrings=yes
|
|
||||||
|
|
||||||
|
|
||||||
[FORMAT]
|
|
||||||
# Maximum number of characters on a single line.
|
|
||||||
max-line-length=85
|
|
||||||
|
|
||||||
# Maximum number of lines in a module
|
|
||||||
max-module-lines=1000
|
|
||||||
|
|
||||||
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 tab).
|
|
||||||
indent-string=' '
|
|
||||||
|
|
||||||
|
|
||||||
[TYPECHECK]
|
|
||||||
# Tells whether missing members accessed in mixin class should be ignored. A
|
|
||||||
# mixin class is detected if its name ends with "mixin" (case insensitive).
|
|
||||||
ignore-mixin-members=yes
|
|
||||||
|
|
||||||
# List of classes names for which member attributes should not be checked
|
|
||||||
# (useful for classes with attributes dynamically set).
|
|
||||||
ignored-classes=rpm
|
|
||||||
|
|
||||||
# List of members which are set dynamically and missed by pylint inference
|
|
||||||
# system, and so shouldn't trigger E0201 when accessed. Python regular
|
|
||||||
# expressions are accepted.
|
|
||||||
generated-members=REQUEST,acl_users,aq_parent
|
|
||||||
|
|
||||||
|
|
||||||
[BASIC]
|
|
||||||
# List of builtins function names that should not be used, separated by a comma
|
|
||||||
bad-functions=map,filter,apply,input
|
|
||||||
|
|
||||||
# Regular expression which should only match correct module names
|
|
||||||
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
|
|
||||||
|
|
||||||
# Regular expression which should only match correct module level names
|
|
||||||
const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
|
|
||||||
|
|
||||||
# Regular expression which should only match correct class names
|
|
||||||
class-rgx=[A-Z_][a-zA-Z0-9]+$
|
|
||||||
|
|
||||||
# Regular expression which should only match correct function names
|
|
||||||
function-rgx=[a-z_][a-z0-9_]{2,30}$
|
|
||||||
|
|
||||||
# Regular expression which should only match correct method names
|
|
||||||
method-rgx=[a-z_][a-z0-9_]{2,30}$
|
|
||||||
|
|
||||||
# Regular expression which should only match correct instance attribute names
|
|
||||||
attr-rgx=[a-z_][a-z0-9_]{2,30}$
|
|
||||||
|
|
||||||
# Regular expression which should only match correct argument names
|
|
||||||
argument-rgx=[a-z_][a-z0-9_]{2,30}$
|
|
||||||
|
|
||||||
# Regular expression which should only match correct variable names
|
|
||||||
variable-rgx=[a-z_][a-z0-9_]{2,30}$
|
|
||||||
|
|
||||||
# Regular expression which should only match correct list comprehension /
|
|
||||||
# generator expression variable names
|
|
||||||
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
|
|
||||||
|
|
||||||
# Good variable names which should always be accepted, separated by a comma
|
|
||||||
good-names=i,j,k,ex,Run,_
|
|
||||||
|
|
||||||
# Bad variable names which should always be refused, separated by a comma
|
|
||||||
bad-names=foo,bar,baz,toto,tutu,tata
|
|
||||||
|
|
||||||
# Regular expression which should only match functions or classes name which do
|
|
||||||
# not require a docstring
|
|
||||||
no-docstring-rgx=__.*__
|
|
||||||
|
|
||||||
|
|
||||||
[MISCELLANEOUS]
|
|
||||||
# List of note tags to take in consideration, separated by a comma.
|
|
||||||
notes=FIXME,XXX,TODO
|
|
||||||
|
|
||||||
|
|
||||||
[VARIABLES]
|
|
||||||
# Tells whether we should check for unused import in __init__ files.
|
|
||||||
init-import=no
|
|
||||||
|
|
||||||
# A regular expression matching the beginning of the name of dummy variables
|
|
||||||
# (i.e. not used).
|
|
||||||
dummy-variables-rgx=_|dummy
|
|
||||||
|
|
||||||
# List of additional names supposed to be defined in builtins. Remember that
|
|
||||||
# you should avoid to define new builtins when possible.
|
|
||||||
additional-builtins=
|
|
||||||
|
|
||||||
|
|
||||||
[IMPORTS]
|
|
||||||
# Deprecated modules which should not be used, separated by a comma
|
|
||||||
deprecated-modules=regsub,string,TERMIOS,Bastion,rexec
|
|
||||||
|
|
||||||
# Create a graph of every (i.e. internal and external) dependencies in the
|
|
||||||
# given file (report RP0402 must not be disabled)
|
|
||||||
import-graph=
|
|
||||||
|
|
||||||
# Create a graph of external dependencies in the given file (report RP0402 must
|
|
||||||
# not be disabled)
|
|
||||||
ext-import-graph=
|
|
||||||
|
|
||||||
# Create a graph of internal dependencies in the given file (report RP0402 must
|
|
||||||
# not be disabled)
|
|
||||||
int-import-graph=
|
|
||||||
|
|
||||||
|
|
||||||
[DESIGN]
|
|
||||||
# Maximum number of arguments for function / method
|
|
||||||
max-args=5
|
|
||||||
|
|
||||||
# Argument names that match this expression will be ignored. Default to name
|
|
||||||
# with leading underscore
|
|
||||||
ignored-argument-names=_.*
|
|
||||||
|
|
||||||
# Maximum number of locals for function / method body
|
|
||||||
max-locals=15
|
|
||||||
|
|
||||||
# Maximum number of return / yield for function / method body
|
|
||||||
max-returns=6
|
|
||||||
|
|
||||||
# Maximum number of branch for function / method body
|
|
||||||
max-branches=12
|
|
||||||
|
|
||||||
# Maximum number of statements in function / method body
|
|
||||||
max-statements=50
|
|
||||||
|
|
||||||
# Maximum number of parents for a class (see R0901).
|
|
||||||
max-parents=7
|
|
||||||
|
|
||||||
# Maximum number of attributes for a class (see R0902).
|
|
||||||
max-attributes=7
|
|
||||||
|
|
||||||
# Minimum number of public methods for a class (see R0903).
|
|
||||||
min-public-methods=2
|
|
||||||
|
|
||||||
# Maximum number of public methods for a class (see R0904).
|
|
||||||
max-public-methods=20
|
|
||||||
|
|
||||||
|
|
||||||
[CLASSES]
|
|
||||||
# List of method names used to declare (i.e. assign) instance attributes.
|
|
||||||
defining-attr-methods=__init__,__new__,setUp
|
|
||||||
|
|
||||||
# List of valid names for the first argument in a class method.
|
|
||||||
valid-classmethod-first-arg=cls
|
|
||||||
|
|
||||||
|
|
||||||
[EXCEPTIONS]
|
|
||||||
# Exceptions that will emit a warning when being caught. Defaults to
|
|
||||||
# "Exception"
|
|
||||||
overgeneral-exceptions=Exception
|
|
|
@ -1,4 +0,0 @@
|
||||||
# The order of packages is significant, because pip processes them in the order
|
|
||||||
# of appearance. Changing the order has an impact on the overall integration
|
|
||||||
# process, which may cause wedges in the gate later.
|
|
||||||
|
|
|
@ -1,48 +0,0 @@
|
||||||
. /etc/build.info
|
|
||||||
|
|
||||||
#
|
|
||||||
# Keep the following path and flag declarations in sync with tsconfig.py
|
|
||||||
#
|
|
||||||
|
|
||||||
# Platform configuration paths and files
|
|
||||||
|
|
||||||
PLATFORM_CONF_PATH=/etc/platform
|
|
||||||
PLATFORM_CONF_FILE=${PLATFORM_CONF_PATH}/platform.conf
|
|
||||||
PLATFORM_SIMPLEX_FLAG=${PLATFORM_CONF_PATH}/simplex
|
|
||||||
|
|
||||||
VOLATILE_PATH=/var/run
|
|
||||||
PLATFORM_PATH=/opt/platform
|
|
||||||
CONFIG_PATH=${PLATFORM_PATH}/config/${SW_VERSION}
|
|
||||||
PUPPET_PATH=${PLATFORM_PATH}/puppet/${SW_VERSION}
|
|
||||||
|
|
||||||
# System configuration flags
|
|
||||||
INITIAL_CONFIG_COMPLETE_FLAG=${PLATFORM_CONF_PATH}/.initial_config_complete
|
|
||||||
|
|
||||||
# Worker configuration flags
|
|
||||||
|
|
||||||
# Set after the first application of worker manifests
|
|
||||||
INITIAL_WORKER_CONFIG_COMPLETE=${PLATFORM_CONF_PATH}/.initial_worker_config_complete
|
|
||||||
# Set after each application of worker manifests
|
|
||||||
VOLATILE_WORKER_CONFIG_COMPLETE=${VOLATILE_PATH}/.worker_config_complete
|
|
||||||
# Set to prevent starting worker services (used in combined node upgrade)
|
|
||||||
VOLATILE_DISABLE_WORKER_SERVICES=${VOLATILE_PATH}/.disable_worker_services
|
|
||||||
|
|
||||||
# Upgrade flags
|
|
||||||
|
|
||||||
# Set on controller-0 to force controller-1 to do an upgrade after install.
|
|
||||||
CONTROLLER_UPGRADE_FLAG=${PLATFORM_CONF_PATH}/.upgrade_controller_1
|
|
||||||
# Set on controller-0 (by controller-1) to indicate a completed upgrade.
|
|
||||||
CONTROLLER_UPGRADE_COMPLETE_FLAG=${PLATFORM_CONF_PATH}/.upgrade_controller_1_complete
|
|
||||||
# Set on controller-0 (by controller-1) to indicate a failed upgrade data migration
|
|
||||||
CONTROLLER_UPGRADE_FAIL_FLAG=${PLATFORM_CONF_PATH}/.upgrade_controller_1_fail
|
|
||||||
# Set on controller-1 to indicate we are rolling back the upgrade
|
|
||||||
UPGRADE_ROLLBACK_FLAG=${PLATFORM_CONF_PATH}/.upgrade_rollback
|
|
||||||
# Set on controller-1 to indicate we are aborting the upgrade
|
|
||||||
UPGRADE_ABORT_FILE=.upgrade_abort
|
|
||||||
UPGRADE_ABORT_FLAG=${CONFIG_PATH}/${UPGRADE_ABORT_FILE}
|
|
||||||
# Set on controller-0 (by controller-1) to indicate that data migration has started
|
|
||||||
CONTROLLER_UPGRADE_STARTED_FLAG=${PLATFORM_CONF_PATH}/.upgrade_controller_1_started
|
|
||||||
|
|
||||||
# Backup / Restore flags
|
|
||||||
BACKUP_IN_PROGRESS_FLAG=${PLATFORM_CONF_PATH}/.backup_in_progress
|
|
||||||
RESTORE_IN_PROGRESS_FLAG=${PLATFORM_CONF_PATH}/.restore_in_progress
|
|
|
@ -1,25 +0,0 @@
|
||||||
[metadata]
|
|
||||||
license_files = LICENSE
|
|
||||||
name = tsconfig
|
|
||||||
classifier =
|
|
||||||
Environment :: OpenStack
|
|
||||||
Intended Audience :: Information Technology
|
|
||||||
Intended Audience :: System Administrators
|
|
||||||
License :: OSI Approved :: Apache Software License
|
|
||||||
Operating System :: POSIX :: Linux
|
|
||||||
Programming Language :: Python
|
|
||||||
Programming Language :: Python :: 2
|
|
||||||
Programming Language :: Python :: 2.7
|
|
||||||
Programming Language :: Python :: 3
|
|
||||||
Programming Language :: Python :: 3.5
|
|
||||||
|
|
||||||
[files]
|
|
||||||
packages =
|
|
||||||
tsconfig
|
|
||||||
|
|
||||||
[nosetests]
|
|
||||||
cover-erase = true
|
|
||||||
verbosity = 2
|
|
||||||
|
|
||||||
[wheel]
|
|
||||||
universal = 1
|
|
|
@ -1,19 +0,0 @@
|
||||||
#!/usr/bin/env python
|
|
||||||
|
|
||||||
"""
|
|
||||||
Copyright (c) 2014 Wind River Systems, Inc.
|
|
||||||
|
|
||||||
SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
import setuptools
|
|
||||||
|
|
||||||
setuptools.setup(
|
|
||||||
name='tsconfig',
|
|
||||||
version='1.0.0',
|
|
||||||
description='tsconfig',
|
|
||||||
license='Apache-2.0',
|
|
||||||
packages=['tsconfig'],
|
|
||||||
entry_points={}
|
|
||||||
)
|
|
|
@ -1,10 +0,0 @@
|
||||||
# The order of packages is significant, because pip processes them in the order
|
|
||||||
# of appearance. Changing the order has an impact on the overall integration
|
|
||||||
# process, which may cause wedges in the gate later.
|
|
||||||
|
|
||||||
hacking>=1.1.0 # Apache-2.0
|
|
||||||
|
|
||||||
coverage!=4.4,>=4.0 # Apache-2.0
|
|
||||||
mock>=2.0.0 # BSD
|
|
||||||
stestr>=1.0.0 # Apache-2.0
|
|
||||||
testtools>=2.2.0 # MIT
|
|
|
@ -1,82 +0,0 @@
|
||||||
#
|
|
||||||
# Copyright (c) 2019 Wind River Systems, Inc.
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
#
|
|
||||||
|
|
||||||
[tox]
|
|
||||||
envlist = flake8,py27,py36,pylint,cover
|
|
||||||
minversion = 2.3.2
|
|
||||||
|
|
||||||
[testenv]
|
|
||||||
setenv = VIRTUAL_ENV={envdir}
|
|
||||||
PYTHONWARNINGS=default::DeprecationWarning
|
|
||||||
OS_STDOUT_CAPTURE=1
|
|
||||||
OS_STDERR_CAPTURE=1
|
|
||||||
OS_TEST_TIMEOUT=60
|
|
||||||
OS_TEST_PATH=./tsconfig/tests
|
|
||||||
usedevelop = True
|
|
||||||
install_command = pip install {opts} {packages}
|
|
||||||
|
|
||||||
deps = -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/stable/stein/upper-constraints.txt}
|
|
||||||
-r{toxinidir}/requirements.txt
|
|
||||||
-r{toxinidir}/test-requirements.txt
|
|
||||||
|
|
||||||
whitelist_externals = find
|
|
||||||
sh
|
|
||||||
|
|
||||||
[testenv:stestr]
|
|
||||||
commands =
|
|
||||||
find . -name "*.pyc" -delete
|
|
||||||
stestr run {posargs}
|
|
||||||
stestr slowest
|
|
||||||
|
|
||||||
[testenv:py27]
|
|
||||||
basepython = python2.7
|
|
||||||
commands = {[testenv:stestr]commands}
|
|
||||||
|
|
||||||
[testenv:py36]
|
|
||||||
basepython = python3.6
|
|
||||||
commands = {[testenv:stestr]commands}
|
|
||||||
|
|
||||||
[flake8]
|
|
||||||
# ignore below errors , will fix flake8 errors in future
|
|
||||||
# H102 Apache 2.0 license header not found
|
|
||||||
# H306 imports not in alphabetical order
|
|
||||||
# F401 'XXXXX' imported but unused
|
|
||||||
show-source = True
|
|
||||||
#ignore = H102,H306,F401
|
|
||||||
ignore = H102,H306,F401
|
|
||||||
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,release-tag-*
|
|
||||||
# TODO: H106 Don't put vim configuration in source files (off by default).
|
|
||||||
# H203 Use assertIs(Not)None to check for None (off by default).
|
|
||||||
# TODO: enable: H904 Delay string interpolations at logging calls (off by default).
|
|
||||||
enable-extensions = H106 H203 H904
|
|
||||||
max-line-length = 120
|
|
||||||
|
|
||||||
|
|
||||||
[testenv:flake8]
|
|
||||||
basepython = python2.7
|
|
||||||
usedevelop = False
|
|
||||||
skip_install = True
|
|
||||||
commands =
|
|
||||||
flake8 {posargs} .
|
|
||||||
|
|
||||||
[testenv:pylint]
|
|
||||||
deps = {[testenv]deps}
|
|
||||||
pylint
|
|
||||||
basepython = python2.7
|
|
||||||
|
|
||||||
commands = pylint tsconfig --rcfile=./pylint.rc
|
|
||||||
|
|
||||||
[testenv:cover]
|
|
||||||
setenv =
|
|
||||||
PYTHON=coverage run --parallel-mode
|
|
||||||
PYTHONDONTWRITEBYTECODE=True
|
|
||||||
commands = coverage erase
|
|
||||||
find . -name "*.pyc" -delete
|
|
||||||
stestr run {posargs}
|
|
||||||
coverage combine
|
|
||||||
coverage html -d cover
|
|
||||||
coverage xml -o cover/coverage.xml
|
|
||||||
coverage report
|
|
|
@ -1,6 +0,0 @@
|
||||||
"""
|
|
||||||
Copyright (c) 2014 Wind River Systems, Inc.
|
|
||||||
|
|
||||||
SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
"""
|
|
|
@ -1,197 +0,0 @@
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
#
|
|
||||||
|
|
||||||
import io
|
|
||||||
import mock
|
|
||||||
import six # pylint: disable=unused-import
|
|
||||||
import sys
|
|
||||||
import testtools
|
|
||||||
|
|
||||||
|
|
||||||
class TsConfigTestCase(testtools.TestCase):
|
|
||||||
|
|
||||||
mock_19_09_build = u"""
|
|
||||||
###
|
|
||||||
### StarlingX
|
|
||||||
### Release 19.09
|
|
||||||
###
|
|
||||||
|
|
||||||
OS="centos"
|
|
||||||
SW_VERSION="19.09"
|
|
||||||
BUILD_TARGET="Host Installer"
|
|
||||||
BUILD_TYPE="Formal"
|
|
||||||
BUILD_ID="f/stein"
|
|
||||||
|
|
||||||
JOB="STX_build_stein_master"
|
|
||||||
BUILD_BY="starlingx.build@cengn.ca"
|
|
||||||
BUILD_NUMBER="52"
|
|
||||||
BUILD_HOST="starlingx_mirror"
|
|
||||||
BUILD_DATE="2019-02-22 19:18:29 +0000"
|
|
||||||
"""
|
|
||||||
|
|
||||||
mock_malformed_build = u"""
|
|
||||||
###
|
|
||||||
### StarlingX
|
|
||||||
### Release 19.09
|
|
||||||
nodetype=
|
|
||||||
"""
|
|
||||||
|
|
||||||
mock_platform_conf_empty = u""
|
|
||||||
|
|
||||||
# Note: subfunction list cannot contain spaces
|
|
||||||
mock_platform_conf_minimal = u"""
|
|
||||||
nodetype=something
|
|
||||||
subfunction= subfunction1,subfunction2
|
|
||||||
"""
|
|
||||||
|
|
||||||
mock_platform_conf = u"""
|
|
||||||
nodetype=controller
|
|
||||||
subfunction=controller
|
|
||||||
system_type=Standard
|
|
||||||
security_profile=extended
|
|
||||||
management_interface=enp10s0f1
|
|
||||||
http_port=8080
|
|
||||||
INSTALL_UUID=ab0a5348-cea7-4b08-b1b0-09d5527dd227
|
|
||||||
UUID=a1c581fc-0c74-4e68-b78e-4e26a0695f5d
|
|
||||||
oam_interface=enp0s3
|
|
||||||
cluster_host_interface=enp0s4
|
|
||||||
sdn_enabled=no
|
|
||||||
region_config=no
|
|
||||||
system_mode=duplex
|
|
||||||
sw_version=19.09
|
|
||||||
security_feature="nopti nospectre_v2"
|
|
||||||
vswitch_type=ovs-dpdk
|
|
||||||
"""
|
|
||||||
|
|
||||||
mock_platform_conf_regions = u"""
|
|
||||||
nodetype=controller
|
|
||||||
subfunction=controller
|
|
||||||
system_type=Standard
|
|
||||||
security_profile=extended
|
|
||||||
management_interface=enp10s0f1
|
|
||||||
http_port=8081
|
|
||||||
INSTALL_UUID=ab0a5348-cea7-4b08-b1b0-09d5527dd227
|
|
||||||
UUID=a1c581fc-0c74-4e68-b78e-4e26a0695f5d
|
|
||||||
oam_interface=enp0s3
|
|
||||||
cluster_host_interface=enp0s4
|
|
||||||
sdn_enabled=no
|
|
||||||
region_config=no
|
|
||||||
region_1_name=Region1
|
|
||||||
region_2_name=Region2
|
|
||||||
distributed_cloud_role=CloudRole
|
|
||||||
system_mode=duplex
|
|
||||||
sw_version=19.09
|
|
||||||
security_feature="nopti nospectre_v2"
|
|
||||||
vswitch_type=ovs-dpdk
|
|
||||||
"""
|
|
||||||
|
|
||||||
def tearDown(self):
|
|
||||||
super(TsConfigTestCase, self).tearDown()
|
|
||||||
# These are import tests so unimport tsconfig and tsconfig.tsconfig
|
|
||||||
# during teardown, otherwise all the other tests will fail
|
|
||||||
try:
|
|
||||||
del sys.modules['tsconfig.tsconfig']
|
|
||||||
del sys.modules['tsconfig']
|
|
||||||
except KeyError:
|
|
||||||
print('tsconfig modules failed to import, so no cleanup required')
|
|
||||||
|
|
||||||
# If the build.info file is missing, a special version is returned
|
|
||||||
def test_tconfig_missing_build_info(self):
|
|
||||||
from tsconfig import tsconfig
|
|
||||||
ver = tsconfig.SW_VERSION # pylint: disable=no-member
|
|
||||||
self.assertEqual(ver, "TEST.SW.VERSION")
|
|
||||||
|
|
||||||
# If build info is malformed, the platform.conf is not loaded
|
|
||||||
@mock.patch('logging.exception')
|
|
||||||
@mock.patch('six.moves.builtins.open')
|
|
||||||
@mock.patch('os.path.isfile', return_value=True)
|
|
||||||
def test_tsconfig_missing_version(self,
|
|
||||||
mock_isfile,
|
|
||||||
mock_open,
|
|
||||||
mock_logging_exception):
|
|
||||||
# two files are opened by tsconfig.
|
|
||||||
# 1st: /etc/build.info
|
|
||||||
# 2nd: /etc/platform/platform.conf
|
|
||||||
mock_open.return_value = io.StringIO(self.mock_malformed_build)
|
|
||||||
from tsconfig import tsconfig # pylint: disable=unused-variable
|
|
||||||
mock_logging_exception.assert_called_once()
|
|
||||||
|
|
||||||
# This tests the behaviour when the platform.conf is missing
|
|
||||||
@mock.patch('logging.exception')
|
|
||||||
@mock.patch('six.moves.builtins.open')
|
|
||||||
@mock.patch('os.path.isfile', return_value=True)
|
|
||||||
def test_tsconfig_missing_platform_conf(self,
|
|
||||||
mock_isfile,
|
|
||||||
mock_open,
|
|
||||||
mock_logging_exception):
|
|
||||||
# two files are opened by tsconfig.
|
|
||||||
# 1st: /etc/build.info
|
|
||||||
# 2nd: /etc/platform/platform.conf
|
|
||||||
mock_open.return_value = io.StringIO(self.mock_19_09_build)
|
|
||||||
from tsconfig import tsconfig # pylint: disable=unused-variable
|
|
||||||
mock_logging_exception.assert_called_once()
|
|
||||||
|
|
||||||
# This tests the behaviour when the platform.conf is empty
|
|
||||||
@mock.patch('logging.exception')
|
|
||||||
@mock.patch('six.moves.builtins.open')
|
|
||||||
@mock.patch('os.path.isfile', return_value=True)
|
|
||||||
def test_tsconfig_empty(self,
|
|
||||||
mock_isfile,
|
|
||||||
mock_open,
|
|
||||||
mock_logging_exception):
|
|
||||||
# two files are opened by tsconfig.
|
|
||||||
# 1st: /etc/build.info
|
|
||||||
# 2nd: /etc/platform/platform.conf
|
|
||||||
mock_open.side_effect = [io.StringIO(self.mock_19_09_build),
|
|
||||||
io.StringIO(self.mock_platform_conf_empty)]
|
|
||||||
from tsconfig import tsconfig # pylint: disable=unused-variable
|
|
||||||
mock_logging_exception.assert_called_once()
|
|
||||||
|
|
||||||
# This tests the behaviour when the platform.conf has the minimal entries
|
|
||||||
@mock.patch('six.moves.builtins.open')
|
|
||||||
@mock.patch('os.path.isfile', return_value=True)
|
|
||||||
def test_tsconfig_minimal(self, mock_isfile, mock_open):
|
|
||||||
# two files are opened by tsconfig.
|
|
||||||
# 1st: /etc/build.info
|
|
||||||
# 2nd: /etc/platform/platform.conf
|
|
||||||
mock_open.side_effect = [io.StringIO(self.mock_19_09_build),
|
|
||||||
io.StringIO(self.mock_platform_conf_minimal)]
|
|
||||||
from tsconfig import tsconfig
|
|
||||||
val = tsconfig.nodetype
|
|
||||||
self.assertEqual(val, "something")
|
|
||||||
val = tsconfig.subfunctions
|
|
||||||
self.assertEqual(set(val), set(["subfunction1", "subfunction2"]))
|
|
||||||
|
|
||||||
@mock.patch('six.moves.builtins.open')
|
|
||||||
@mock.patch('os.path.isfile', return_value=True)
|
|
||||||
def test_tsconfig(self, mock_isfile, mock_open):
|
|
||||||
# two files are opened by tsconfig.
|
|
||||||
# 1st: /etc/build.info
|
|
||||||
# 2nd: /etc/platform/platform.conf
|
|
||||||
mock_open.side_effect = [io.StringIO(self.mock_19_09_build),
|
|
||||||
io.StringIO(self.mock_platform_conf)]
|
|
||||||
from tsconfig import tsconfig
|
|
||||||
ver = tsconfig.SW_VERSION
|
|
||||||
self.assertEqual(ver, "19.09")
|
|
||||||
|
|
||||||
@mock.patch('six.moves.builtins.open')
|
|
||||||
@mock.patch('os.path.isfile', return_value=True)
|
|
||||||
def test_tsconfig_reload(self, mock_isfile, mock_open):
|
|
||||||
# two files are opened by tsconfig.
|
|
||||||
# 1st: /etc/build.info
|
|
||||||
# 2nd: /etc/platform/platform.conf
|
|
||||||
# Next two files are loaded as part of reload
|
|
||||||
mock_open.side_effect = [io.StringIO(self.mock_19_09_build),
|
|
||||||
io.StringIO(self.mock_platform_conf),
|
|
||||||
io.StringIO(self.mock_19_09_build),
|
|
||||||
io.StringIO(self.mock_platform_conf_regions)]
|
|
||||||
from tsconfig import tsconfig
|
|
||||||
# Initial platform.conf has no region names
|
|
||||||
# reload will set the region 1 and region 2 names
|
|
||||||
self.assertIsNone(tsconfig.region_1_name)
|
|
||||||
self.assertIsNone(tsconfig.region_2_name)
|
|
||||||
# the platform.conf is changed, call load again to see the change
|
|
||||||
tsconfig._load() # pylint: disable=protected-access
|
|
||||||
self.assertIsNotNone(tsconfig.region_1_name)
|
|
||||||
self.assertIsNotNone(tsconfig.region_2_name)
|
|
|
@ -1,245 +0,0 @@
|
||||||
"""
|
|
||||||
Copyright (c) 2014-2019 Wind River Systems, Inc.
|
|
||||||
|
|
||||||
SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
import os
|
|
||||||
from six.moves import configparser
|
|
||||||
import io
|
|
||||||
import logging
|
|
||||||
|
|
||||||
SW_VERSION = ""
|
|
||||||
SW_VERSION_1610 = '16.10'
|
|
||||||
SW_VERSION_1706 = '17.06'
|
|
||||||
SW_VERSION_1803 = '18.03'
|
|
||||||
|
|
||||||
nodetype = None
|
|
||||||
subfunctions = []
|
|
||||||
region_config = "no"
|
|
||||||
region_1_name = None
|
|
||||||
region_2_name = None
|
|
||||||
vswitch_type = None
|
|
||||||
management_interface = None
|
|
||||||
oam_interface = None
|
|
||||||
cluster_host_interface = None
|
|
||||||
sdn_enabled = "no"
|
|
||||||
host_uuid = None
|
|
||||||
install_uuid = None
|
|
||||||
system_type = None
|
|
||||||
system_mode = None
|
|
||||||
security_profile = None
|
|
||||||
distributed_cloud_role = None
|
|
||||||
security_feature = None
|
|
||||||
http_port = "8080"
|
|
||||||
|
|
||||||
PLATFORM_CONF_PATH = '/etc/platform'
|
|
||||||
PLATFORM_CONF_FILE = os.path.join(PLATFORM_CONF_PATH, 'platform.conf')
|
|
||||||
PLATFORM_SIMPLEX_FLAG = os.path.join(PLATFORM_CONF_PATH, 'simplex')
|
|
||||||
|
|
||||||
PUPPET_CONF_PATH = '/etc/puppet'
|
|
||||||
|
|
||||||
|
|
||||||
def _load():
|
|
||||||
global SW_VERSION, nodetype, subfunctions
|
|
||||||
# Read the build.info file
|
|
||||||
build_info = '/etc/build.info'
|
|
||||||
|
|
||||||
if not os.path.isfile(build_info):
|
|
||||||
# Assume that we are in a test environment. Dirty, dirty, dirty...
|
|
||||||
SW_VERSION = 'TEST.SW.VERSION'
|
|
||||||
nodetype = 'controller'
|
|
||||||
subfunctions = ['controller']
|
|
||||||
return
|
|
||||||
|
|
||||||
# The build.info file has no section headers, which causes problems
|
|
||||||
# for ConfigParser. So we'll fake it out.
|
|
||||||
ini_str = u'[build_info]\n' + open(build_info, 'r').read()
|
|
||||||
ini_fp = io.StringIO(ini_str)
|
|
||||||
|
|
||||||
config = configparser.SafeConfigParser()
|
|
||||||
config.readfp(ini_fp)
|
|
||||||
|
|
||||||
try:
|
|
||||||
value = str(config.get('build_info', 'SW_VERSION'))
|
|
||||||
|
|
||||||
SW_VERSION = value.strip('"')
|
|
||||||
except configparser.Error:
|
|
||||||
logging.exception("Failed to read SW_VERSION from /etc/build.info")
|
|
||||||
return False
|
|
||||||
|
|
||||||
# Read the platform.conf file
|
|
||||||
|
|
||||||
# The platform.conf file has no section headers, which causes problems
|
|
||||||
# for ConfigParser. So we'll fake it out.
|
|
||||||
ini_str = u'[platform_conf]\n' + open(PLATFORM_CONF_FILE, 'r').read()
|
|
||||||
ini_fp = io.StringIO(ini_str)
|
|
||||||
config.readfp(ini_fp)
|
|
||||||
|
|
||||||
try:
|
|
||||||
value = str(config.get('platform_conf', 'nodetype'))
|
|
||||||
|
|
||||||
nodetype = value
|
|
||||||
|
|
||||||
value = str(config.get('platform_conf', 'subfunction'))
|
|
||||||
|
|
||||||
subfunctions = value.split(",")
|
|
||||||
|
|
||||||
global region_config
|
|
||||||
if config.has_option('platform_conf', 'region_config'):
|
|
||||||
region_config = str(config.get('platform_conf', 'region_config'))
|
|
||||||
|
|
||||||
global region_1_name
|
|
||||||
if config.has_option('platform_conf', 'region_1_name'):
|
|
||||||
region_1_name = str(config.get('platform_conf', 'region_1_name'))
|
|
||||||
|
|
||||||
global region_2_name
|
|
||||||
if config.has_option('platform_conf', 'region_2_name'):
|
|
||||||
region_2_name = str(config.get('platform_conf', 'region_2_name'))
|
|
||||||
|
|
||||||
global vswitch_type
|
|
||||||
if config.has_option('platform_conf', 'vswitch_type'):
|
|
||||||
vswitch_type = str(config.get('platform_conf', 'vswitch_type'))
|
|
||||||
|
|
||||||
global management_interface
|
|
||||||
if config.has_option('platform_conf', 'management_interface'):
|
|
||||||
management_interface = str(config.get('platform_conf',
|
|
||||||
'management_interface'))
|
|
||||||
|
|
||||||
global oam_interface
|
|
||||||
if config.has_option('platform_conf', 'oam_interface'):
|
|
||||||
oam_interface = str(config.get('platform_conf', 'oam_interface'))
|
|
||||||
|
|
||||||
global cluster_host_interface
|
|
||||||
if config.has_option('platform_conf', 'cluster_host_interface'):
|
|
||||||
cluster_host_interface = str(config.get('platform_conf',
|
|
||||||
'cluster_host_interface'))
|
|
||||||
global sdn_enabled
|
|
||||||
if config.has_option('platform_conf', 'sdn_enabled'):
|
|
||||||
sdn_enabled = str(config.get('platform_conf', 'sdn_enabled'))
|
|
||||||
|
|
||||||
global host_uuid
|
|
||||||
if config.has_option('platform_conf', 'UUID'):
|
|
||||||
host_uuid = str(config.get('platform_conf', 'UUID'))
|
|
||||||
|
|
||||||
global install_uuid
|
|
||||||
if config.has_option('platform_conf', 'INSTALL_UUID'):
|
|
||||||
install_uuid = str(config.get('platform_conf', 'INSTALL_UUID'))
|
|
||||||
|
|
||||||
global system_type
|
|
||||||
if config.has_option('platform_conf', 'system_type'):
|
|
||||||
system_type = str(config.get('platform_conf', 'system_type'))
|
|
||||||
|
|
||||||
global system_mode
|
|
||||||
if config.has_option('platform_conf', 'system_mode'):
|
|
||||||
system_mode = str(config.get('platform_conf', 'system_mode'))
|
|
||||||
|
|
||||||
global security_profile
|
|
||||||
if config.has_option('platform_conf', 'security_profile'):
|
|
||||||
security_profile = str(config.get('platform_conf',
|
|
||||||
'security_profile'))
|
|
||||||
|
|
||||||
global distributed_cloud_role
|
|
||||||
if config.has_option('platform_conf', 'distributed_cloud_role'):
|
|
||||||
distributed_cloud_role = str(config.get('platform_conf',
|
|
||||||
'distributed_cloud_role'))
|
|
||||||
|
|
||||||
global security_feature
|
|
||||||
if config.has_option('platform_conf', 'security_feature'):
|
|
||||||
security_feature = str(config.get('platform_conf', 'security_feature'))
|
|
||||||
|
|
||||||
global http_port
|
|
||||||
if config.has_option('platform_conf', 'http_port'):
|
|
||||||
http_port = str(config.get('platform_conf', 'http_port'))
|
|
||||||
|
|
||||||
except configparser.Error:
|
|
||||||
logging.exception("Failed to read platform.conf")
|
|
||||||
return False
|
|
||||||
|
|
||||||
|
|
||||||
_load()
|
|
||||||
|
|
||||||
# Keep the following path and flag declarations in sync with the tsconfig
|
|
||||||
# bash script.
|
|
||||||
#
|
|
||||||
|
|
||||||
# Platform configuration paths and files
|
|
||||||
|
|
||||||
VOLATILE_PATH = "/var/run"
|
|
||||||
PLATFORM_PATH = "/opt/platform"
|
|
||||||
CONFIG_PATH = PLATFORM_PATH + "/config/" + SW_VERSION + "/"
|
|
||||||
PUPPET_PATH = PLATFORM_PATH + "/puppet/" + SW_VERSION + "/"
|
|
||||||
ARMADA_PATH = PLATFORM_PATH + "/armada/" + SW_VERSION
|
|
||||||
HELM_OVERRIDES_PATH = PLATFORM_PATH + "/helm/" + SW_VERSION
|
|
||||||
KEYRING_PATH = PLATFORM_PATH + "/.keyring/" + SW_VERSION
|
|
||||||
EXTENSION_PATH = "/opt/extension"
|
|
||||||
PLATFORM_CEPH_CONF_PATH = CONFIG_PATH + 'ceph-config'
|
|
||||||
|
|
||||||
# Controller configuration flags
|
|
||||||
|
|
||||||
# Set after the first application of controller manifests
|
|
||||||
INITIAL_CONTROLLER_CONFIG_COMPLETE = os.path.join(
|
|
||||||
PLATFORM_CONF_PATH, ".initial_controller_config_complete")
|
|
||||||
# Set after each application of controller manifests
|
|
||||||
VOLATILE_CONTROLLER_CONFIG_COMPLETE = os.path.join(
|
|
||||||
VOLATILE_PATH, ".controller_config_complete")
|
|
||||||
|
|
||||||
# Worker configuration flags
|
|
||||||
|
|
||||||
# Set after initial application of node manifest
|
|
||||||
INITIAL_CONFIG_COMPLETE_FLAG = os.path.join(
|
|
||||||
PLATFORM_CONF_PATH, ".initial_config_complete")
|
|
||||||
# Set after the first application of worker manifests
|
|
||||||
INITIAL_WORKER_CONFIG_COMPLETE = os.path.join(
|
|
||||||
PLATFORM_CONF_PATH, ".initial_worker_config_complete")
|
|
||||||
# Set after each application of worker manifests
|
|
||||||
VOLATILE_WORKER_CONFIG_COMPLETE = os.path.join(
|
|
||||||
VOLATILE_PATH, ".worker_config_complete")
|
|
||||||
# Set to prevent starting worker services (used in combined node upgrade)
|
|
||||||
VOLATILE_DISABLE_WORKER_SERVICES = os.path.join(
|
|
||||||
VOLATILE_PATH, ".disable_worker_services")
|
|
||||||
|
|
||||||
# Storage configuration flags
|
|
||||||
|
|
||||||
# Set after the first application of storage manifests
|
|
||||||
INITIAL_STORAGE_CONFIG_COMPLETE = os.path.join(
|
|
||||||
PLATFORM_CONF_PATH, ".initial_storage_config_complete")
|
|
||||||
# Set after each application of storage manifests
|
|
||||||
VOLATILE_STORAGE_CONFIG_COMPLETE = os.path.join(
|
|
||||||
VOLATILE_PATH, ".storage_config_complete")
|
|
||||||
|
|
||||||
# Upgrade flags
|
|
||||||
|
|
||||||
# Set on controller-0 to force controller-1 to do an upgrade after install.
|
|
||||||
CONTROLLER_UPGRADE_FLAG = os.path.join(
|
|
||||||
PLATFORM_CONF_PATH, '.upgrade_controller_1')
|
|
||||||
# Set on controller-0 (by controller-1) to indicate a completed upgrade.
|
|
||||||
CONTROLLER_UPGRADE_COMPLETE_FLAG = os.path.join(
|
|
||||||
PLATFORM_CONF_PATH, '.upgrade_controller_1_complete')
|
|
||||||
# Set on controller-0 (by controller-1) to indicate a failed upgrade.
|
|
||||||
CONTROLLER_UPGRADE_FAIL_FLAG = os.path.join(
|
|
||||||
PLATFORM_CONF_PATH, '.upgrade_controller_1_fail')
|
|
||||||
# Set on controller-1 to indicate we are rolling back the upgrade
|
|
||||||
UPGRADE_ROLLBACK_FLAG = os.path.join(
|
|
||||||
PLATFORM_CONF_PATH, '.upgrade_rollback')
|
|
||||||
# Set on controller-1 to indicate we are aborting the upgrade
|
|
||||||
UPGRADE_ABORT_FILE = '.upgrade_abort'
|
|
||||||
UPGRADE_ABORT_FLAG = os.path.join(
|
|
||||||
CONFIG_PATH, UPGRADE_ABORT_FILE)
|
|
||||||
|
|
||||||
# Set on controller-0 (by controller-1) to indicate that data migration has
|
|
||||||
# started
|
|
||||||
CONTROLLER_UPGRADE_STARTED_FLAG = os.path.join(
|
|
||||||
PLATFORM_CONF_PATH, '.upgrade_controller_1_started')
|
|
||||||
|
|
||||||
# Backup / Restore flags
|
|
||||||
BACKUP_IN_PROGRESS_FLAG = os.path.join(
|
|
||||||
PLATFORM_CONF_PATH, '.backup_in_progress')
|
|
||||||
# Set while a restore is running to prevent another restore being started
|
|
||||||
RESTORE_IN_PROGRESS_FLAG = os.path.join(
|
|
||||||
PLATFORM_CONF_PATH, '.restore_in_progress')
|
|
||||||
# Mark that restore_system was run on controller-0. Will be deleted
|
|
||||||
# once controller-0 is restored completely
|
|
||||||
RESTORE_SYSTEM_FLAG = os.path.join(
|
|
||||||
CONFIG_PATH, '.restore_system')
|
|
Loading…
Reference in New Issue