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

Fixed ini.options_absent. Resolves #33590. #33606

Merged
merged 1 commit into from
May 31, 2016

Conversation

danslimmon
Copy link
Contributor

What does this PR do?

It fixes the bug #33590 where the state ini.options_absent would crash with an "unhashable type" error.

What issues does this PR fix or reference?

#33590

Previous Behavior

----------
          ID: /home/ubuntu/test.ini
    Function: ini.options_absent
      Result: False
     Comment: An exception occurred in this state: Traceback (most recent call last):
                File "/opt/vagrant/salt/state.py", line 1703, in call
                  **cdata['kwargs'])
                File "/opt/vagrant/salt/loader.py", line 1649, in wrapper
                  return f(*args, **kwargs)
                File "/opt/vagrant/salt/states/ini_manage.py", line 114, in options_absent
                  current_value = __salt__['ini.remove_option'](name, section, key)
                File "/opt/vagrant/salt/modules/ini_manage.py", line 124, in remove_option
                  value = inifile.get(section, {}).pop(option, None)
                File "/usr/lib/python2.7/collections.py", line 155, in pop
                  if key in self:
              TypeError: unhashable type: 'list'
     Started: 02:54:06.809985
    Duration: 9.262 ms
     Changes:

New Behavior

----------
          ID: /home/ubuntu/test.ini
    Function: ini.options_absent
      Result: True
     Comment: Changes take effect
     Started: 02:58:53.498259
    Duration: 3.88 ms
     Changes:
              ----------
              test2:
                  ----------
                  absent_opt:
                      7
                  test2_opt:
                      0

Tests written?

No.

I can add test logic to the module if you think that's appropriate. I would need to add test logic to the module to bypass the normal behavior, so I'm not sure that would be a meaningful test.

@danslimmon
Copy link
Contributor Author

The default and jenkins/PR/salt-pr-linode-ubuntu14-n tests failed, but it looks like that's just because of an apt mutex issue:

Unable to locate package python-plist=ERROR: E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)

@cachedout cachedout merged commit 23506f8 into saltstack:2016.3 May 31, 2016
@cachedout
Copy link
Contributor

Thanks, @danslimmon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants