From 4ccc4c5aebe63f97530200a92eb8b4d5ce012349 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Tue, 29 Mar 2022 10:15:23 -0700 Subject: [PATCH] Report relative path in deprecated-config test. --- test/sanity/code-smell/deprecated-config.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/sanity/code-smell/deprecated-config.py b/test/sanity/code-smell/deprecated-config.py index 3c5c6459296..474628a35cb 100644 --- a/test/sanity/code-smell/deprecated-config.py +++ b/test/sanity/code-smell/deprecated-config.py @@ -89,11 +89,14 @@ def main(): ) base = os.path.join(os.path.dirname(ansible.config.__file__), 'base.yml') + root_path = os.path.dirname(os.path.dirname(os.path.dirname(ansible.__file__))) + relative_base = os.path.relpath(base, root_path) + with open(base) as f: data = yaml.safe_load(f) for result in find_deprecations(data): - print('%s: %s is scheduled for removal in %s' % (base, '.'.join(str(i) for i in result[0][:-2]), result[1])) + print('%s: %s is scheduled for removal in %s' % (relative_base, '.'.join(str(i) for i in result[0][:-2]), result[1])) if __name__ == '__main__':