Skip to content

Thorium reg.py no attribute split for integer #43364

Closed

Description

@pgporada

Description of Issue/Question

2017-09-06 01:27:36,739 [salt.state                                           ][INFO    ][2881] Running state [foo] at time 01:27:36.739067
2017-09-06 01:27:36,740 [salt.state                                           ][INFO    ][2881] Executing state reg.list for foo
2017-09-06 01:27:36,742 [salt.state                                           ][ERROR   ][2881] An exception occurred in this state: Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/salt/state.py", line 1750, in call
    **cdata['kwargs'])
  File "/usr/lib/python2.7/site-packages/salt/loader.py", line 1705, in wrapper
    return f(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/salt/thorium/reg.py", line 73, in list_
    add = add.split(',')
AttributeError: 'int' object has no attribute 'split'

2017-09-06 01:27:36,743 [salt.state                                           ][INFO    ][2881] Completed state [foo] at time 01:27:36.743004 duration_in_ms=3.943

Setup

/etc/salt/master

engines:
  - thorium: {}
thorium_roots:
  base:
    - /srv/thorium

/srv/thorium/top.sls

base:
  '*':
    - foo.sls

/srv/thorium/foo.sls

foo:
  reg.list:
    - add: 42
    - match: phil/was/here
    - stamp: True

myregister:
  file.save

Steps to Reproduce Issue

salt-master -d
salt-minion -d
Wait...

salt-call event.send '{"value": "42"}' 'phil/was/here'
tail -f /var/log/salt/master

Versions Report

This is running in a centos:7 container

Salt Version:
           Salt: 2016.11.7
 
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.4.8
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.5 (default, Nov  6 2016, 00:28:07)
   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.3.1611 Core
        machine: x86_64
        release: 4.9.35-20.pvops.qubes.x86_64
         system: Linux
        version: CentOS Linux 7.3.1611 Core

Activity

  1. Ch3LL commented on Sep 6, 2017

    @Ch3LL
    Contributor

    @pgporada

    If you quote 42 in the state file like so:

    foo:
      reg.list:
        - add: "42"
        - match: phil/was/here
        - stamp: True
    

    do you get that error?

    ping @thatch45 do we want to be able to handle integers within the register? or should everything be handled as a string?

  2. added
    pending-discussion
    on Sep 6, 2017
  3. added this to the Blocked milestone on Sep 6, 2017
  4. thatch45 commented on Sep 6, 2017

    @thatch45
    Contributor

    @pgporada I would accept a PR to add an isinstance check for the register so it could take in an int. That would be the quickest way to get this fixed.

  5. pgporada commented on Sep 6, 2017

    @pgporada
    ContributorAuthor

    @Ch3LL
    Yes, quoting it adds it to the register correctly. I should have updated the ticket.

    @thatch45
    I can do that.

  6. added
    bug
    severity-medium
    P4
    and removed
    pending-discussion
    on Sep 6, 2017
  7. modified the milestones: Approved, Blocked on Sep 6, 2017
  8. added
    Core
    on Sep 6, 2017
  9. thatch45 commented on Sep 6, 2017

    @thatch45
    Contributor

    Awesome, thanks :)

  10. stale commented on Dec 31, 2018

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

    If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

  11. 6 remaining items

  12. removed
    P4
    on Jun 3, 2020
  13. self-assigned this
    on Aug 24, 2023
  14. modified the milestones: Approved, Argon v3008 on Aug 24, 2023
  15. added a commit that references this issue on Aug 7, 2026
    f85e760
  16. added a commit that references this issue on Oct 27, 2026
    3a13b0e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Corebugseverity-medium

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions