Repository navigation
Closed
Labels
Corerelates to code central or existential to SaltP4Priority 4State-Modulebugbroken, incorrect, or confusing behaviorseverity-medium3rd level, incorrect or bad functionality, confusing and lacks a work around
Milestone
Description
Description of Issue/Question
A state like this:
service_ssh:
grains.list_present:
- name: services
- value:
- sshd:
- hostname: localhost
- port: 22
Will work the first time but not the second. The second time it throws the following:
ID: service_ssh
Function: grains.list_present
Name: services
Result: False
Comment: An exception occurred in this state: Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/salt/state.py", line 1734, in call
**cdata['kwargs'])
File "/usr/lib/python2.7/site-packages/salt/loader.py", line 1651, in wrapper
return f(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/salt/states/grains.py", line 150, in list_present
if set(value).issubset(set(__salt__['grains.get'](name))):
TypeError: unhashable type: 'dict'
Versions Report
Salt Version:
Salt: 2016.3.5
Dependency Versions:
cffi: 1.6.0
cherrypy: 3.2.2
dateutil: 2.5.3
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
Jinja2: 2.8
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: 2.14
pycrypto: 2.6.1
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: 3.10.0-514.6.2.el7.x86_64
system: Linux
version: CentOS Linux 7.3.1611 Core
Metadata
Metadata
Assignees
Labels
Corerelates to code central or existential to SaltP4Priority 4State-Modulebugbroken, incorrect, or confusing behaviorseverity-medium3rd level, incorrect or bad functionality, confusing and lacks a work around
Activity
Ch3LL commentedon Mar 8, 2017
Looks like i'm able to replicate this.
Here is a docker container for anyone that wants to quickly replicate this:
docker run -it -v /home/ch3ll/git/salt/:/testing/ ch3ll/issues:39875 salt-call --local state.sls test -ldebug( where /home/ch3ll/git/salt is a local cloned git repo of salt.)Looks like we need to get this fixed thanks
stale commentedon Sep 14, 2018
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.
mickenordin commentedon Apr 26, 2019
This seems to be an issue still, I am affected:
In the state:
grains.list_present:
port: 1234
port: 5678
From the log:
2019-04-26T14:35:13.895806+02:00 example-lab-srv01.example.se salt-minion[577]: [ERROR ] An exception occurred in this state: Traceback (most recent call last):
2019-04-26T14:35:13.896144+02:00 example-lab-srv01.example.se salt-minion[577]: File "/usr/lib/python3/dist-packages/salt/state.py", line 1933, in call
2019-04-26T14:35:13.896346+02:00 example-lab-srv01.example.se salt-minion[577]: **cdata['kwargs'])
2019-04-26T14:35:13.896539+02:00example-lab-srv01.example.se salt-minion[577]: File "/usr/lib/python3/dist-packages/salt/loader.py", line 1939, in wrapper
2019-04-26T14:35:13.896731+02:00 example-lab-srv01.example.sesalt-minion[577]: return f(*args, **kwargs)
2019-04-26T14:35:13.896921+02:00 example-lab-srv01.example.se salt-minion[577]: File "/usr/lib/python3/dist-packages/salt/states/grains.py", line 177, in list_present
2019-04-26T14:35:13.897120+02:00 example-lab-srv01.example.se salt-minion[577]: if set(value).issubset(set(salt'grains.get')):
2019-04-26T14:35:13.897302+02:00 example-lab-srv01.example.se salt-minion[577]: TypeError: unhashable type: 'dict'
stale commentedon May 5, 2019
Thank you for updating this issue. It is no longer marked as stale.
mickenordin commentedon May 9, 2019
@dwoz I have submitted a PR that I think fixes this, and that has been reviewed. Do you have any idea of if and when that PR will be merged?Edit: The PR has been mered now, so this bug should be fixed 🎉
Ch3LL commentedon May 10, 2019
Thanks @mickenordin :) I'll go ahead and close
fix various bugs in list_present
fix various bugs in list_present
fix various bugs in list_present
fix various bugs in list_present
fix various bugs in list_present
fix various bugs in list_present
fix various bugs in list_present
fix various bugs in list_present
fix various bugs in list_present