summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
33f1fd4)
In the VPP PAPI stats code, the "ls" argument has always [0]
been named "patterns", suggesting it expects a list of strings.
In the CSIT utility we have always [1] been using it wrong
(passing a single string), but it happened to work
as VPP code had a workaround [2] for that.
This workaround that got removed by accident in [3],
and will be reintroduced in [4].
This change fixes occasional failures in CSIT
(if merged sooner than [4]), mainly useful
in aviding such failures during bisection.
[0] https://gerrit.fd.io/r/c/vpp/+/14584/4/src/vpp-api/python/vpp_papi/vpp_stats.py#122
[1] https://gerrit.fd.io/r/c/csit/+/18419/13/resources/tools/papi/vpp_papi_provider.py#181
[2] https://gerrit.fd.io/r/c/vpp/+/14584/4/src/vpp-api/python/vpp_papi/vpp_stats.py#64
[3] https://gerrit.fd.io/r/c/vpp/+/31678
[4] https://gerrit.fd.io/r/c/vpp/+/31817
Change-Id: Ic0f9d906be064b386b67154ba738646c4362aa2b
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
-# Copyright (c) 2020 Cisco and/or its affiliates.
+# Copyright (c) 2021 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
reply = list()
for path in json_data:
reply = list()
for path in json_data:
- directory = stats.ls(path)
+ # The ls method can match multiple patterns,
+ # but we feed it one path at a time anyway, because the caller
+ # expect results in a list, one item per path.
+ # Most VPP versions understand a string is a single pattern,
+ # but some blindly iterate (as if it was a list of chars).
+ directory = stats.ls([path])
data = stats.dump(directory)
reply.append(data)
data = stats.dump(directory)
reply.append(data)