Skip to content
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

[BUG] pdbedit.create fails with cannot use a string pattern on a bytes-like object #62670

Closed
mariushoch opened this issue Sep 13, 2022 · 0 comments · Fixed by #62671
Closed
Labels
Bug broken, incorrect, or confusing behavior bytes-vs-strings py2 vs py3 bytes vs strings encode/decode errors needs-triage

Comments

@mariushoch
Copy link
Contributor

Description
When using pdbedit.create it fails with Passed invalid arguments: cannot use a string pattern on a bytes-like object..

Setup
Can be reproduced using the below Dockerfile:

FROM docker.io/rockylinux/rockylinux:8

RUN dnf -y install "https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm"
RUN dnf --setopt=install_weak_deps=False install -y 'dnf-command(config-manager)' sudo samba
RUN dnf -y config-manager --set-enabled powertools
RUN curl -o /root/bootstrap-salt.sh -L https://bootstrap.saltproject.io
RUN bash /root/bootstrap-salt.sh -X
RUN sh -c 'echo "username map = /etc/samba/user_map" > /etc/samba/smb.conf'
RUN adduser foo
podman build -f Dockerfile --tag salt-pdbedit-test
podman run --rm --security-opt label=disable salt-pdbedit-test salt-call --id "test" --local pdbedit.create foo bar

This yields Passed invalid arguments: cannot use a string pattern on a bytes-like object.

Steps to Reproduce the behavior
(Include debug logs if possible and relevant)

Expected behavior
Samba user should be created/ updated.

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
          Salt: 3005
 
Dependency Versions:
          cffi: Not Installed
      cherrypy: Not Installed
      dateutil: 2.6.1
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 2.10.1
       libgit2: Not Installed
      M2Crypto: 0.35.2
          Mako: Not Installed
       msgpack: 0.6.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     pycparser: Not Installed
      pycrypto: Not Installed
  pycryptodome: Not Installed
        pygit2: Not Installed
        Python: 3.6.8 (default, Nov  9 2021, 14:44:26)
  python-gnupg: Not Installed
        PyYAML: 3.12
         PyZMQ: 20.0.0
         smmap: Not Installed
       timelib: Not Installed
       Tornado: 4.5.3
           ZMQ: 4.3.4
 
System Versions:
          dist: rocky 8.5 Green Obsidian
        locale: UTF-8
       machine: x86_64
       release: 5.19.6-200.fc36.x86_64
        system: Linux
       version: Rocky Linux 8.5 Green Obsidian

Additional context
Add any other context about the problem here.

@mariushoch mariushoch added Bug broken, incorrect, or confusing behavior needs-triage labels Sep 13, 2022
@OrangeDog OrangeDog added the bytes-vs-strings py2 vs py3 bytes vs strings encode/decode errors label Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior bytes-vs-strings py2 vs py3 bytes vs strings encode/decode errors needs-triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants