]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cephadm: remove duplicates when listing files in scan
authorJohn Mulligan <jmulligan@redhat.com>
Tue, 5 Sep 2023 18:18:45 +0000 (14:18 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Mon, 11 Sep 2023 12:57:46 +0000 (08:57 -0400)
Fix running tox env flake8 during a rebase/merge where git ls-files
may return duplicate file names.

An earlier version of this change used the `--deuplicate` option to `git
ls-files` in order to remove duplicate files listed when running the
tool during rebase/merge. Mysteriously, this seemed to break the `ceph
API tests` in the CI. A completely unrelated command in a tox file that,
AFAIK, is not executed in that test suite. They ways of git are
subtle and often sucky.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/cephadm/tox.ini

index 2845124afd403d2df1dca1eeb906237abe345198..266520ff5727a802ee3d39070ed3d2ee48bfb547 100644 (file)
@@ -62,7 +62,7 @@ deps =
     flake8-quotes
 commands =
     flake8 --config=tox.ini {posargs:cephadm.py cephadmlib}
-    bash -c 'test $(git ls-files 'cephadm.py' 'cephadmlib/*.py' | xargs grep "docker.io" | wc -l) == 11'
+    bash -c 'test $(git ls-files 'cephadm.py' 'cephadmlib/*.py' | sort -u | xargs grep "docker.io" | wc -l) == 11'
 # Downstream distributions may choose to alter this "docker.io" number,
 # to make sure no new references to docker.io are creeping in unnoticed.