Skip to content

Commit

Permalink
Fix fields validation in non utf-8 environments (#18130) (#18136)
Browse files Browse the repository at this point in the history
There was a non-ascii character in fields documentation that was making
fields validation in some tests to fail.

Fix fields validation to don't fail on this case, and replace the non-ascii
character.

(cherry picked from commit 93b5998)
  • Loading branch information
jsoriano committed Apr 30, 2020
1 parent e374fae commit 5e151a3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion libbeat/tests/system/beat/beat.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ def extract_fields(doc_list, name):

# TODO: Make fields_doc path more generic to work with beat-generator. If it can't find file
# "fields.yml" you should run "make update" on metricbeat folder
with open(fields_doc, "r") as f:
with open(fields_doc, "r", encoding="utf_8") as f:
path = os.path.abspath(os.path.dirname(__file__) + "../../../../fields.yml")
if not os.path.isfile(path):
path = os.path.abspath(os.path.dirname(__file__) + "../../../../_meta/fields.common.yml")
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -4168,7 +4168,7 @@ type: long
*`aws.sns.metrics.NumberOfNotificationsFilteredOut-InvalidAttributes.sum`*::
+
--
The number of messages that were rejected by subscription filter policies because the messages' attributes are invalid for example, because the attribute JSON is incorrectly formatted.
The number of messages that were rejected by subscription filter policies because the messages' attributes are invalid - for example, because the attribute JSON is incorrectly formatted.

type: long

Expand Down
Loading

0 comments on commit 5e151a3

Please sign in to comment.