New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

file.grep with glob (*) in path produces file not found error #48659

Closed
dstoliker opened this Issue Jul 18, 2018 · 3 comments

Comments

Projects
None yet
3 participants
@dstoliker

dstoliker commented Jul 18, 2018

Description of Issue/Question

file.grep returns No such file or directory error when using a glob (*) in the path

Steps to Reproduce Issue

Using examples from the documentation for file.grep:
This works:

$ sudo salt '*' file.grep /etc/sysconfig/network-scripts/ifcfg-lo ipaddr -- -i
saltmaster:
    ----------
    pid:
        6939
    retcode:
        0
    stderr:
    stdout:
        IPADDR=127.0.0.1

This does not work:

$ sudo salt '*' file.grep "/etc/sysconfig/network-scripts/*" ipaddr -- -i -l
saltmaster:
    ----------
    pid:
        7155
    retcode:
        2
    stderr:
        grep: /etc/sysconfig/network-scripts/*: No such file or directory
    stdout:
ERROR: Minions returned with non-zero exit code

Versions Report

           Salt: 2018.3.2

Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: Not Installed
      docker-py: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.7.2
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.5.6
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.5 (default, Aug  4 2017, 00:39:18)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 15.3.0
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.1.4

System Versions:
           dist: centos 7.4.1708 Core
         locale: UTF-8
        machine: x86_64
        release: 3.10.0-693.21.1.el7.x86_64
         system: Linux
        version: CentOS Linux 7.4.1708 Core

@garethgreenaway garethgreenaway added this to the Approved milestone Jul 19, 2018

@garethgreenaway

This comment has been minimized.

Member

garethgreenaway commented Jul 19, 2018

Looks like the function is taking the file argument as is and not expanding it if necessary. Since the function currently doesn't do it I'm marking it as a future feature addition.

@garethgreenaway

This comment has been minimized.

Member

garethgreenaway commented Jul 30, 2018

Apologies. I missed in the documentation that this is supposed to be a supported option. Re-tagging as a bug.

@rallytime

This comment has been minimized.

Contributor

rallytime commented Jul 31, 2018

@dstoliker See #48830 for the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment