Browse Source

Remove wrs-configutilities SDK Module

Remove configutilities and move what is being used in other components
to controllerconfig.

Tested with a clean install on AIO-DX and running config_controller.

With the StarlingX move to supporting pure upstream OpenStack, the
majority of the SDK Modules are related to functionality no longer
supported. The remaining SDK Modules will be moved to StarlingX
documentation.

Story: 2005275
Task: 30262

Change-Id: Ie496548dfc6efee677a501c98c227c586df0a7d6
Signed-off-by: Kristine Bujold <kristine.bujold@windriver.com>
Kristine Bujold 3 weeks ago
parent
commit
a1e2d1e183
48 changed files with 504 additions and 4090 deletions
  1. 0
    26
      .zuul.yaml
  2. 0
    3
      centos_iso_image.inc
  3. 0
    1
      centos_pike_wheels.inc
  4. 0
    1
      centos_pkg_dirs
  5. 0
    1
      centos_stable_wheels.inc
  6. 0
    6
      configutilities/.gitignore
  7. 0
    13
      configutilities/PKG-INFO
  8. 0
    3
      configutilities/centos/build_srpm.data
  9. 0
    78
      configutilities/centos/configutilities.spec
  10. 0
    202
      configutilities/configutilities/LICENSE
  11. 0
    202
      configutilities/configutilities/configutilities/LICENSE
  12. 0
    76
      configutilities/configutilities/configutilities/README
  13. 0
    35
      configutilities/configutilities/configutilities/__init__.py
  14. 0
    5
      configutilities/configutilities/configutilities/common/__init__.py
  15. 0
    25
      configutilities/configutilities/configutilities/common/exceptions.py
  16. 0
    295
      configutilities/configutilities/configutilities/common/guicomponents.py
  17. 0
    367
      configutilities/configutilities/configutilities/common/utils.py
  18. 0
    37
      configutilities/configutilities/configutilities/common/wrs_ico.py
  19. 0
    103
      configutilities/configutilities/configutilities/config_validator.py
  20. 0
    1495
      configutilities/configutilities/configutilities/configfiletool.py
  21. 0
    114
      configutilities/configutilities/configutilities/configgui.py
  22. 0
    515
      configutilities/configutilities/configutilities/hostfiletool.py
  23. 0
    30
      configutilities/configutilities/configutilities/setup.py
  24. BIN
      configutilities/configutilities/favicon.ico
  25. 0
    233
      configutilities/configutilities/pylint.rc
  26. 0
    27
      configutilities/configutilities/setup.py
  27. 0
    4
      configutilities/configutilities/test-requirements.txt
  28. 0
    46
      configutilities/configutilities/tox.ini
  29. 1
    1
      controllerconfig/centos/build_srpm.data
  30. 30
    1
      controllerconfig/controllerconfig/controllerconfig/__init__.py
  31. 7
    9
      controllerconfig/controllerconfig/controllerconfig/common/configobjects.py
  32. 12
    8
      controllerconfig/controllerconfig/controllerconfig/common/crypt.py
  33. 2
    2
      controllerconfig/controllerconfig/controllerconfig/common/dcmanager.py
  34. 21
    2
      controllerconfig/controllerconfig/controllerconfig/common/exceptions.py
  35. 25
    25
      controllerconfig/controllerconfig/controllerconfig/common/validator.py
  36. 10
    10
      controllerconfig/controllerconfig/controllerconfig/config_management.py
  37. 14
    14
      controllerconfig/controllerconfig/controllerconfig/configassistant.py
  38. 19
    20
      controllerconfig/controllerconfig/controllerconfig/regionconfig.py
  39. 11
    11
      controllerconfig/controllerconfig/controllerconfig/systemconfig.py
  40. 4
    4
      controllerconfig/controllerconfig/controllerconfig/tests/test_region_config.py
  41. 4
    4
      controllerconfig/controllerconfig/controllerconfig/tests/test_system_config.py
  42. 2
    2
      controllerconfig/controllerconfig/controllerconfig/upgrades/utils.py
  43. 336
    17
      controllerconfig/controllerconfig/controllerconfig/utils.py
  44. 0
    1
      controllerconfig/controllerconfig/tox.ini
  45. 2
    12
      devstack/lib/stx-config
  46. 1
    1
      sysinv/sysinv/centos/build_srpm.data
  47. 3
    2
      sysinv/sysinv/sysinv/sysinv/api/controllers/v1/host.py
  48. 0
    1
      sysinv/sysinv/sysinv/tox.ini

+ 0
- 26
.zuul.yaml View File

@@ -15,8 +15,6 @@
15 15
         - controllerconfig-tox-flake8
16 16
         - controllerconfig-tox-py27
17 17
         - controllerconfig-tox-pylint
18
-        - configutilities-tox-flake8
19
-        - configutilities-tox-pylint
20 18
         - cgtsclient-tox-py27
21 19
         - cgtsclient-tox-pep8
22 20
         - cgtsclient-tox-pylint
@@ -35,8 +33,6 @@
35 33
         - controllerconfig-tox-flake8
36 34
         - controllerconfig-tox-py27
37 35
         - controllerconfig-tox-pylint
38
-        - configutilities-tox-flake8
39
-        - configutilities-tox-pylint
40 36
         - cgtsclient-tox-py27
41 37
         - cgtsclient-tox-pep8
42 38
         - cgtsclient-tox-pylint
@@ -142,28 +138,6 @@
142 138
       tox_envlist: pylint
143 139
       tox_extra_args: -c controllerconfig/controllerconfig/tox.ini
144 140
 
145
-- job:
146
-    name: configutilities-tox-flake8
147
-    parent: tox
148
-    description: Run flake8 tests for configutilities
149
-    files:
150
-      - configutilities/*
151
-    vars:
152
-      tox_envlist: flake8
153
-      tox_extra_args: -c configutilities/configutilities/tox.ini
154
-
155
-- job:
156
-    name: configutilities-tox-pylint
157
-    parent: tox
158
-    description: Run pylint tests for configutilities
159
-    required-projects:
160
-      - openstack/stx-update
161
-    files:
162
-      - configutilities/*
163
-    vars:
164
-      tox_envlist: pylint
165
-      tox_extra_args: -c configutilities/configutilities/tox.ini
166
-
167 141
 - job:
168 142
     name: flock-devstack-config
169 143
     parent: flock-devstack-base

+ 0
- 3
centos_iso_image.inc View File

@@ -10,9 +10,6 @@ workerconfig
10 10
 workerconfig-standalone
11 11
 workerconfig-subfunction
12 12
 
13
-# configutilities
14
-configutilities
15
-
16 13
 # controllerconfig
17 14
 controllerconfig
18 15
 

+ 0
- 1
centos_pike_wheels.inc View File

@@ -1,4 +1,3 @@
1 1
 cgts-client-wheels
2
-configutilities-wheels
3 2
 controllerconfig-wheels
4 3
 sysinv-wheels

+ 0
- 1
centos_pkg_dirs View File

@@ -1,7 +1,6 @@
1 1
 kubernetes/applications/stx-openstack/stx-openstack-helm
2 2
 worker-utils
3 3
 workerconfig
4
-configutilities
5 4
 controllerconfig
6 5
 storageconfig
7 6
 sysinv/cgts-client

+ 0
- 1
centos_stable_wheels.inc View File

@@ -1,4 +1,3 @@
1 1
 cgts-client-wheels
2
-configutilities-wheels
3 2
 controllerconfig-wheels
4 3
 sysinv-wheels

+ 0
- 6
configutilities/.gitignore View File

@@ -1,6 +0,0 @@
1
-!.distro
2
-.distro/centos7/rpmbuild/RPMS
3
-.distro/centos7/rpmbuild/SRPMS
4
-.distro/centos7/rpmbuild/BUILD
5
-.distro/centos7/rpmbuild/BUILDROOT
6
-.distro/centos7/rpmbuild/SOURCES/configutilities*tar.gz

+ 0
- 13
configutilities/PKG-INFO View File

@@ -1,13 +0,0 @@
1
-Metadata-Version: 1.1
2
-Name: configutilities
3
-Version: 1.2.0
4
-Summary: Titanium Cloud configuration utilities
5
-Home-page: 
6
-Author: Windriver
7
-Author-email: info@windriver.com
8
-License: Apache-2.0
9
-
10
-Description: Titanium Cloud configuration utilities
11
-
12
-        
13
-Platform: UNKNOWN

+ 0
- 3
configutilities/centos/build_srpm.data View File

@@ -1,3 +0,0 @@
1
-SRC_DIR="configutilities"
2
-COPY_LIST="$SRC_DIR/LICENSE"
3
-TIS_PATCH_VER=2

+ 0
- 78
configutilities/centos/configutilities.spec View File

@@ -1,78 +0,0 @@
1
-Summary: configutilities
2
-Name: configutilities
3
-Version: 3.1.0
4
-Release: %{tis_patch_ver}%{?_tis_dist}
5
-License: Apache-2.0
6
-Group: base
7
-Packager: Wind River <info@windriver.com>
8
-URL: unknown
9
-Source0: %{name}-%{version}.tar.gz
10
-Source1: LICENSE
11
-
12
-%define debug_package %{nil}
13
-
14
-BuildRequires: python-setuptools
15
-BuildRequires: python2-pip
16
-BuildRequires: python2-wheel
17
-Requires: python-netaddr
18
-#Requires: wxPython
19
-
20
-%description
21
-Titanium Cloud Controller configuration utilities
22
-
23
-%package -n %{name}-cgts-sdk
24
-Summary: configutilities sdk files
25
-Group: devel
26
-
27
-%description -n %{name}-cgts-sdk
28
-SDK files for configutilities
29
-
30
-%define local_bindir /usr/bin
31
-%define pythonroot /usr/lib64/python2.7/site-packages
32
-%define cgcs_sdk_deploy_dir /opt/deploy/cgcs_sdk
33
-%define cgcs_sdk_tarball_name wrs-%{name}-%{version}.tgz
34
-
35
-%prep
36
-%setup
37
-
38
-%build
39
-%{__python} setup.py build
40
-%py2_build_wheel
41
-
42
-%install
43
-%{__python} setup.py install --root=$RPM_BUILD_ROOT \
44
-                             --install-lib=%{pythonroot} \
45
-                             --prefix=/usr \
46
-                             --install-data=/usr/share \
47
-                             --single-version-externally-managed
48
-mkdir -p $RPM_BUILD_ROOT/wheels
49
-install -m 644 dist/*.whl $RPM_BUILD_ROOT/wheels/
50
-
51
-sed -i "s#xxxSW_VERSIONxxx#%{platform_release}#" %{name}/common/validator.py
52
-tar czf %{cgcs_sdk_tarball_name} %{name}
53
-mkdir -p $RPM_BUILD_ROOT%{cgcs_sdk_deploy_dir}
54
-install -m 644 %{cgcs_sdk_tarball_name} $RPM_BUILD_ROOT%{cgcs_sdk_deploy_dir}
55
-
56
-%clean
57
-rm -rf $RPM_BUILD_ROOT 
58
-
59
-%files
60
-%defattr(-,root,root,-)
61
-%doc LICENSE
62
-%{local_bindir}/*
63
-%dir %{pythonroot}/%{name}
64
-%{pythonroot}/%{name}/*
65
-%dir %{pythonroot}/%{name}-%{version}-py2.7.egg-info
66
-%{pythonroot}/%{name}-%{version}-py2.7.egg-info/*
67
-
68
-%files -n %{name}-cgts-sdk
69
-%{cgcs_sdk_deploy_dir}/%{cgcs_sdk_tarball_name}
70
-
71
-%package wheels
72
-Summary: %{name} wheels
73
-
74
-%description wheels
75
-Contains python wheels for %{name}
76
-
77
-%files wheels
78
-/wheels/*

+ 0
- 202
configutilities/configutilities/LICENSE View File

@@ -1,202 +0,0 @@
1
-
2
-                                 Apache License
3
-                           Version 2.0, January 2004
4
-                        http://www.apache.org/licenses/
5
-
6
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
-
8
-   1. Definitions.
9
-
10
-      "License" shall mean the terms and conditions for use, reproduction,
11
-      and distribution as defined by Sections 1 through 9 of this document.
12
-
13
-      "Licensor" shall mean the copyright owner or entity authorized by
14
-      the copyright owner that is granting the License.
15
-
16
-      "Legal Entity" shall mean the union of the acting entity and all
17
-      other entities that control, are controlled by, or are under common
18
-      control with that entity. For the purposes of this definition,
19
-      "control" means (i) the power, direct or indirect, to cause the
20
-      direction or management of such entity, whether by contract or
21
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
-      outstanding shares, or (iii) beneficial ownership of such entity.
23
-
24
-      "You" (or "Your") shall mean an individual or Legal Entity
25
-      exercising permissions granted by this License.
26
-
27
-      "Source" form shall mean the preferred form for making modifications,
28
-      including but not limited to software source code, documentation
29
-      source, and configuration files.
30
-
31
-      "Object" form shall mean any form resulting from mechanical
32
-      transformation or translation of a Source form, including but
33
-      not limited to compiled object code, generated documentation,
34
-      and conversions to other media types.
35
-
36
-      "Work" shall mean the work of authorship, whether in Source or
37
-      Object form, made available under the License, as indicated by a
38
-      copyright notice that is included in or attached to the work
39
-      (an example is provided in the Appendix below).
40
-
41
-      "Derivative Works" shall mean any work, whether in Source or Object
42
-      form, that is based on (or derived from) the Work and for which the
43
-      editorial revisions, annotations, elaborations, or other modifications
44
-      represent, as a whole, an original work of authorship. For the purposes
45
-      of this License, Derivative Works shall not include works that remain
46
-      separable from, or merely link (or bind by name) to the interfaces of,
47
-      the Work and Derivative Works thereof.
48
-
49
-      "Contribution" shall mean any work of authorship, including
50
-      the original version of the Work and any modifications or additions
51
-      to that Work or Derivative Works thereof, that is intentionally
52
-      submitted to Licensor for inclusion in the Work by the copyright owner
53
-      or by an individual or Legal Entity authorized to submit on behalf of
54
-      the copyright owner. For the purposes of this definition, "submitted"
55
-      means any form of electronic, verbal, or written communication sent
56
-      to the Licensor or its representatives, including but not limited to
57
-      communication on electronic mailing lists, source code control systems,
58
-      and issue tracking systems that are managed by, or on behalf of, the
59
-      Licensor for the purpose of discussing and improving the Work, but
60
-      excluding communication that is conspicuously marked or otherwise
61
-      designated in writing by the copyright owner as "Not a Contribution."
62
-
63
-      "Contributor" shall mean Licensor and any individual or Legal Entity
64
-      on behalf of whom a Contribution has been received by Licensor and
65
-      subsequently incorporated within the Work.
66
-
67
-   2. Grant of Copyright License. Subject to the terms and conditions of
68
-      this License, each Contributor hereby grants to You a perpetual,
69
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
-      copyright license to reproduce, prepare Derivative Works of,
71
-      publicly display, publicly perform, sublicense, and distribute the
72
-      Work and such Derivative Works in Source or Object form.
73
-
74
-   3. Grant of Patent License. Subject to the terms and conditions of
75
-      this License, each Contributor hereby grants to You a perpetual,
76
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
-      (except as stated in this section) patent license to make, have made,
78
-      use, offer to sell, sell, import, and otherwise transfer the Work,
79
-      where such license applies only to those patent claims licensable
80
-      by such Contributor that are necessarily infringed by their
81
-      Contribution(s) alone or by combination of their Contribution(s)
82
-      with the Work to which such Contribution(s) was submitted. If You
83
-      institute patent litigation against any entity (including a
84
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
85
-      or a Contribution incorporated within the Work constitutes direct
86
-      or contributory patent infringement, then any patent licenses
87
-      granted to You under this License for that Work shall terminate
88
-      as of the date such litigation is filed.
89
-
90
-   4. Redistribution. You may reproduce and distribute copies of the
91
-      Work or Derivative Works thereof in any medium, with or without
92
-      modifications, and in Source or Object form, provided that You
93
-      meet the following conditions:
94
-
95
-      (a) You must give any other recipients of the Work or
96
-          Derivative Works a copy of this License; and
97
-
98
-      (b) You must cause any modified files to carry prominent notices
99
-          stating that You changed the files; and
100
-
101
-      (c) You must retain, in the Source form of any Derivative Works
102
-          that You distribute, all copyright, patent, trademark, and
103
-          attribution notices from the Source form of the Work,
104
-          excluding those notices that do not pertain to any part of
105
-          the Derivative Works; and
106
-
107
-      (d) If the Work includes a "NOTICE" text file as part of its
108
-          distribution, then any Derivative Works that You distribute must
109
-          include a readable copy of the attribution notices contained
110
-          within such NOTICE file, excluding those notices that do not
111
-          pertain to any part of the Derivative Works, in at least one
112
-          of the following places: within a NOTICE text file distributed
113
-          as part of the Derivative Works; within the Source form or
114
-          documentation, if provided along with the Derivative Works; or,
115
-          within a display generated by the Derivative Works, if and
116
-          wherever such third-party notices normally appear. The contents
117
-          of the NOTICE file are for informational purposes only and
118
-          do not modify the License. You may add Your own attribution
119
-          notices within Derivative Works that You distribute, alongside
120
-          or as an addendum to the NOTICE text from the Work, provided
121
-          that such additional attribution notices cannot be construed
122
-          as modifying the License.
123
-
124
-      You may add Your own copyright statement to Your modifications and
125
-      may provide additional or different license terms and conditions
126
-      for use, reproduction, or distribution of Your modifications, or
127
-      for any such Derivative Works as a whole, provided Your use,
128
-      reproduction, and distribution of the Work otherwise complies with
129
-      the conditions stated in this License.
130
-
131
-   5. Submission of Contributions. Unless You explicitly state otherwise,
132
-      any Contribution intentionally submitted for inclusion in the Work
133
-      by You to the Licensor shall be under the terms and conditions of
134
-      this License, without any additional terms or conditions.
135
-      Notwithstanding the above, nothing herein shall supersede or modify
136
-      the terms of any separate license agreement you may have executed
137
-      with Licensor regarding such Contributions.
138
-
139
-   6. Trademarks. This License does not grant permission to use the trade
140
-      names, trademarks, service marks, or product names of the Licensor,
141
-      except as required for reasonable and customary use in describing the
142
-      origin of the Work and reproducing the content of the NOTICE file.
143
-
144
-   7. Disclaimer of Warranty. Unless required by applicable law or
145
-      agreed to in writing, Licensor provides the Work (and each
146
-      Contributor provides its Contributions) on an "AS IS" BASIS,
147
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
-      implied, including, without limitation, any warranties or conditions
149
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
-      PARTICULAR PURPOSE. You are solely responsible for determining the
151
-      appropriateness of using or redistributing the Work and assume any
152
-      risks associated with Your exercise of permissions under this License.
153
-
154
-   8. Limitation of Liability. In no event and under no legal theory,
155
-      whether in tort (including negligence), contract, or otherwise,
156
-      unless required by applicable law (such as deliberate and grossly
157
-      negligent acts) or agreed to in writing, shall any Contributor be
158
-      liable to You for damages, including any direct, indirect, special,
159
-      incidental, or consequential damages of any character arising as a
160
-      result of this License or out of the use or inability to use the
161
-      Work (including but not limited to damages for loss of goodwill,
162
-      work stoppage, computer failure or malfunction, or any and all
163
-      other commercial damages or losses), even if such Contributor
164
-      has been advised of the possibility of such damages.
165
-
166
-   9. Accepting Warranty or Additional Liability. While redistributing
167
-      the Work or Derivative Works thereof, You may choose to offer,
168
-      and charge a fee for, acceptance of support, warranty, indemnity,
169
-      or other liability obligations and/or rights consistent with this
170
-      License. However, in accepting such obligations, You may act only
171
-      on Your own behalf and on Your sole responsibility, not on behalf
172
-      of any other Contributor, and only if You agree to indemnify,
173
-      defend, and hold each Contributor harmless for any liability
174
-      incurred by, or claims asserted against, such Contributor by reason
175
-      of your accepting any such warranty or additional liability.
176
-
177
-   END OF TERMS AND CONDITIONS
178
-
179
-   APPENDIX: How to apply the Apache License to your work.
180
-
181
-      To apply the Apache License to your work, attach the following
182
-      boilerplate notice, with the fields enclosed by brackets "[]"
183
-      replaced with your own identifying information. (Don't include
184
-      the brackets!)  The text should be enclosed in the appropriate
185
-      comment syntax for the file format. We also recommend that a
186
-      file or class name and description of purpose be included on the
187
-      same "printed page" as the copyright notice for easier
188
-      identification within third-party archives.
189
-
190
-   Copyright [yyyy] [name of copyright owner]
191
-
192
-   Licensed under the Apache License, Version 2.0 (the "License");
193
-   you may not use this file except in compliance with the License.
194
-   You may obtain a copy of the License at
195
-
196
-       http://www.apache.org/licenses/LICENSE-2.0
197
-
198
-   Unless required by applicable law or agreed to in writing, software
199
-   distributed under the License is distributed on an "AS IS" BASIS,
200
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
-   See the License for the specific language governing permissions and
202
-   limitations under the License.

+ 0
- 202
configutilities/configutilities/configutilities/LICENSE View File

@@ -1,202 +0,0 @@
1
-
2
-                                 Apache License
3
-                           Version 2.0, January 2004
4
-                        http://www.apache.org/licenses/
5
-
6
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
-
8
-   1. Definitions.
9
-
10
-      "License" shall mean the terms and conditions for use, reproduction,
11
-      and distribution as defined by Sections 1 through 9 of this document.
12
-
13
-      "Licensor" shall mean the copyright owner or entity authorized by
14
-      the copyright owner that is granting the License.
15
-
16
-      "Legal Entity" shall mean the union of the acting entity and all
17
-      other entities that control, are controlled by, or are under common
18
-      control with that entity. For the purposes of this definition,
19
-      "control" means (i) the power, direct or indirect, to cause the
20
-      direction or management of such entity, whether by contract or
21
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
-      outstanding shares, or (iii) beneficial ownership of such entity.
23
-
24
-      "You" (or "Your") shall mean an individual or Legal Entity
25
-      exercising permissions granted by this License.
26
-
27
-      "Source" form shall mean the preferred form for making modifications,
28
-      including but not limited to software source code, documentation
29
-      source, and configuration files.
30
-
31
-      "Object" form shall mean any form resulting from mechanical
32
-      transformation or translation of a Source form, including but
33
-      not limited to compiled object code, generated documentation,
34
-      and conversions to other media types.
35
-
36
-      "Work" shall mean the work of authorship, whether in Source or
37
-      Object form, made available under the License, as indicated by a
38
-      copyright notice that is included in or attached to the work
39
-      (an example is provided in the Appendix below).
40
-
41
-      "Derivative Works" shall mean any work, whether in Source or Object
42
-      form, that is based on (or derived from) the Work and for which the
43
-      editorial revisions, annotations, elaborations, or other modifications
44
-      represent, as a whole, an original work of authorship. For the purposes
45
-      of this License, Derivative Works shall not include works that remain
46
-      separable from, or merely link (or bind by name) to the interfaces of,
47
-      the Work and Derivative Works thereof.
48
-
49
-      "Contribution" shall mean any work of authorship, including
50
-      the original version of the Work and any modifications or additions
51
-      to that Work or Derivative Works thereof, that is intentionally
52
-      submitted to Licensor for inclusion in the Work by the copyright owner
53
-      or by an individual or Legal Entity authorized to submit on behalf of
54
-      the copyright owner. For the purposes of this definition, "submitted"
55
-      means any form of electronic, verbal, or written communication sent
56
-      to the Licensor or its representatives, including but not limited to
57
-      communication on electronic mailing lists, source code control systems,
58
-      and issue tracking systems that are managed by, or on behalf of, the
59
-      Licensor for the purpose of discussing and improving the Work, but
60
-      excluding communication that is conspicuously marked or otherwise
61
-      designated in writing by the copyright owner as "Not a Contribution."
62
-
63
-      "Contributor" shall mean Licensor and any individual or Legal Entity
64
-      on behalf of whom a Contribution has been received by Licensor and
65
-      subsequently incorporated within the Work.
66
-
67
-   2. Grant of Copyright License. Subject to the terms and conditions of
68
-      this License, each Contributor hereby grants to You a perpetual,
69
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
-      copyright license to reproduce, prepare Derivative Works of,
71
-      publicly display, publicly perform, sublicense, and distribute the
72
-      Work and such Derivative Works in Source or Object form.
73
-
74
-   3. Grant of Patent License. Subject to the terms and conditions of
75
-      this License, each Contributor hereby grants to You a perpetual,
76
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
-      (except as stated in this section) patent license to make, have made,
78
-      use, offer to sell, sell, import, and otherwise transfer the Work,
79
-      where such license applies only to those patent claims licensable
80
-      by such Contributor that are necessarily infringed by their
81
-      Contribution(s) alone or by combination of their Contribution(s)
82
-      with the Work to which such Contribution(s) was submitted. If You
83
-      institute patent litigation against any entity (including a
84
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
85
-      or a Contribution incorporated within the Work constitutes direct
86
-      or contributory patent infringement, then any patent licenses
87
-      granted to You under this License for that Work shall terminate
88
-      as of the date such litigation is filed.
89
-
90
-   4. Redistribution. You may reproduce and distribute copies of the
91
-      Work or Derivative Works thereof in any medium, with or without
92
-      modifications, and in Source or Object form, provided that You
93
-      meet the following conditions:
94
-
95
-      (a) You must give any other recipients of the Work or
96
-          Derivative Works a copy of this License; and
97
-
98
-      (b) You must cause any modified files to carry prominent notices
99
-          stating that You changed the files; and
100
-
101
-      (c) You must retain, in the Source form of any Derivative Works
102
-          that You distribute, all copyright, patent, trademark, and
103
-          attribution notices from the Source form of the Work,
104
-          excluding those notices that do not pertain to any part of
105
-          the Derivative Works; and
106
-
107
-      (d) If the Work includes a "NOTICE" text file as part of its
108
-          distribution, then any Derivative Works that You distribute must
109
-          include a readable copy of the attribution notices contained
110
-          within such NOTICE file, excluding those notices that do not
111
-          pertain to any part of the Derivative Works, in at least one
112
-          of the following places: within a NOTICE text file distributed
113
-          as part of the Derivative Works; within the Source form or
114
-          documentation, if provided along with the Derivative Works; or,
115
-          within a display generated by the Derivative Works, if and
116
-          wherever such third-party notices normally appear. The contents
117
-          of the NOTICE file are for informational purposes only and
118
-          do not modify the License. You may add Your own attribution
119
-          notices within Derivative Works that You distribute, alongside
120
-          or as an addendum to the NOTICE text from the Work, provided
121
-          that such additional attribution notices cannot be construed
122
-          as modifying the License.
123
-
124
-      You may add Your own copyright statement to Your modifications and
125
-      may provide additional or different license terms and conditions
126
-      for use, reproduction, or distribution of Your modifications, or
127
-      for any such Derivative Works as a whole, provided Your use,
128
-      reproduction, and distribution of the Work otherwise complies with
129
-      the conditions stated in this License.
130
-
131
-   5. Submission of Contributions. Unless You explicitly state otherwise,
132
-      any Contribution intentionally submitted for inclusion in the Work
133
-      by You to the Licensor shall be under the terms and conditions of
134
-      this License, without any additional terms or conditions.
135
-      Notwithstanding the above, nothing herein shall supersede or modify
136
-      the terms of any separate license agreement you may have executed
137
-      with Licensor regarding such Contributions.
138
-
139
-   6. Trademarks. This License does not grant permission to use the trade
140
-      names, trademarks, service marks, or product names of the Licensor,
141
-      except as required for reasonable and customary use in describing the
142
-      origin of the Work and reproducing the content of the NOTICE file.
143
-
144
-   7. Disclaimer of Warranty. Unless required by applicable law or
145
-      agreed to in writing, Licensor provides the Work (and each
146
-      Contributor provides its Contributions) on an "AS IS" BASIS,
147
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
-      implied, including, without limitation, any warranties or conditions
149
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
-      PARTICULAR PURPOSE. You are solely responsible for determining the
151
-      appropriateness of using or redistributing the Work and assume any
152
-      risks associated with Your exercise of permissions under this License.
153
-
154
-   8. Limitation of Liability. In no event and under no legal theory,
155
-      whether in tort (including negligence), contract, or otherwise,
156
-      unless required by applicable law (such as deliberate and grossly
157
-      negligent acts) or agreed to in writing, shall any Contributor be
158
-      liable to You for damages, including any direct, indirect, special,
159
-      incidental, or consequential damages of any character arising as a
160
-      result of this License or out of the use or inability to use the
161
-      Work (including but not limited to damages for loss of goodwill,
162
-      work stoppage, computer failure or malfunction, or any and all
163
-      other commercial damages or losses), even if such Contributor
164
-      has been advised of the possibility of such damages.
165
-
166
-   9. Accepting Warranty or Additional Liability. While redistributing
167
-      the Work or Derivative Works thereof, You may choose to offer,
168
-      and charge a fee for, acceptance of support, warranty, indemnity,
169
-      or other liability obligations and/or rights consistent with this
170
-      License. However, in accepting such obligations, You may act only
171
-      on Your own behalf and on Your sole responsibility, not on behalf
172
-      of any other Contributor, and only if You agree to indemnify,
173
-      defend, and hold each Contributor harmless for any liability
174
-      incurred by, or claims asserted against, such Contributor by reason
175
-      of your accepting any such warranty or additional liability.
176
-
177
-   END OF TERMS AND CONDITIONS
178
-
179
-   APPENDIX: How to apply the Apache License to your work.
180
-
181
-      To apply the Apache License to your work, attach the following
182
-      boilerplate notice, with the fields enclosed by brackets "[]"
183
-      replaced with your own identifying information. (Don't include
184
-      the brackets!)  The text should be enclosed in the appropriate
185
-      comment syntax for the file format. We also recommend that a
186
-      file or class name and description of purpose be included on the
187
-      same "printed page" as the copyright notice for easier
188
-      identification within third-party archives.
189
-
190
-   Copyright [yyyy] [name of copyright owner]
191
-
192
-   Licensed under the Apache License, Version 2.0 (the "License");
193
-   you may not use this file except in compliance with the License.
194
-   You may obtain a copy of the License at
195
-
196
-       http://www.apache.org/licenses/LICENSE-2.0
197
-
198
-   Unless required by applicable law or agreed to in writing, software
199
-   distributed under the License is distributed on an "AS IS" BASIS,
200
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
-   See the License for the specific language governing permissions and
202
-   limitations under the License.

+ 0
- 76
configutilities/configutilities/configutilities/README View File

@@ -1,76 +0,0 @@
1
-Copyright © 2017 Wind River Systems, Inc.
2
-
3
-SPDX-License-Identifier: Apache-2.0
4
------------------------------------------------------------------------
5
-
6
-
7
-Titanium Cloud Configuration Utilities
8
----------------------------------------
9
-
10
-To facilitate various aspects of Titanium Cloud installation and
11
-configuration, utilities have been created to generate and validate
12
-configuration and setup files which are utilized by the system.
13
-
14
-
15
-Installing the Configuration Utilities
16
---------------------------------------
17
-
18
-This tarball includes several utilities which can be used to aid in the
19
-configuration of Titanium Cloud.  Note that these are optional tools which are run prior
20
-to installation, and not run on the target system.
21
-
22
-To install the utilities on a Linux machine follow these steps:
23
-
24
-1.  Ensure you have the tools necessary to install new python packages (pip and setuptools)
25
-    If you do not, you must install them using the appropriate commands for
26
-    your version of linux, such as:
27
-        sudo apt-get install python-pip  # e.g. for Ubuntu or Debian
28
-
29
-2.  The config_gui tool makes use of external tools which must be
30
-    installed as follows:
31
-
32
-        if using Ubuntu/Debian:
33
-            sudo apt-get install python-wxtools
34
-
35
-        if using Fedora:
36
-            sudo yum install wxPython python-setuptools
37
-
38
-        if using CentOS/RedHat, the appropriate rpm can be obtained from EPEL
39
-            sudo yum install epel-release
40
-            sudo yum install wxPython
41
-
42
-            Note, if epel-release is not available, it can be obtained as such (specific to
43
-            your version)
44
-                wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
45
-                sudo rpm -Uvh epel-release-6*.rpm
46
-                sudo yum install wxPython python-pip
47
-
48
-3.  Copy wrs-configutilities-3.1.0.tgz to the python install directory
49
-    (i.e. /usr/lib/python2.7/dist-packages or /usr/lib/python2.7/site-packages)
50
-
51
-4.  Cd to this python install directory
52
-
53
-5.  Untar the file: 
54
-        sudo tar xfv wrs-configutilities-3.1.0.tgz
55
-
56
-6.  Cd configutilities
57
-
58
-7.  Run setup:  
59
-        sudo python setup.py install
60
-
61
-
62
-Using the Configuration Utilities
63
----------------------------------
64
-
65
-There are two tools installed: config_validator and config_gui.
66
-
67
-config_validator is a commandline tool which takes a 'controller configuration
68
-input' file of the INI type and does preliminary analysis to ensure its validity.
69
-It can be called as follows: 
70
-    config_validator --system-config <filename>
71
-
72
-config_gui is a GUI-based tool which provides tools for creating a 'controller 
73
-configuration input' INI file and/or a 'bulk host' XML file.  It can be launched 
74
-by calling 'config_gui' from the command line and will walk you through the process
75
-of generating the desired configuration files.
76
-

+ 0
- 35
configutilities/configutilities/configutilities/__init__.py View File

@@ -1,35 +0,0 @@
1
-#
2
-# Copyright (c) 2015-2016 Wind River Systems, Inc.
3
-#
4
-# SPDX-License-Identifier: Apache-2.0
5
-#
6
-#
7
-
8
-from configutilities.common.validator import validate  # noqa: F401
9
-from configutilities.common.configobjects import Network  # noqa: F401
10
-from configutilities.common.configobjects import DEFAULT_CONFIG  # noqa: F401
11
-from configutilities.common.configobjects import REGION_CONFIG  # noqa: F401
12
-from configutilities.common.configobjects import DEFAULT_NAMES  # noqa: F401
13
-from configutilities.common.configobjects import HP_NAMES  # noqa: F401
14
-from configutilities.common.configobjects import SUBCLOUD_CONFIG  # noqa: F401
15
-from configutilities.common.configobjects import MGMT_TYPE  # noqa: F401
16
-from configutilities.common.configobjects import INFRA_TYPE  # noqa: F401
17
-from configutilities.common.configobjects import OAM_TYPE  # noqa: F401
18
-from configutilities.common.configobjects import NETWORK_PREFIX_NAMES  # noqa: F401
19
-from configutilities.common.configobjects import HOST_XML_ATTRIBUTES  # noqa: F401
20
-from configutilities.common.configobjects import DEFAULT_DOMAIN_NAME  # noqa: F401
21
-from configutilities.common.exceptions import ConfigError  # noqa: F401
22
-from configutilities.common.exceptions import ConfigFail  # noqa: F401
23
-from configutilities.common.exceptions import ValidateFail  # noqa: F401
24
-from configutilities.common.utils import is_valid_vlan  # noqa: F401
25
-from configutilities.common.utils import is_mtu_valid  # noqa: F401
26
-from configutilities.common.utils import validate_network_str  # noqa: F401
27
-from configutilities.common.utils import validate_address_str  # noqa: F401
28
-from configutilities.common.utils import validate_address  # noqa: F401
29
-from configutilities.common.utils import is_valid_url  # noqa: F401
30
-from configutilities.common.utils import is_valid_domain_or_ip  # noqa: F401
31
-from configutilities.common.utils import ip_version_to_string  # noqa: F401
32
-from configutilities.common.utils import lag_mode_to_str  # noqa: F401
33
-from configutilities.common.utils import validate_openstack_password  # noqa: F401
34
-from configutilities.common.utils import validate_nameserver_address_str  # noqa: F401
35
-from configutilities.common.utils import extract_openstack_password_rules_from_file  # noqa: F401

+ 0
- 5
configutilities/configutilities/configutilities/common/__init__.py View File

@@ -1,5 +0,0 @@
1
-#
2
-# Copyright (c) 2015 Wind River Systems, Inc.
3
-#
4
-# SPDX-License-Identifier: Apache-2.0
5
-#

+ 0
- 25
configutilities/configutilities/configutilities/common/exceptions.py View File

@@ -1,25 +0,0 @@
1
-#
2
-# Copyright (c) 2015 Wind River Systems, Inc.
3
-#
4
-# SPDX-License-Identifier: Apache-2.0
5
-#
6
-
7
-
8
-class ConfigError(Exception):
9
-    """Base class for configuration exceptions."""
10
-
11
-    def __init__(self, message=None):
12
-        self.message = message
13
-
14
-    def __str__(self):
15
-        return self.message or ""
16
-
17
-
18
-class ConfigFail(ConfigError):
19
-    """General configuration error."""
20
-    pass
21
-
22
-
23
-class ValidateFail(ConfigError):
24
-    """Validation of data failed."""
25
-    pass

+ 0
- 295
configutilities/configutilities/configutilities/common/guicomponents.py View File

@@ -1,295 +0,0 @@
1
-#
2
-# Copyright (c) 2016 Wind River Systems, Inc.
3
-#
4
-# SPDX-License-Identifier: Apache-2.0
5
-#
6
-
7
-import wx
8
-
9
-from configutilities.common.exceptions import ValidateFail
10
-from configutilities.common import wrs_ico
11
-
12
-TEXT_BOX_SIZE = (150, -1)
13
-TEXT_WIDTH = 450
14
-DEBUG = False
15
-VGAP = 5
16
-HGAP = 10
17
-
18
-
19
-def debug(msg):
20
-    if DEBUG:
21
-        print(msg)
22
-
23
-
24
-# Tracks what type of controls will implement a config question
25
-class TYPES(object):
26
-    string = 1
27
-    int = 2
28
-    radio = 3
29
-    choice = 4
30
-    checkbox = 5
31
-    help = 6
32
-    separator = 7
33
-
34
-
35
-class Field(object):
36
-    def __init__(self, text="", type=TYPES.string, transient=False,
37
-                 initial="", choices=[], shows=[], reverse=False,
38
-                 enabled=True):
39
-        """Represent a configuration question
40
-
41
-        :param text: Question prompt text
42
-
43
-        :param type: The type of wxWidgets control(s) used to implement this
44
-                field
45
-
46
-        :param transient: Whether this field should be written automatically
47
-                to the INI file
48
-
49
-        :param enabled: Whether this field should be enabled or
50
-                        disabled (greyed-out)
51
-
52
-        :param initial: Initial value used to populate the control
53
-
54
-        :param choices: A string list of choices to populate selection-based
55
-                        fields
56
-
57
-        :param shows: A list of field key strings that this field should show
58
-                when checked.  Only checkboxes implement this functionality atm
59
-
60
-        :param reverse: Switches the 'shows' logic -> checked
61
-                will hide fields instead of showing them
62
-
63
-        :return: the Field object
64
-        """
65
-
66
-        self.text = text
67
-        self.type = type
68
-        self.transient = transient
69
-        self.initial = initial
70
-        self.choices = choices
71
-        self.shows = shows
72
-        self.reverse = reverse
73
-        self.enabled = enabled
74
-
75
-        # Controls used to implement this field
76
-        self.prompt = None
77
-        self.input = None
78
-
79
-        if type is TYPES.help:
80
-            self.transient = True
81
-
82
-        # Sanity to make sure fields are being utilized correctly
83
-        if self.shows and self.type is TYPES.help:
84
-            raise NotImplementedError()
85
-
86
-        if not self.shows and self.reverse:
87
-            raise NotImplementedError()
88
-
89
-    def get_value(self):
90
-        # Return value of the control (a string or int)
91
-        if not self.input:
92
-            value = None
93
-        elif not self.input.IsShown() or not self.input.IsEnabled():
94
-            value = None
95
-        elif self.type is TYPES.string:
96
-            value = self.input.GetLineText(0)
97
-        elif self.type is TYPES.int:
98
-            try:
99
-                value = self.input.GetLineText(0)
100
-                int(value)
101
-            except ValueError:
102
-                raise ValidateFail(
103
-                    "Invalid entry for %s. Must enter a numeric value" %
104
-                    self.text)
105
-        elif self.type is TYPES.radio:
106
-            value = self.input.GetString(self.input.GetSelection())
107
-        elif self.type is TYPES.choice:
108
-            value = self.input.GetString(self.input.GetSelection())
109
-        elif self.type is TYPES.checkbox:
110
-            value = "N"
111
-            if self.input.GetValue():
112
-                value = "Y"
113
-        else:
114
-            raise NotImplementedError()
115
-
116
-        return value
117
-
118
-    def set_value(self, value):
119
-        # Set value of the control (string or int)
120
-        if not self.input:
121
-            # Can't 'set' help text etc.
122
-            raise NotImplementedError()
123
-        elif self.type is TYPES.string or self.type is TYPES.int:
124
-            self.input.SetValue(value)
125
-        elif self.type is TYPES.radio or self.type is TYPES.choice:
126
-            index = self.input.FindString(value)
127
-            if index == wx.NOT_FOUND:
128
-                raise ValidateFail("Invalid value %s for field %s" %
129
-                                   (value, self.text))
130
-            self.input.SetSelection(index)
131
-        elif self.type is TYPES.checkbox:
132
-            self.input.SetValue(value == "Y")
133
-        else:
134
-            raise NotImplementedError()
135
-
136
-    def destroy(self):
137
-        if self.prompt:
138
-            self.prompt.Destroy()
139
-        if self.input:
140
-            self.input.Destroy()
141
-
142
-    def show(self, visible):
143
-        debug("Setting visibility to %s for field %s prompt=%s" %
144
-              (visible, self.text, self.prompt))
145
-        if visible:
146
-            if self.prompt:
147
-                self.prompt.Show()
148
-            if self.input:
149
-                self.input.Show()
150
-        else:
151
-            if self.prompt:
152
-                self.prompt.Hide()
153
-            if self.input:
154
-                self.input.Hide()
155
-
156
-
157
-def prepare_fields(parent, fields, sizer, change_hdlr):
158
-        for row, (name, field) in enumerate(fields.items()):
159
-            initial = field.initial
160
-            # if config.has_option(parent.section, name):
161
-            #    initial = config.get(parent.section, name)
162
-
163
-            add_attributes = wx.ALIGN_CENTER_VERTICAL
164
-            width = 1
165
-            field.prompt = wx.StaticText(parent, label=field.text, name=name)
166
-
167
-            # Generate different control based on field type
168
-            if field.type is TYPES.string or field.type is TYPES.int:
169
-                field.input = wx.TextCtrl(parent, value=initial, name=name,
170
-                                          size=TEXT_BOX_SIZE)
171
-
172
-            elif field.type is TYPES.radio:
173
-                field.input = wx.RadioBox(
174
-                    parent, choices=field.choices, majorDimension=1,
175
-                    style=wx.RA_SPECIFY_COLS, name=name, id=wx.ID_ANY)
176
-
177
-            elif field.type is TYPES.choice:
178
-                field.input = wx.Choice(
179
-                    parent, choices=field.choices, name=name)
180
-                if initial:
181
-                    field.input.SetSelection(field.input.FindString(initial))
182
-            elif field.type is TYPES.checkbox:
183
-                width = 2
184
-                field.input = wx.CheckBox(parent, name=name, label=field.text,
185
-                                          )  # style=wx.ALIGN_RIGHT)
186
-                field.input.SetValue(initial == 'Y')
187
-                if field.prompt:
188
-                    field.prompt.Hide()
189
-                field.prompt = None
190
-
191
-            elif field.type is TYPES.help:
192
-                width = 2
193
-                field.prompt.Wrap(TEXT_WIDTH)
194
-                field.input = None
195
-
196
-            elif field.type is TYPES.separator:
197
-                width = 2
198
-                field.prompt = wx.StaticLine(parent, -1)
199
-                add_attributes = wx.EXPAND | wx.ALL
200
-                field.input = None
201
-
202
-            else:
203
-                raise NotImplementedError()
204
-
205
-            col = 0
206
-            if field.prompt:
207
-                sizer.Add(field.prompt, (row, col), span=(1, width),
208
-                          flag=add_attributes)
209
-                col += 1
210
-            if field.input:
211
-                field.input.Enable(field.enabled)
212
-                sizer.Add(field.input, (row, col),
213
-                          flag=add_attributes)
214
-
215
-        # Go through again and set show/hide relationships
216
-        for name, field in fields.items():
217
-            if field.shows:
218
-                # Add display handlers
219
-                field.input.Bind(wx.EVT_CHECKBOX, change_hdlr)
220
-                # todo tsmith add other evts
221
-
222
-                # Start by hiding target prompt/input controls
223
-                for target_name in field.shows:
224
-                    target = fields[target_name]
225
-                    if target.prompt:
226
-                        target.prompt.Hide()
227
-                    if target.input:
228
-                        target.input.Hide()
229
-
230
-
231
-def on_change(parent, fields, event):
232
-    obj = event.GetEventObject()
233
-
234
-    # debug("Checked: " + str(event.Checked()) +
235
-    #    ", Reverse: " + str(parent.fields[obj.GetName()].reverse) +
236
-    #    ", Will show: " + str(event.Checked() is not
237
-    # parent.fields[obj.GetName()].reverse))
238
-
239
-    # Hide/Show the targets of the control
240
-    # Note: the "is not" implements switching the show logic around
241
-    handle_sub_show(
242
-        fields,
243
-        fields[obj.GetName()].shows,
244
-        event.Checked() is not fields[obj.GetName()].reverse)
245
-
246
-    parent.Layout()
247
-    event.Skip()
248
-
249
-
250
-def handle_sub_show(fields, targets, show):
251
-    """ Recursive function to handle showing/hiding of a list of fields
252
-     :param targets: [String]
253
-     :param show: bool
254
-    """
255
-
256
-    sub_handled = []
257
-    for tgt in targets:
258
-        if tgt in sub_handled:
259
-            # Handled by newly shown control
260
-            continue
261
-
262
-        tgt_field = fields[tgt]
263
-        # Show or hide this field as necessary
264
-        tgt_field.show(show)
265
-
266
-        # If it shows others (checkbox) and is now shown,
267
-        # apply it's value decide on showing it's children, not the
268
-        # original show
269
-        if tgt_field.shows and show:
270
-            sub_handled.extend(tgt_field.shows)
271
-            handle_sub_show(
272
-                fields,
273
-                tgt_field.shows,
274
-                (tgt_field.get_value() is 'Y') is not fields[tgt].reverse)
275
-
276
-
277
-def set_icons(parent):
278
-    # Icon setting
279
-    # todo Make higher resolution icons, verify on different linux desktops
280
-    icons = wx.IconBundle()
281
-    for sz in [16, 32, 48]:
282
-        # try:
283
-        # icon = wx.Icon(wrs_ico.windriver_favicon.getIcon(),
284
-        #               width=sz, height=sz)
285
-        icon = wrs_ico.favicon.getIcon()
286
-        icons.AddIcon(icon)
287
-        # except:
288
-        #    pass
289
-    parent.SetIcons(icons)
290
-
291
-    # ico = wrs_ico.windriver_favicon.getIcon()
292
-    # self.SetIcon(ico)
293
-
294
-    # self.tbico = wx.TaskBarIcon()
295
-    # self.tbico.SetIcon(ico, '')

+ 0
- 367
configutilities/configutilities/configutilities/common/utils.py View File

@@ -1,367 +0,0 @@
1
-"""
2
-Copyright (c) 2015-2016 Wind River Systems, Inc.
3
-
4
-SPDX-License-Identifier: Apache-2.0
5
-
6
-"""
7
-
8
-from six.moves import configparser
9
-import re
10
-import six
11
-from netaddr import IPNetwork
12
-from netaddr import IPAddress
13
-from netaddr import AddrFormatError
14
-from netaddr import valid_ipv4
15
-from netaddr import valid_ipv6
16
-
17
-from configutilities.common.exceptions import ValidateFail
18
-
19
-EXPECTED_SERVICE_NAME_AND_TYPE = (
20
-    {"KEYSTONE_SERVICE_NAME": "keystone",
21
-     "KEYSTONE_SERVICE_TYPE": "identity",
22
-     "SYSINV_SERVICE_NAME": "sysinv",
23
-     "SYSINV_SERVICE_TYPE": "platform",
24
-     "PATCHING_SERVICE_NAME": "patching",
25
-     "PATCHING_SERVICE_TYPE": "patching",
26
-     "NFV_SERVICE_NAME": "vim",
27
-     "NFV_SERVICE_TYPE": "nfv",
28
-     "FM_SERVICE_NAME": "fm",
29
-     "FM_SERVICE_TYPE": "faultmanagement",
30
-     "BARBICAN_SERVICE_NAME": "barbican",
31
-     "BARBICAN_SERVICE_TYPE": "key-manager",
32
-     })
33
-
34
-
35
-def is_valid_vlan(vlan):
36
-    """Determine whether vlan is valid."""
37
-    try:
38
-        if 0 < int(vlan) < 4095:
39
-            return True
40
-        else:
41
-            return False
42
-    except (ValueError, TypeError):
43
-        return False
44
-
45
-
46
-def is_mtu_valid(mtu):
47
-    """Determine whether a mtu is valid."""
48
-    try:
49
-        if int(mtu) < 576:
50
-            return False
51
-        elif int(mtu) > 9216:
52
-            return False
53
-        else:
54
-            return True
55
-    except (ValueError, TypeError):
56
-        return False
57
-
58
-
59
-def is_valid_hostname(hostname):
60
-    """Determine whether a hostname is valid as per RFC 1123."""
61
-
62
-    # Maximum length of 255
63
-    if not hostname or len(hostname) > 255:
64
-        return False
65
-    # Allow a single dot on the right hand side
66
-    if hostname[-1] == ".":
67
-        hostname = hostname[:-1]
68
-    # Create a regex to ensure:
69
-    # - hostname does not begin or end with a dash
70
-    # - each segment is 1 to 63 characters long
71
-    # - valid characters are A-Z (any case) and 0-9
72
-    valid_re = re.compile("(?!-)[A-Z\d-]{1,63}(?<!-)$", re.IGNORECASE)
73
-    return all(valid_re.match(x) for x in hostname.split("."))
74
-
75
-
76
-def is_valid_mac(mac):
77
-    """Verify the format of a MAC addres."""
78
-    if not mac:
79
-        return False
80
-    m = "[0-9a-f]{2}([-:])[0-9a-f]{2}(\\1[0-9a-f]{2}){4}$"
81
-    return isinstance(mac, six.string_types) and re.match(m, mac.lower())
82
-
83
-
84
-def validate_network_str(network_str, minimum_size,
85
-                         existing_networks=None, multicast=False):
86
-    """Determine whether a network is valid."""
87
-    try:
88
-        network = IPNetwork(network_str)
89
-        if network.ip != network.network:
90
-            raise ValidateFail("Invalid network address")
91
-        elif network.size < minimum_size:
92
-            raise ValidateFail("Subnet too small - must have at least %d "
93
-                               "addresses" % minimum_size)
94
-        elif network.version == 6 and network.prefixlen < 64:
95
-            raise ValidateFail("IPv6 minimum prefix length is 64")
96
-        elif existing_networks:
97
-            if any(network.ip in subnet for subnet in existing_networks):
98
-                raise ValidateFail("Subnet overlaps with another "
99
-                                   "configured subnet")
100
-        elif multicast and not network.is_multicast():
101
-            raise ValidateFail("Invalid subnet - must be multicast")
102
-        return network
103
-    except AddrFormatError:
104
-        raise ValidateFail(
105
-            "Invalid subnet - not a valid IP subnet")
106
-
107
-
108
-def is_valid_filename(filename):
109
-    return '\0' not in filename
110
-
111
-
112
-def is_valid_by_path(filename):
113
-    return "/dev/disk/by-path" in filename and "-part" not in filename
114
-
115
-
116
-def is_valid_url(url_str):
117
-    # Django URL validation patterns
118
-    r = re.compile(
119
-        r'^(?:http|ftp)s?://'  # http:// or https://
120
-        r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)'  # domain...
121
-        r'+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)|'
122
-        r'localhost|'  # localhost...
123
-        r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})'  # ...or ip
124
-        r'(?::\d+)?'  # optional port
125
-        r'(?:/?|[/?]\S+)$', re.IGNORECASE)
126
-
127
-    url = r.match(url_str)
128
-    if url:
129
-        return True
130
-    else:
131
-        return False
132
-
133
-
134
-def is_valid_domain(url_str):
135
-    r = re.compile(
136
-        r'^(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)'  # domain...
137
-        r'+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)|'
138
-        r'[A-Za-z0-9-_]*)'  # localhost, hostname
139
-        r'(?::\d+)?'  # optional port
140
-        r'(?:/?|[/?]\S+)$', re.IGNORECASE)
141
-
142
-    url = r.match(url_str)
143
-    if url:
144
-        return True
145
-    else:
146
-        return False
147
-
148
-
149
-def is_valid_ipv4(address):
150
-    """Verify that address represents a valid IPv4 address."""
151
-    try:
152
-        return valid_ipv4(address)
153
-    except Exception:
154
-        return False
155
-
156
-
157
-def is_valid_ipv6(address):
158
-    try:
159
-        return valid_ipv6(address)
160
-    except Exception:
161
-        return False
162
-
163
-
164
-def is_valid_domain_or_ip(url_str):
165
-    if url_str:
166
-        if is_valid_domain(url_str):
167
-            return True
168
-        ip_with_port = url_str.split(':')
169
-        if len(ip_with_port) <= 2:
170
-            # check ipv4 or ipv4 with port
171
-            return is_valid_ipv4(ip_with_port[0])
172
-        else:
173
-            # check ipv6 with port
174
-            if '[' in url_str:
175
-                try:
176
-                    bkt_idx = url_str.index(']')
177
-                    if bkt_idx + 1 == len(url_str):
178
-                        # brackets without port
179
-                        return False
180
-                    else:
181
-                        return is_valid_ipv6(url_str[1:bkt_idx])
182
-                except Exception:
183
-                    return False
184
-            else:
185
-                # check ipv6 without port
186
-                return is_valid_ipv6(url_str)
187
-    else:
188
-        return False
189
-
190
-
191
-def is_valid_bool_str(val):
192
-    """Check if the provided string is a valid bool string or not."""
193
-    boolstrs = ('true', 'false')
194
-    return str(val).lower() in boolstrs
195
-
196
-
197
-def validate_address_str(ip_address_str, network):
198
-    """Determine whether an address is valid."""
199
-    try:
200
-        ip_address = IPAddress(ip_address_str)
201
-        if ip_address.version != network.version:
202
-            msg = ("Invalid IP version - must match network version " +
203
-                   ip_version_to_string(network.version))
204
-            raise ValidateFail(msg)
205
-        elif ip_address == network:
206
-            raise ValidateFail("Cannot use network address")
207
-        elif ip_address == network.broadcast:
208
-            raise ValidateFail("Cannot use broadcast address")
209
-        elif ip_address not in network:
210
-            raise ValidateFail(
211
-                "Address must be in subnet %s" % str(network))
212
-        return ip_address
213
-    except AddrFormatError:
214
-        raise ValidateFail(
215
-            "Invalid address - not a valid IP address")
216
-
217
-
218
-def ip_version_to_string(ip_version):
219
-    """Determine whether a nameserver address is valid."""
220
-    if ip_version == 4:
221
-        return "IPv4"
222
-    elif ip_version == 6:
223
-        return "IPv6"
224
-    else:
225
-        return "IP"
226
-
227
-
228
-def validate_nameserver_address_str(ip_address_str, subnet_version=None):
229
-    """Determine whether a nameserver address is valid."""
230
-    try:
231
-        ip_address = IPAddress(ip_address_str)
232
-        if subnet_version is not None and ip_address.version != subnet_version:
233
-            msg = ("Invalid IP version - must match OAM subnet version " +
234
-                   ip_version_to_string(subnet_version))
235
-            raise ValidateFail(msg)
236
-        return ip_address
237
-    except AddrFormatError:
238
-        msg = "Invalid address - "
239
-        "not a valid %s address" % ip_version_to_string(subnet_version)
240
-        raise ValidateFail(msg)
241
-
242
-
243
-def validate_address(ip_address, network):
244
-    """Determine whether an address is valid."""
245
-    if ip_address.version != network.version:
246
-            msg = ("Invalid IP version - must match network version " +
247
-                   ip_version_to_string(network.version))
248
-            raise ValidateFail(msg)
249
-    elif ip_address == network:
250
-        raise ValidateFail("Cannot use network address")
251
-    elif ip_address == network.broadcast:
252
-        raise ValidateFail("Cannot use broadcast address")
253
-    elif ip_address not in network:
254
-        raise ValidateFail("Address must be in subnet %s" % str(network))
255
-
256
-
257
-def check_network_overlap(new_network, configured_networks):
258
-    """ Validate that new_network does not overlap any configured_networks.
259
-    """
260
-    if any(new_network.ip in subnet for subnet in
261
-           configured_networks):
262
-        raise ValidateFail(
263
-            "Subnet %s overlaps with another configured subnet" % new_network)
264
-
265
-
266
-def lag_mode_to_str(lag_mode):
267
-    if lag_mode == 0:
268
-        return "balance-rr"
269
-    if lag_mode == 1:
270
-        return "active-backup"
271
-    elif lag_mode == 2:
272
-        return "balance-xor"
273
-    elif lag_mode == 3:
274
-        return "broadcast"
275
-    elif lag_mode == 4:
276
-        return "802.3ad"
277
-    elif lag_mode == 5:
278
-        return "balance-tlb"
279
-    elif lag_mode == 6:
280
-        return "balance-alb"
281
-    else:
282
-        raise Exception(
283
-            "Invalid LAG_MODE value of %d. Valid values: 0-6" % lag_mode)
284
-
285
-
286
-def validate_openstack_password(password, rules_file,
287
-                                section="security_compliance"):
288
-    try:
289
-        config = configparser.RawConfigParser()
290
-        parsed_config = config.read(rules_file)
291
-        if not parsed_config:
292
-            msg = ("Cannot parse rules file: %s" % rules_file)
293
-            raise Exception(msg)
294
-        if not config.has_section(section):
295
-            msg = ("Required section '%s' not found in rules file" % section)
296
-            raise Exception(msg)
297
-
298
-        password_regex = get_optional(config, section, 'password_regex')
299
-        password_regex_description = get_optional(config, section,
300
-                                                  'password_regex_description')
301
-
302
-        if not password_regex:
303
-            msg = ("Required option 'password_regex' not found in "
304
-                   "rule file: %s" % rules_file)
305
-            raise Exception(msg)
306
-        # Even if regex_description is not found, we will proceed
307
-        # and give a generic failure warning instead
308
-        if not password_regex_description:
309
-            password_regex_description = ("Password does not meet "
310
-                                          "complexity criteria")
311
-
312
-        if not isinstance(password, six.string_types):
313
-            msg = ("Password must be a string type")
314
-            raise Exception(msg)
315
-        try:
316
-            # config parser would read in the string as a literal
317
-            # representation which would fail regex matching
318
-            password_regex = password_regex.strip('"')
319
-            if not re.match(password_regex, password):
320
-                return False, password_regex_description
321
-        except re.error:
322
-            msg = ("Unable to validate password due to invalid "
323
-                   "complexity criteria ('password_regex')")
324
-            raise Exception(msg)
325
-    except Exception:
326
-        raise Exception("Password validation failed")
327
-    return True, ""
328
-
329
-
330
-def extract_openstack_password_rules_from_file(
331
-        rules_file, section="security_compliance"):
332
-    try:
333
-        config = configparser.RawConfigParser()
334
-        parsed_config = config.read(rules_file)
335
-        if not parsed_config:
336
-            msg = ("Cannot parse rules file: %s" % rules_file)
337
-            raise Exception(msg)
338
-        if not config.has_section(section):
339
-            msg = ("Required section '%s' not found in rules file" % section)
340
-            raise Exception(msg)
341
-
342
-        rules = config.items(section)
343
-        if not rules:
344
-            msg = ("section '%s' contains no configuration options" % section)
345
-            raise Exception(msg)
346
-        return dict(rules)
347
-    except Exception:
348
-        raise Exception("Failed to extract password rules from file")
349
-
350
-
351
-def get_optional(conf, section, key):
352
-    if conf.has_option(section, key):
353
-        return conf.get(section, key)
354
-    return None
355
-
356
-
357
-def get_service(conf, section, key):
358
-    if key in EXPECTED_SERVICE_NAME_AND_TYPE:
359
-        if conf.has_option(section, key):
360
-            value = conf.get(section, key)
361
-            if value != EXPECTED_SERVICE_NAME_AND_TYPE[key]:
362
-                raise ValidateFail("Unsupported %s: %s " % (key, value))
363
-        else:
364
-            value = EXPECTED_SERVICE_NAME_AND_TYPE[key]
365
-        return value
366
-    else:
367
-        return conf.get(section, key)

+ 0
- 37
configutilities/configutilities/configutilities/common/wrs_ico.py View File

@@ -1,37 +0,0 @@
1
-# ----------------------------------------------------------------------
2
-# This file was generated by img2py.py
3
-#
4
-
5
-#
6
-# Copyright (c) 2015-2016 Wind River Systems, Inc.
7
-#
8
-# SPDX-License-Identifier: Apache-2.0
9
-#
10
-
11
-#
12
-# Stylized red Wind River 'W' icon
13
-#
14
-
15
-from wx.lib.embeddedimage import PyEmbeddedImage
16
-
17
-favicon = PyEmbeddedImage(
18
-    "iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAA99J"
19
-    "REFUWIXtls1PE2sUxn/z0Q7U0g/AXmNAUBGNxsSYGnWjQQ0YNAISY1y4kLh16T/g1qV/gwtJ"
20
-    "JFFATbBCmuBXrhiMitGk0hpBJaQtM4Vpp+3cxXAHSltub1zggpPM4p155pznfd5zznuEv8Fk"
21
-    "A03cyOCbBDYJ/BEE5EpqUPiP72YFmHI42bV/f0ng6uDG3BzZubmSTuW6OhzbtmEaBuloFDOd"
22
-    "Lo3buhVHIGDhpqcxMxnLfzoaXYlnmiAICJKEoCjWWpKI37tH7MYNyOUKvQoCDbdvU3ftGnlN"
23
-    "Y7qvj4VQqGiXgizTeOcOtVeukHr1isjly+QSCYvYdF9fEVvR5aLu6lX8ly4B4OnoQGlqIh2J"
24
-    "FOCcTU34urqQa2uhthZ/by/qs2cW8VWmtLTgPXcOyetlcWLCDg4gL4RCJSXLfPtGzcmTyIEA"
25
-    "SnMz7hMn0CMRe3cm4GlvR9m1y/7H096Os7mZzNevK6ICnrNncTY2kksmSQ4PF+SCKCwv1j76"
26
-    "p0+kXr9eRol4z59HdDptx5LLhf/iRRBXCknZuRPPmTMFOSR7PPi6ugBYfPuWpcnJgiMqW4Z5"
27
-    "XScxOGjL6T5+HGXPHszlXbkOH2bL0aOQz2PMzlo4UcTX04Pkctm7dx05wpZgEIDko0dkVbUg"
28
-    "TlkCAqCOjpKJxQBwbN+O59Qp+5uvuxvJ5yMTizF765Z9ru5jx6g+dMiSWRDwdXcjut1kf/1i"
29
-    "YWSkKM66jSgTiaCGw/ba29mJWFWFo6EBb2cnAOrYGPN376K9eAGA5Pfbkjt37MDb0QGA9vIl"
30
-    "+tRUUYWsSyCfy5EcHMQ0DABcwSBV+/ZR09aG0tpKXteJDwyQVVXi/f2Y2axN1BEIUHP6NMru"
31
-    "3WCaJIeGyJfoEesSEABtfBz982cA5Pp6/D09+Ht7ESSJpclJUs+fIwALIyPoU1MAVO3di+/C"
32
-    "BUsJUSQTi6GOjZXslvJ6BACMmRnUp0+pPnAAgPrr1xHdbgASDx9izM9b3XJmhsSDB1QfPIjg"
33
-    "cPDXzZs4AgEA1HCYzJoeUpECYGVyYmiIfCoFWMkoeTwYP36QHB4uxA0MYPz8aanQ2ork82Ea"
34
-    "hiX/2i5aKQEBWHzzhqV37wrea+Ew+sePtqwCsPT+vdUJV1n6yxe08fGyl1VF13E2Hif5+LG9"
35
-    "Ng2D+P375JeT81/LGwbx/n7yum6/WwiFML5/L+u74nkg+eSJfSMuffiAFg4XXzpY5704MWER"
36
-    "0jS79ZYzodKxXFAUatrakP1+MtGoVfdm6V9dwSBVLS3kUinU0VHymvb7BKB4TvhdHFRQhqut"
37
-    "kqnn/+DgD5gJNwlsEthwAv8AApOBr7T8BuQAAAAASUVORK5CYII=")

+ 0
- 103
configutilities/configutilities/configutilities/config_validator.py View File

@@ -1,103 +0,0 @@
1
-"""
2
-Copyright (c) 2015-2016 Wind River Systems, Inc.
3
-
4
-SPDX-License-Identifier: Apache-2.0
5
-
6
-"""
7
-
8
-from __future__ import print_function
9
-import sys
10
-import os
11
-from six.moves import configparser
12
-from configutilities.common.validator import validate
13
-from configutilities.common.configobjects import DEFAULT_CONFIG
14
-from configutilities.common.configobjects import REGION_CONFIG
15
-from configutilities.common.exceptions import ConfigFail
16
-from configutilities.common.exceptions import ValidateFail
17
-
18
-
19
-def parse_config(config_file):
20
-    """Parse system config file"""
21
-    config = configparser.RawConfigParser()
22
-    try:
23
-        config.read(config_file)
24
-    except Exception as e:
25
-        raise ConfigFail("Error parsing system config file: %s" % e.message)
26
-    return config
27
-
28
-
29
-def show_help():
30
-    print("Usage: %s\n"
31
-          "Perform validation of a given configuration file\n\n"
32
-          "--system-config <name>   Validate a system configuration file\n"
33
-          "--region-config <name>   Validate a region configuration file\n"
34
-          % sys.argv[0])
35
-    exit(1)
36
-
37
-
38
-def main():
39
-    config_file = None
40
-    system_config = False
41
-    region_config = False
42
-
43
-    arg = 1
44
-    while arg < len(sys.argv):
45
-        if sys.argv[arg] == "--system-config":
46
-            arg += 1
47
-            if arg < len(sys.argv):
48
-                config_file = sys.argv[arg]
49
-            else:
50
-                print("--system-config requires the filename of the config "
51
-                      "file")
52
-                exit(1)
53
-            system_config = True
54
-        elif sys.argv[arg] == "--region-config":
55
-            arg += 1
56
-            if arg < len(sys.argv):
57
-                config_file = sys.argv[arg]
58
-            else:
59
-                print("--region-config requires the filename of the config "
60
-                      "file")
61
-                exit(1)
62
-            region_config = True
63
-        elif sys.argv[arg] in ["--help", "-h", "-?"]:
64
-            show_help()
65
-        else:
66
-            print("Invalid option.")
67
-            show_help()
68
-        arg += 1
69
-
70
-    if [system_config, region_config].count(True) != 1:
71
-        print("Invalid combination of options selected")
72
-        show_help()
73
-
74
-    if system_config:
75
-        config_type = DEFAULT_CONFIG
76
-    else:
77
-        config_type = REGION_CONFIG
78
-
79
-    if not os.path.isfile(config_file):
80
-        print("Config file %s does not exist" % config_file)
81
-        exit(1)
82
-
83
-    # Parse the system config file
84
-    print("Parsing configuration file... ", end=' ')
85
-    system_config = parse_config(config_file)
86
-    print("DONE")
87
-
88
-    # Validate the system config file
89
-    print("Validating configuration file... ", end=' ')
90
-    try:
91
-        # we use the presence of tsconfig to determine if we are onboard or
92
-        # not since it will not be available in the offboard case
93
-        offboard = False
94
-        try:
95
-            from tsconfig.tsconfig import SW_VERSION  # noqa: F401
96
-        except ImportError:
97
-            offboard = True
98
-        validate(system_config, config_type, None, offboard)
99
-    except configparser.Error as e:
100
-        print("Error parsing configuration file %s: %s" % (config_file, e))
101
-    except (ConfigFail, ValidateFail) as e:
102
-        print("\nValidation failed: %s" % e)
103
-    print("DONE")

+ 0
- 1495
configutilities/configutilities/configutilities/configfiletool.py
File diff suppressed because it is too large
View File


+ 0
- 114
configutilities/configutilities/configutilities/configgui.py View File

@@ -1,114 +0,0 @@
1
-"""
2
-Copyright (c) 2015-2017 Wind River Systems, Inc.
3
-
4
-SPDX-License-Identifier: Apache-2.0
5
-
6
-"""
7
-
8
-import wx
9
-
10
-from configutilities.common.guicomponents import set_icons
11
-from configutilities.common.validator import TiS_VERSION
12
-from configutilities import configfiletool
13
-from configutilities import hostfiletool
14
-
15
-TEXT_WIDTH = 560
16
-BTN_SIZE = (200, -1)
17
-
18
-
19
-class WelcomeScreen(wx.Frame):
20
-    def __init__(self, *args, **kwargs):
21
-        super(WelcomeScreen, self).__init__(*args, **kwargs)
22
-        page = Content(self)
23
-
24
-        set_icons(self)
25
-
26
-        size = page.main_sizer.Fit(self)
27
-        self.SetMinSize(size)
28
-        self.Layout()
29
-
30
-
31
-class Content(wx.Panel):
32
-    def __init__(self, *args, **kwargs):
33
-        super(Content, self).__init__(*args, **kwargs)
34
-
35
-        self.title = wx.StaticText(
36
-            self, -1,
37
-            'Titanium Cloud Configuration Utility')
38
-        self.title.SetFont(wx.Font(18, wx.SWISS, wx.NORMAL, wx.BOLD))
39
-
40
-        # Set up controls for the main page
41
-        self.description = wx.StaticText(
42
-            self, -1,
43
-            ' Welcome, The following tools are available for use:')
44
-
45
-        self.config_desc = wx.StaticText(
46
-            self, -1,
47
-            "The Titanium Cloud configuration file wizard allows users to "
48
-            "create the configuration INI file which is used during the "
49
-            "installation process")
50
-        self.config_desc.Wrap(TEXT_WIDTH / 2)
51
-        self.hosts_desc = wx.StaticText(
52
-            self, -1,
53
-            "The Titanium Cloud host file tool allows users to create an XML "
54
-            "file specifying hosts to be provisioned as part of the Titanium "
55
-            "Cloud cloud deployment.")
56
-        self.hosts_desc.Wrap(TEXT_WIDTH / 2)
57
-
58
-        self.config_wiz_btn = wx.Button(
59
-            self, -1, "Launch Config File Wizard", size=BTN_SIZE)
60
-        self.Bind(wx.EVT_BUTTON, self.launch_config_wiz, self.config_wiz_btn)
61
-
62
-        self.host_file_tool_btn = wx.Button(
63
-            self, -1, "Launch Host File Tool", size=BTN_SIZE)
64
-        self.Bind(wx.EVT_BUTTON, self.launch_host_wiz, self.host_file_tool_btn)
65
-
66
-        self.box1 = wx.StaticBox(self)
67
-        self.box2 = wx.StaticBox(self)
68
-
69
-        # Do layout of controls
70
-        self.main_sizer = wx.BoxSizer(wx.VERTICAL)
71
-        self.tool1Sizer = wx.StaticBoxSizer(self.box1, wx.HORIZONTAL)
72
-        self.tool2Sizer = wx.StaticBoxSizer(self.box2, wx.HORIZONTAL)
73
-
74
-        self.main_sizer.AddSpacer(10)
75
-        self.main_sizer.Add(self.title, flag=wx.ALIGN_CENTER)
76
-        self.main_sizer.AddSpacer(10)
77
-        self.main_sizer.Add(self.description)
78
-        self.main_sizer.AddSpacer(5)
79
-        self.main_sizer.Add(self.tool1Sizer, proportion=1, flag=wx.EXPAND)
80
-        self.main_sizer.Add(self.tool2Sizer, proportion=1, flag=wx.EXPAND)
81
-        self.main_sizer.AddSpacer(5)
82
-
83
-        self.tool1Sizer.Add(self.config_desc, flag=wx.ALIGN_CENTER)
84
-        self.tool1Sizer.AddSpacer(10)
85
-        self.tool1Sizer.Add(self.config_wiz_btn, flag=wx.ALIGN_CENTER)
86
-        self.tool2Sizer.Add(self.hosts_desc, flag=wx.ALIGN_CENTER)
87
-        self.tool2Sizer.AddSpacer(10)
88
-        self.tool2Sizer.Add(self.host_file_tool_btn, flag=wx.ALIGN_CENTER)
89
-
90
-        self.SetSizer(self.main_sizer)
91
-
92
-        self.Layout()
93
-
94
-    def launch_config_wiz(self, event):
95
-        conf_wizard = configfiletool.ConfigWizard()
96
-        conf_wizard.run()
97
-        conf_wizard.Destroy()
98
-
99
-    def launch_host_wiz(self, event):
100
-        hostfiletool.HostGUI()
101
-
102
-
103
-def main():
104
-    app = wx.App(0)  # Start the application
105
-
106
-    gui = WelcomeScreen(None, title="Titanium Cloud Configuration Utility v"
107
-                                    + TiS_VERSION)
108
-    gui.Show()
109
-    app.MainLoop()
110
-    app.Destroy()
111
-
112
-
113
-if __name__ == '__main__':
114
-    main()

+ 0
- 515
configutilities/configutilities/configutilities/hostfiletool.py View File

@@ -1,515 +0,0 @@
1
-"""
2
-Copyright (c) 2015-2017 Wind River Systems, Inc.
3
-
4
-SPDX-License-Identifier: Apache-2.0
5
-
6
-"""
7
-
8
-from collections import OrderedDict
9
-import netaddr
10
-import xml.etree.ElementTree as ET
11
-
12
-import wx
13
-
14
-from configutilities.common import utils
15
-from configutilities.common import exceptions
16
-from configutilities.common.guicomponents import Field
17
-from configutilities.common.guicomponents import TYPES
18
-from configutilities.common.guicomponents import prepare_fields
19
-from configutilities.common.guicomponents import on_change
20
-from configutilities.common.guicomponents import set_icons
21
-from configutilities.common.guicomponents import handle_sub_show
22
-from configutilities.common.configobjects import HOST_XML_ATTRIBUTES
23
-from configutilities.common.validator import TiS_VERSION
24
-
25
-PAGE_SIZE = (200, 200)
26
-WINDOW_SIZE = (570, 700)
27
-CB_TRUE = True
28
-CB_FALSE = False
29
-PADDING = 10
30
-
31
-IMPORT_ID = 100
32
-EXPORT_ID = 101
33
-
34
-INTERNAL_ID = 105
35
-EXTERNAL_ID = 106
36
-
37
-filedir = ""
38
-filename = ""
39
-
40
-# Globals
41
-BULK_ADDING = False
42
-
43
-
44
-class HostPage(wx.Panel):
45
-    def __init__(self, parent):
46
-        wx.Panel.__init__(self, parent=parent)
47
-
48
-        self.parent = parent
49
-        self.sizer = wx.BoxSizer(wx.VERTICAL)
50
-        self.SetSizer(self.sizer)
51
-        self.fieldgroup = []
52
-        self.fieldgroup.append(OrderedDict())
53
-        self.fieldgroup.append(OrderedDict())
54
-        self.fieldgroup.append(OrderedDict())
55
-
56
-        self.fields_sizer1 = wx.GridBagSizer(vgap=10, hgap=10)
57
-        self.fields_sizer2 = wx.GridBagSizer(vgap=10, hgap=10)
58
-        self.fields_sizer3 = wx.GridBagSizer(vgap=10, hgap=10)
59
-
60
-        # Basic Fields
61
-        self.fieldgroup[0]['personality'] = Field(
62
-            text="Personality",
63
-            type=TYPES.choice,
64
-            choices=['compute', 'controller', 'storage'],
65
-            initial='compute'
66
-        )
67
-        self.fieldgroup[0]['hostname'] = Field(
68
-            text="Hostname",
69
-            type=TYPES.string,
70
-            initial=parent.get_next_hostname()
71
-        )
72
-        self.fieldgroup[0]['mgmt_mac'] = Field(
73
-            text="Management MAC Address",
74
-            type=TYPES.string,
75
-            initial=""
76
-        )
77
-        self.fieldgroup[0]['mgmt_ip'] = Field(
78
-            text="Management IP Address",
79
-            type=TYPES.string,
80
-            initial=""
81
-        )
82
-        self.fieldgroup[0]['location'] = Field(
83
-            text="Location",
84
-            type=TYPES.string,
85
-            initial=""
86
-        )
87
-
88
-        # Board Management
89
-        self.fieldgroup[1]['uses_bm'] = Field(
90
-            text="This host uses Board Management",
91
-            type=TYPES.checkbox,
92
-            initial="",
93
-            shows=['bm_ip', 'bm_username',
94
-                   'bm_password', 'power_on'],
95
-            transient=True
96
-        )
97
-        self.fieldgroup[1]['bm_ip'] = Field(
98
-            text="Board Management IP Address",
99
-            type=TYPES.string,
100
-            initial=""
101
-        )
102
-        self.fieldgroup[1]['bm_username'] = Field(
103
-            text="Board Management username",
104
-            type=TYPES.string,
105
-            initial=""
106
-        )
107
-        self.fieldgroup[1]['bm_password'] = Field(
108
-            text="Board Management password",
109
-            type=TYPES.string,
110
-            initial=""
111
-        )
112
-        self.fieldgroup[1]['power_on'] = Field(
113
-            text="Power on host",
114
-            type=TYPES.checkbox,
115
-            initial="N",
116
-            transient=True
117
-        )
118
-
119
-        # Installation Parameters
120
-        self.fieldgroup[2]['boot_device'] = Field(
121
-            text="Boot Device",
122
-            type=TYPES.string,
123
-            initial=""
124
-        )
125
-        self.fieldgroup[2]['rootfs_device'] = Field(
126
-            text="Rootfs Device",
127
-            type=TYPES.string,
128
-            initial=""
129
-        )
130
-        self.fieldgroup[2]['install_output'] = Field(
131
-            text="Installation Output",
132
-            type=TYPES.choice,
133
-            choices=['text', 'graphical'],
134
-            initial="text"
135
-        )
136
-        self.fieldgroup[2]['console'] = Field(
137
-            text="Console",
138
-            type=TYPES.string,
139
-            initial=""
140
-        )
141
-
142
-        prepare_fields(self, self.fieldgroup[0], self.fields_sizer1,
143
-                       self.on_change)
144
-        prepare_fields(self, self.fieldgroup[1], self.fields_sizer2,
145
-                       self.on_change)
146
-        prepare_fields(self, self.fieldgroup[2], self.fields_sizer3,
147
-                       self.on_change)
148
-
149
-        # Bind button handlers
150
-        self.Bind(wx.EVT_CHOICE, self.on_personality,
151
-                  self.fieldgroup[0]['personality'].input)
152
-
153
-        self.Bind(wx.EVT_TEXT, self.on_hostname,
154
-                  self.fieldgroup[0]['hostname'].input)
155
-
156
-        # Control Buttons
157
-        self.button_sizer = wx.BoxSizer(orient=wx.HORIZONTAL)
158
-
159
-        self.add = wx.Button(self, -1, "Add a New Host")
160
-        self.Bind(wx.EVT_BUTTON, self.on_add, self.add)
161
-
162
-        self.remove = wx.Button(self, -1, "Remove this Host")
163
-        self.Bind(wx.EVT_BUTTON, self.on_remove, self.remove)
164
-
165
-        self.button_sizer.Add(self.add)
166
-        self.button_sizer.Add(self.remove)
167
-
168
-        # Add fields and spacers
169
-        self.sizer.Add(self.fields_sizer1)
170
-        self.sizer.AddWindow(wx.StaticLine(self, -1), 0, wx.EXPAND | wx.ALL,
171
-                             PADDING)
172
-        self.sizer.Add(self.fields_sizer2)
173
-        self.sizer.AddWindow(wx.StaticLine(self, -1), 0, wx.EXPAND | wx.ALL,
174
-                             PADDING)
175
-        self.sizer.Add(self.fields_sizer3)
176
-        self.sizer.AddStretchSpacer()
177
-        self.sizer.AddWindow(wx.StaticLine(self, -1), 0, wx.EXPAND | wx.ALL,
178
-                             PADDING)
179
-        self.sizer.Add(self.button_sizer, border=10, flag=wx.CENTER)
180
-
181
-    def on_hostname(self, event, string=None):
182
-        """Update the List entry text to match the new hostname
183
-        """
184
-        string = string or event.GetString()
185
-        index = self.parent.GetSelection()
186
-        self.parent.SetPageText(index, string)
187
-        self.parent.parent.Layout()
188
-
189
-    def on_personality(self, event, string=None):
190
-        """Remove hostname field if it's a storage or controller
191
-        """
192
-        string = string or event.GetString()
193
-        index = self.parent.GetSelection()
194
-        if string == 'compute':
195
-            self.fieldgroup[0]['hostname'].show(True)
196
-            self.parent.SetPageText(index,
197
-                                    self.fieldgroup[0]['hostname'].get_value())
198
-            return
199
-        elif string == 'controller':
200
-            self.fieldgroup[0]['hostname'].show(False)
201
-        elif string == 'storage':
202
-            self.fieldgroup[0]['hostname'].show(False)
203
-        self.parent.SetPageText(index, string)
204
-        self.parent.Layout()
205
-
206
-    def on_add(self, event):
207
-        try:
208
-            self.validate()
209
-        except Exception as ex:
210
-            wx.LogError("Error on page: " + ex.message)
211
-            return
212
-
213
-        self.parent.new_page()
214
-
215
-    def on_remove(self, event):
216
-        if self.parent.GetPageCount() is 1:
217
-            wx.LogError("Must leave at least one host")
218
-            return
219
-        index = self.parent.GetSelection()
220
-        self.parent.DeletePage(index)
221
-
222
-    def to_xml(self):
223
-        """Create the XML for this host
224
-        """
225
-        self.validate()
226
-
227
-        attrs = ""
228
-        # Generic handling
229
-        for fgroup in self.fieldgroup:
230
-            for name, field in fgroup.items():
231
-                if field.transient or not field.get_value():
232
-                    continue
233
-                attrs += "\t\t<" + name + ">" + \
234
-                         field.get_value() + "</" + name + ">\n"
235
-
236
-        # Special Fields
237
-        if self.fieldgroup[1]['power_on'].get_value() is 'Y':
238
-            attrs += "\t\t<power_on/>\n"
239
-
240
-        if self.fieldgroup[1]['uses_bm'].get_value() is 'Y':
241
-            attrs += "\t\t<bm_type>bmc</bm_type>\n"
242
-
243
-        return "\t<host>\n" + attrs + "\t</host>\n"
244
-
245
-    def validate(self):
246
-        if self.fieldgroup[0]['personality'].get_value() == "compute" and not \
247
-                utils.is_valid_hostname(
248
-                    self.fieldgroup[0]['hostname'].get_value()):
249
-            raise exceptions.ValidateFail(
250
-                "Hostname %s is not valid" %
251
-                self.fieldgroup[0]['hostname'].get_value())
252
-
253
-        if not utils.is_valid_mac(self.fieldgroup[0]['mgmt_mac'].get_value()):
254
-            raise exceptions.ValidateFail(
255
-                "Management MAC address %s is not valid" %
256
-                self.fieldgroup[0]['mgmt_mac'].get_value())
257
-
258
-        ip = self.fieldgroup[0]['mgmt_ip'].get_value()
259
-        if ip:
260
-            try:
261
-                netaddr.IPAddress(ip)
262
-            except Exception:
263
-                raise exceptions.ValidateFail(
264
-                    "Management IP address %s is not valid" % ip)
265
-
266
-        if self.fieldgroup[1]['uses_bm'].get_value() == 'Y':
267
-            ip = self.fieldgroup[1]['bm_ip'].get_value()
268
-            if ip:
269
-                try:
270
-                    netaddr.IPAddress(ip)
271
-                except Exception:
272
-                    raise exceptions.ValidateFail(
273
-                        "Board Management IP address %s is not valid" % ip)
274
-
275
-            else:
276
-                raise exceptions.ValidateFail(
277
-                    "Board Management IP is not specified.  "
278
-                    "External Board Management Network requires Board "
279
-                    "Management IP address.")
280
-
281
-    def on_change(self, event):
282
-        on_change(self, self.fieldgroup[1], event)
283
-
284
-    def set_field(self, name, value):
285
-        for fgroup in self.fieldgroup:
286
-            for fname, field in fgroup.items():
287
-                if fname == name:
288
-                    field.set_value(value)
289
-
290
-
291
-class HostBook(wx.Listbook):
292
-    def __init__(self, parent):
293
-        wx.Listbook.__init__(self, parent, style=wx.BK_DEFAULT)
294
-
295
-        self.parent = parent
296
-        self.Layout()
297
-        # Add a starting host
298
-        self.new_page()
299
-
300
-        self.Bind(wx.EVT_LISTBOOK_PAGE_CHANGED, self.on_changed)
301
-        self.Bind(wx.EVT_LISTBOOK_PAGE_CHANGING, self.on_changing)
302
-
303
-    def on_changed(self, event):
304
-        event.Skip()
305
-
306
-    def on_changing(self, event):
307
-        # Trigger page validation before leaving
308
-        if BULK_ADDING:
309
-            event.Skip()
310
-            return
311
-        index = self.GetSelection()
312
-        try:
313
-            if index != -1:
314
-                self.GetPage(index).validate()
315
-        except Exception as ex:
316
-            wx.LogError("Error on page: " + ex.message)
317
-            event.Veto()
318
-            return
319
-        event.Skip()
320
-
321
-    def new_page(self, hostname=None):
322
-        new_page = HostPage(self)
323
-        self.AddPage(new_page, hostname or self.get_next_hostname())
324
-        self.SetSelection(self.GetPageCount() - 1)
325
-        return new_page
326
-
327
-    def get_next_hostname(self, suggest=None):
328
-        prefix = "compute-"
329
-        new_suggest = suggest or 0
330
-
331
-        for existing in range(self.GetPageCount()):
332
-            if prefix + str(new_suggest) in self.GetPageText(existing):
333
-                new_suggest = self.get_next_hostname(suggest=new_suggest + 1)
334
-
335
-        if suggest:
336
-            prefix = ""
337
-        return prefix + str(new_suggest)
338
-
339
-    def to_xml(self):
340
-        """Create the complete XML and allow user to save
341
-        """
342
-        xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" \
343
-              "<hosts version=\"" + TiS_VERSION + "\">\n"
344
-        for index in range(self.GetPageCount()):
345
-            try:
346
-                xml += self.GetPage(index).to_xml()
347
-            except Exception as ex:
348
-                wx.LogError("Error on page number %s: %s" %
349
-                            (index + 1, ex.message))
350
-                return
351
-        xml += "</hosts>"
352
-
353
-        writer = wx.FileDialog(self,
354
-                               message="Save Host XML File",
355
-                               defaultDir=filedir or "",
356
-                               defaultFile=filename or "TiS_hosts.xml",
357
-                               wildcard="XML file (*.xml)|*.xml",
358
-                               style=wx.FD_SAVE,
359
-                               )
360
-
361
-        if writer.ShowModal() == wx.ID_CANCEL:
362
-            return
363
-
364
-        # Write the XML file to disk
365
-        try:
366
-            with open(writer.GetPath(), "wb") as f:
367
-                f.write(xml.encode('utf-8'))
368
-        except IOError:
369
-            wx.LogError("Error writing hosts xml file '%s'." %
370
-                        writer.GetPath())
371
-
372
-
373
-class HostGUI(wx.Frame):
374
-    def __init__(self):
375
-        wx.Frame.__init__(self, None, wx.ID_ANY,
376
-                          "Titanium Cloud Host File Creator v" + TiS_VERSION,
377
-                          size=WINDOW_SIZE)
378
-        self.panel = wx.Panel(self)
379
-
380
-        self.sizer = wx.BoxSizer(wx.VERTICAL)
381
-        self.book = HostBook(self.panel)
382
-        self.sizer.Add(self.book, 1, wx.ALL | wx.EXPAND, 5)
383
-        self.panel.SetSizer(self.sizer)
384
-        set_icons(self)
385
-
386
-        menu_bar = wx.MenuBar()
387
-
388
-        # File
389
-        file_menu = wx.Menu()
390
-        import_item = wx.MenuItem(file_menu, IMPORT_ID, '&Import')
391
-        file_menu.AppendItem(import_item)
392
-        export_item = wx.MenuItem(file_menu, EXPORT_ID, '&Export')
393
-        file_menu.AppendItem(export_item)
394
-        menu_bar.Append(file_menu, '&File')
395
-        self.Bind(wx.EVT_MENU, self.on_import, id=IMPORT_ID)
396
-        self.Bind(wx.EVT_MENU, self.on_export, id=EXPORT_ID)
397
-
398
-        self.SetMenuBar(menu_bar)
399
-        self.Layout()
400
-        self.SetMinSize(WINDOW_SIZE)
401
-        self.Show()
402
-
403
-    def on_import(self, e):
404
-        global BULK_ADDING
405
-        try:
406
-            BULK_ADDING = True
407
-            msg = ""
408
-
409
-            reader = wx.FileDialog(self,
410
-                                   "Import Existing Titanium Cloud Host File",
411
-                                   "", "", "XML file (*.xml)|*.xml",
412
-                                   wx.FD_OPEN | wx.FD_FILE_MUST_EXIST)
413
-
414
-            if reader.ShowModal() == wx.ID_CANCEL:
415
-                return
416
-
417
-            # Read in the config file
418
-            try:
419
-                with open(reader.GetPath(), 'rb') as f:
420
-                    contents = f.read()
421
-                    root = ET.fromstring(contents)
422
-            except Exception as ex:
423
-                wx.LogError("Cannot parse host file, Error: %s." % ex)
424
-                return
425
-
426
-            # Check version of host file
427
-            if root.get('version', "") != TiS_VERSION:
428
-                msg += "Warning: This file was created using tools for a " \
429
-                       "different version of Titanium Cloud than this tool " \
430
-                       "was designed for (" + TiS_VERSION + ")"
431
-
432
-            for idx, xmlhost in enumerate(root.findall('host')):
433
-                hostname = None
434
-                name_elem = xmlhost.find('hostname')
435
-                if name_elem is not None:
436
-                    hostname = name_elem.text
437
-                new_host = self.book.new_page()
438
-                self.book.GetSelection()
439
-                try:
440
-                    for attr in HOST_XML_ATTRIBUTES:
441
-                        elem = xmlhost.find(attr)
442
-                        if elem is not None and elem.text:
443
-                            # Enable and display bm section if used
444
-                            if attr == 'bm_type' and elem.text:
445
-                                new_host.set_field("uses_bm", "Y")
446
-                                handle_sub_show(
447
-                                    new_host.fieldgroup[1],
448
-                                    new_host.fieldgroup[1]['uses_bm'].shows,
449
-                                    True)
450
-                                new_host.Layout()
451
-
452
-                            # Basic field setting
453
-                            new_host.set_field(attr, elem.text)
454
-
455
-                            # Additional functionality for special fields
456
-                            if attr == 'personality':
457
-                                # Update hostname visibility and page title
458
-                                new_host.on_personality(None, elem.text)
459
-
460
-                        # Special handling for presence of power_on element
461
-                        if attr == 'power_on' and elem is not None:
462
-                            new_host.set_field(attr, "Y")
463
-
464
-                    new_host.validate()
465
-                except Exception as ex:
466
-                    if msg:
467
-                        msg += "\n"
468
-                    msg += "Warning: Added host %s has a validation error, " \
469
-                           "reason: %s" % \
470
-                           (hostname or ("with index " + str(idx)),
471
-                            ex.message)
472
-                    # No longer delete hosts with validation errors,
473
-                    # The user can fix them up before exporting
474
-                    # self.book.DeletePage(new_index)
475
-
476
-            if msg:
477
-                wx.LogWarning(msg)
478
-        finally:
479
-            BULK_ADDING = False
480
-            self.Layout()
481
-
482
-    def on_export(self, e):
483
-        # Do a validation of current page first
484
-        index = self.book.GetSelection()
485
-        try:
486
-            if index != -1:
487
-                self.book.GetPage(index).validate()
488
-        except Exception as ex:
489
-            wx.LogError("Error on page: " + ex.message)
490
-            return
491
-
492
-        # Check for hostname conflicts
493
-        hostnames = []
494
-        for existing in range(self.book.GetPageCount()):
495
-            hostname = self.book.GetPage(
496
-                existing).fieldgroup[0]['hostname'].get_value()
497
-            if hostname in hostnames:
498
-                wx.LogError("Cannot export, duplicate hostname '%s'" %
499
-                            hostname)
500
-                return
501
-            # Ignore multiple None hostnames
502
-            elif hostname:
503
-                hostnames.append(hostname)
504
-
505
-        self.book.to_xml()
506
-
507
-
508
-def main():
509
-    app = wx.App(0)  # Start the application
510
-    HostGUI()
511
-    app.MainLoop()
512
-
513
-
514
-if __name__ == '__main__':
515
-    main()

+ 0
- 30
configutilities/configutilities/configutilities/setup.py View File

@@ -1,30 +0,0 @@
1
-"""
2
-Copyright (c) 2016-2017 Wind River Systems, Inc.
3
-
4
-SPDX-License-Identifier: Apache-2.0
5
-
6
-"""
7
-
8
-from setuptools import setup
9
-from setuptools import find_packages
10
-
11
-setup(
12
-    name='wrs-configutility',
13
-    description='Titanium Cloud Configuration Utility',
14
-    version='3.1.0',
15
-    license='Apache-2.0',
16
-    platforms=['any'],
17
-    provides=['configutilities'],
18
-    packages=find_packages(),
19
-    install_requires=['netaddr>=0.7.14', 'six'],
20
-    package_data={},
21
-    include_package_data=False,
22
-    entry_points={
23
-        'gui_scripts': [
24
-            'config_gui = configutilities.configgui:main',
25
-        ],
26
-        'console_scripts': [
27
-            'config_validator = configutilities.config_validator:main'
28
-        ],
29
-    }
30
-)

BIN
configutilities/configutilities/favicon.ico View File


+ 0
- 233
configutilities/configutilities/pylint.rc View File

@@ -1,233 +0,0 @@
1
-[MASTER]
2
-# Specify a configuration file.
3
-rcfile=pylint.rc
4
-
5
-# Python code to execute, usually for sys.path manipulation such as pygtk.require().
6
-#init-hook=
7
-
8
-# Add files or directories to the blacklist. They should be base names, not paths.
9
-ignore=tests
10
-
11
-# Pickle collected data for later comparisons.
12
-persistent=yes
13
-
14
-# List of plugins (as comma separated values of python modules names) to load,
15
-# usually to register additional checkers.
16
-load-plugins=
17
-
18
-
19
-[MESSAGES CONTROL]
20
-# Enable the message, report, category or checker with the given id(s). You can
21
-# either give multiple identifier separated by comma (,) or put this option
22
-# multiple time.
23
-#enable=
24
-
25
-# Disable the message, report, category or checker with the given id(s). You
26
-# can either give multiple identifier separated by comma (,) or put this option
27
-# multiple time (only on the command line, not in the configuration file where
28
-# it should appear only once).
29
-# https://pylint.readthedocs.io/en/latest/user_guide/output.html#source-code-analysis-section
30
-# We are disabling (C)onvention
31
-# We are disabling (R)efactor
32
-# The following warnings should be fixed:
33
-# fixme (todo, xxx, fixme)
34
-# W0102: dangerous-default-value
35
-# W0106: expression-not-assigned
36
-# W0107: unnecessary-pass
37
-# W0201: attribute-defined-outside-init
38
-# W0231: super-init-not-called
39
-# W0235: useless-super-delegation
40
-# W0311: bad-indentation
41
-# W0603: global-statement
42
-# W0611: unused-import
43
-# W0612: unused-variable
44
-# W0613: unused-argument
45
-# W0622: redefined-builtin
46
-# W0703: broad-except
47
-# W1401: anomalous-backslash-in-string
48
-# E0401: import-error
49
-# E1101: no-member
50
-disable=C, R, fixme, W0102, W0106, W0107, W0201, W0231, W0235, W0311,
51
-        W0603, W0611, W0612, W0613, W0622, W0703, W1401, E0401, E1101
52
-
53
-[REPORTS]
54
-# Set the output format. Available formats are text, parseable, colorized, msvs
55
-# (visual studio) and html
56
-output-format=text
57
-
58
-# Put messages in a separate file for each module / package specified on the
59
-# command line instead of printing them on stdout. Reports (if any) will be
60
-# written in a file name "pylint_global.[txt|html]".
61
-files-output=no
62
-
63
-# Tells whether to display a full report or only the messages
64
-reports=no
65
-
66
-# Python expression which should return a note less than 10 (10 is the highest
67
-# note). You have access to the variables errors warning, statement which
68
-# respectively contain the number of errors / warnings messages and the total
69
-# number of statements analyzed. This is used by the global evaluation report
70
-# (RP0004).
71
-evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
72
-
73
-
74
-[SIMILARITIES]
75
-# Minimum lines number of a similarity.
76
-min-similarity-lines=4
77
-
78
-# Ignore comments when computing similarities.
79
-ignore-comments=yes
80
-
81
-# Ignore docstrings when computing similarities.
82
-ignore-docstrings=yes
83
-
84
-
85
-[FORMAT]
86
-# Maximum number of characters on a single line.
87
-max-line-length=85
88
-
89
-# Maximum number of lines in a module
90
-max-module-lines=1000
91
-
92
-# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 tab).
93
-indent-string='    '
94
-
95
-
96
-[TYPECHECK]
97
-# Tells whether missing members accessed in mixin class should be ignored. A
98
-# mixin class is detected if its name ends with "mixin" (case insensitive).
99
-ignore-mixin-members=yes
100
-
101
-# List of classes names for which member attributes should not be checked
102
-# (useful for classes with attributes dynamically set).
103
-ignored-classes=SQLObject
104
-
105
-# List of members which are set dynamically and missed by pylint inference
106
-# system, and so shouldn't trigger E0201 when accessed. Python regular
107
-# expressions are accepted.
108
-generated-members=REQUEST,acl_users,aq_parent
109
-
110
-
111
-[BASIC]
112
-# List of builtins function names that should not be used, separated by a comma
113
-bad-functions=map,filter,apply,input
114
-
115
-# Regular expression which should only match correct module names
116
-module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
117
-
118
-# Regular expression which should only match correct module level names
119
-const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
120
-
121
-# Regular expression which should only match correct class names
122
-class-rgx=[A-Z_][a-zA-Z0-9]+$
123
-
124
-# Regular expression which should only match correct function names
125
-function-rgx=[a-z_][a-z0-9_]{2,30}$
126
-
127
-# Regular expression which should only match correct method names
128
-method-rgx=[a-z_][a-z0-9_]{2,30}$
129
-
130
-# Regular expression which should only match correct instance attribute names
131
-attr-rgx=[a-z_][a-z0-9_]{2,30}$
132
-
133
-# Regular expression which should only match correct argument names
134
-argument-rgx=[a-z_][a-z0-9_]{2,30}$
135
-
136
-# Regular expression which should only match correct variable names
137
-variable-rgx=[a-z_][a-z0-9_]{2,30}$
138
-
139
-# Regular expression which should only match correct list comprehension /
140
-# generator expression variable names
141
-inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
142
-
143
-# Good variable names which should always be accepted, separated by a comma
144
-good-names=i,j,k,ex,Run,_
145
-
146
-# Bad variable names which should always be refused, separated by a comma
147
-bad-names=foo,bar,baz,toto,tutu,tata
148
-
149
-# Regular expression which should only match functions or classes name which do
150
-# not require a docstring
151
-no-docstring-rgx=__.*__
152
-
153
-
154
-[MISCELLANEOUS]
155
-# List of note tags to take in consideration, separated by a comma.
156
-notes=FIXME,XXX,TODO
157
-
158
-
159
-[VARIABLES]
160
-# Tells whether we should check for unused import in __init__ files.
161
-init-import=no
162
-
163
-# A regular expression matching the beginning of the name of dummy variables
164
-# (i.e. not used).
165
-dummy-variables-rgx=_|dummy
166
-
167
-# List of additional names supposed to be defined in builtins. Remember that
168
-# you should avoid to define new builtins when possible.
169
-additional-builtins=
170
-
171
-
172
-[IMPORTS]
173
-# Deprecated modules which should not be used, separated by a comma
174
-deprecated-modules=regsub,string,TERMIOS,Bastion,rexec
175
-
176
-# Create a graph of every (i.e. internal and external) dependencies in the
177
-# given file (report RP0402 must not be disabled)
178
-import-graph=
179
-
180
-# Create a graph of external dependencies in the given file (report RP0402 must
181
-# not be disabled)
182
-ext-import-graph=
183
-
184
-# Create a graph of internal dependencies in the given file (report RP0402 must
185
-# not be disabled)
186
-int-import-graph=
187
-
188
-
189
-[DESIGN]
190
-# Maximum number of arguments for function / method
191
-max-args=5
192
-
193
-# Argument names that match this expression will be ignored. Default to name
194
-# with leading underscore
195
-ignored-argument-names=_.*
196
-
197
-# Maximum number of locals for function / method body
198
-max-locals=15
199
-
200
-# Maximum number of return / yield for function / method body
201
-max-returns=6
202
-
203
-# Maximum number of branch for function / method body
204
-max-branchs=12
205
-
206
-# Maximum number of statements in function / method body
207
-max-statements=50
208
-
209
-# Maximum number of parents for a class (see R0901).
210
-max-parents=7
211
-
212
-# Maximum number of attributes for a class (see R0902).
213
-max-attributes=7
214
-
215
-# Minimum number of public methods for a class (see R0903).
216
-min-public-methods=2
217
-
218
-# Maximum number of public methods for a class (see R0904).
219
-max-public-methods=20
220
-
221
-
222
-[CLASSES]
223
-# List of method names used to declare (i.e. assign) instance attributes.
224
-defining-attr-methods=__init__,__new__,setUp
225
-
226
-# List of valid names for the first argument in a class method.
227
-valid-classmethod-first-arg=cls
228
-
229
-
230
-[EXCEPTIONS]
231
-# Exceptions that will emit a warning when being caught. Defaults to
232
-# "Exception"
233
-overgeneral-exceptions=Exception

+ 0
- 27
configutilities/configutilities/setup.py View File

@@ -1,27 +0,0 @@
1
-"""
2
-Copyright (c) 2016 Wind River Systems, Inc.
3
-
4
-SPDX-License-Identifier: Apache-2.0
5
-
6
-"""
7
-
8
-from setuptools import setup
9
-from setuptools import find_packages
10
-