module.run file.find failed: '<' not supported between instances of 'str' and 'list'
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 15.7k
- Forks
- 5.6k
- Avg merge
- 2d 44m
- Merged PRs (30d)
- 80
Description
Description
In my state we are running file.find using module.run. Here we are checking log files which are older than 10 days and delete them according by passing delete: f as a option. When there are files to delete then it fails with:
'file.find' failed: '<' not supported between instances of 'str' and 'list'
Setup
Need some files older than 10 days or change the value in state files, otherwise it will not produce any error
delete test:
module.run:
- file.find:
- path: /tmp/
- iname: "*_access_log.*.log"
- delete: f
- maxdepth: 1
- mtime: +10d
- print: path,size,mtime
output:
ID: delete test
Function: module.run
Result: False
Comment: 'file.find' failed: '<' not supported between instances of 'str' and 'list'
Started: 17:10:34.548267
Duration: 14.472 ms
Changes:
Expected behavior
It should return the file path, size, mtime which are deleted using this state as we have specified in print option.
Versions Report
Salt: 3002.6
Dependency Versions:
cffi: 1.11.5
cherrypy: unknown
Python: 3.6.8 (default, Sep 9 2021, 07:49:02)
System Versions:
dist: rhel 8.5 Ootpa
locale: UTF-8
machine: x86_64
release: 4.18.0-348.7.1.el8_5.x86_64
system: Linux
version: Red Hat Enterprise Linux 8.5 Ootpa
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the Salt 3002.6 state with module.run, file.find, delete: f, and print: path,size,mtime using files older than 10 days. Trace how file.find handles the delete and print options; done means deletion succeeds without the string/list comparison error and the requested file path, size, and mtime are returned.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- infrastructure
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100