diff --git a/changelogs/fragments/4043-fix-no-log-opentelemetry.yml b/changelogs/fragments/4043-fix-no-log-opentelemetry.yml new file mode 100644 index 0000000000..612cf4abfb --- /dev/null +++ b/changelogs/fragments/4043-fix-no-log-opentelemetry.yml @@ -0,0 +1,2 @@ +bugfixes: + - "opentelemetry - fix generating a trace with a task containing ``no_log: true`` (https://github.com/ansible-collections/community.general/pull/4043)." diff --git a/plugins/callback/opentelemetry.py b/plugins/callback/opentelemetry.py index 444c09c423..716fc9eee7 100644 --- a/plugins/callback/opentelemetry.py +++ b/plugins/callback/opentelemetry.py @@ -321,7 +321,7 @@ class OpenTelemetrySource(object): # the order matters url_args = ("url", "api_url", "baseurl", "repo", "server_url", "chart_repo_url") for arg in url_args: - if args.get(arg): + if args is not None and args.get(arg): return args.get(arg) return ""