From be65d9cfe5f627cdd00b25a4a73aeb80332d90eb Mon Sep 17 00:00:00 2001
From: Adrian Likins <alikins@redhat.com>
Date: Wed, 21 Feb 2018 12:31:41 -0500
Subject: [PATCH] Skip sanity tests that don't apply to bundled code

* add distro to pep8 skip tests
* Skip no-assert test for distro
* Add bundled distro to the empty-init skip list
---
 test/sanity/code-smell/empty-init.py | 4 +++-
 test/sanity/code-smell/no-assert.py  | 1 +
 test/sanity/pep8/skip.txt            | 3 +++
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/test/sanity/code-smell/empty-init.py b/test/sanity/code-smell/empty-init.py
index ee9f9018858..bde356fa968 100755
--- a/test/sanity/code-smell/empty-init.py
+++ b/test/sanity/code-smell/empty-init.py
@@ -9,9 +9,11 @@ def main():
         'test/sanity/code-smell/%s' % os.path.basename(__file__),
         # facts is grandfathered in but will break namespacing
         # the only way to fix it is to deprecate and eventually remove it
-        # six will break namespacing but because it is bundled we should not be overriding it
+        # six and distro will break namespacing but because it is bundled we should not be
+        # overriding it
         'lib/ansible/module_utils/facts/__init__.py',
         'lib/ansible/module_utils/six/__init__.py',
+        'lib/ansible/module_utils/distro/__init__.py',
     ])
 
     for path in sys.argv[1:] or sys.stdin.read().splitlines():
diff --git a/test/sanity/code-smell/no-assert.py b/test/sanity/code-smell/no-assert.py
index 1f2ff1f44ce..ca151967fbe 100755
--- a/test/sanity/code-smell/no-assert.py
+++ b/test/sanity/code-smell/no-assert.py
@@ -12,6 +12,7 @@ def main():
     skip = set([
         'test/sanity/code-smell/%s' % os.path.basename(__file__),
         'lib/ansible/module_utils/compat/ipaddress.py',
+        'lib/ansible/module_utils/distro/_distro.py',
     ])
 
     for path in sys.argv[1:] or sys.stdin.read().splitlines():
diff --git a/test/sanity/pep8/skip.txt b/test/sanity/pep8/skip.txt
index e69de29bb2d..ef9a4136814 100644
--- a/test/sanity/pep8/skip.txt
+++ b/test/sanity/pep8/skip.txt
@@ -0,0 +1,3 @@
+# _distro.py is being bundled and we don't want to modify bundled code in our repository.
+# We can retest anytime we update the bundled copy
+lib/ansible/module_utils/distro/_distro.py