Skip to content

serializers.yamlex is doing something weird with its string representation #47085

@mattp-

Description

@mattp-

Description of Issue/Question

when using yamlex,

#!yamlex
/srv:
  file.directory:
    - makedirs: True
    - group: root
    - user: root
    - mode: 755

the following fails

mmp-sl-test-1:
----------
          ID: "/srv"
    Function: file.directory
      Result: False
     Comment: Group "root" is not available
     Started: 15:26:39.835190
    Duration: 9.279 ms
     Changes:

if you remove the try guard,

KeyError: 'getgrnam(): name not found: "root"'

it seems to be making the root string not actually root. when evaluating group == 'root' before the getgrnam() it evaluated as true, so it's likely something with utf8 encoding that yamlex is doing.

Salt Version:
           Salt: 2018.3.0-2279-g68546d2

Dependency Versions:
           cffi: 1.11.5
       cherrypy: unknown
       dateutil: 2.6.1
      docker-py: 3.1.4
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.10
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: 0.29.0
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.5.6
   mysql-python: Not Installed
      pycparser: 2.18
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.14 (default, Mar 14 2018, 09:26:40)
   python-gnupg: Not Installed
         PyYAML: 3.12
          PyZMQ: 17.0.0
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.5.3
            ZMQ: 4.1.6

System Versions:
           dist: redhat 7.3 Maipo
         locale: UTF-8
        machine: x86_64
        release: 3.10.0-514.6.1.el7.x86_64
         system: Linux
        version: Red Hat Enterprise Linux Server 7.3 Maipo```

Metadata

Metadata

Assignees

No one assigned

    Labels

    ConfirmedSalt engineer has confirmed bug/feature - often including a MCVERenderersbugbroken, incorrect, or confusing behaviorseverity-medium3rd level, incorrect or bad functionality, confusing and lacks a work around

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions