Merge "Add exclusions to the unused param warning" into stable/queens
This commit is contained in:
commit
eb9abecdd2
|
@ -74,3 +74,13 @@ DEPRECATED_SERVICES = {"OS::TripleO::Services::OpenDaylightApi":
|
||||||
"alternatives such as OVS or OVN. "}
|
"alternatives such as OVS or OVN. "}
|
||||||
|
|
||||||
DEFAULT_VALIDATIONS_BASEDIR = '/usr/share/openstack-tripleo-validations'
|
DEFAULT_VALIDATIONS_BASEDIR = '/usr/share/openstack-tripleo-validations'
|
||||||
|
|
||||||
|
# regex patterns to exclude when looking for unused params
|
||||||
|
# - exclude *Image params as they may be unused because the service is not
|
||||||
|
# enabled
|
||||||
|
# - exclude SwiftFetchDir*Tempurl because it's used by ceph and generated by us
|
||||||
|
# - exclude PythonInterpreter because it's generated by us and only used
|
||||||
|
# in some custom scripts
|
||||||
|
UNUSED_PARAMETER_EXCLUDES_RE = ['^(Docker|Container).*Image$',
|
||||||
|
'^SwiftFetchDir(Get|Put)Tempurl$',
|
||||||
|
'^PythonInterpreter$']
|
||||||
|
|
|
@ -9,8 +9,10 @@
|
||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
import re
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
|
from tripleoclient.constants import UNUSED_PARAMETER_EXCLUDES_RE
|
||||||
from tripleoclient import exceptions
|
from tripleoclient import exceptions
|
||||||
from tripleoclient.workflows import base
|
from tripleoclient.workflows import base
|
||||||
|
|
||||||
|
@ -123,9 +125,15 @@ def check_deprecated_parameters(clients, container):
|
||||||
print('\n'.join([' {}'.format(param)
|
print('\n'.join([' {}'.format(param)
|
||||||
for param in deprecated_params]))
|
for param in deprecated_params]))
|
||||||
|
|
||||||
|
# exclude our known params that may not be used
|
||||||
|
ignore_re = re.compile('|'.join(UNUSED_PARAMETER_EXCLUDES_RE))
|
||||||
|
unused_params = [p for p in unused_params if not ignore_re.search(p)]
|
||||||
|
|
||||||
if unused_params:
|
if unused_params:
|
||||||
print('WARNING: Following parameters are defined but not used in '
|
unused_join = ', '.join(
|
||||||
'plan. Could be possible that parameter is valid but '
|
['{param}'.format(param=param) for param in unused_params])
|
||||||
'currently not used.')
|
print('WARNING: Following parameter(s) are defined but not '
|
||||||
print('\n'.join([' {}'.format(param)
|
'currently used in the deployment plan. These parameters '
|
||||||
for param in unused_params]))
|
'may be valid but not in use due to the service or '
|
||||||
|
'deployment configuration.'
|
||||||
|
' {unused_join}'.format(unused_join=unused_join))
|
||||||
|
|
Loading…
Reference in New Issue