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

salt.modules.pdbedit broken on Samba 4.9.x #50538

Closed
sjorge opened this issue Nov 16, 2018 · 1 comment

Comments

@sjorge
Copy link
Contributor

commented Nov 16, 2018

Description of Issue/Question

The pdbedit module is broken again after upgrading to Samba 4.9.2

Both pdbedit.list in verbose and non-verbose mode.

[atlas :: sjorge][~]
[.]$ salt-call pdbedit.list verbose=False
local:
    - Registered MSG_REQ_POOL_USAGE
    - Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED
    - lp_load_ex
    - Initialising global parameters
    - Processing section "[global]"
    - tmartine
    - sjorge

For non-verbose we should filter out all lines that do not follow the 'login:uid:full name' format,

[atlas :: sjorge][~]
[.]$ salt-call pdbedit.list
[ERROR   ] An un-handled exception was caught by salt's global exception handler:
KeyError: u'unix username'
Traceback (most recent call last):
  File "/opt/local/bin/salt-call", line 11, in <module>
    salt_call()
  File "/opt/local/lib/python2.7/site-packages/salt/scripts.py", line 410, in salt_call
    client.run()
  File "/opt/local/lib/python2.7/site-packages/salt/cli/call.py", line 57, in run
    caller.run()
  File "/opt/local/lib/python2.7/site-packages/salt/cli/caller.py", line 134, in run
    ret = self.call()
  File "/opt/local/lib/python2.7/site-packages/salt/cli/caller.py", line 212, in call
    ret['return'] = func(*args, **kwargs)
  File "/var/cache/salt/minion/extmods/modules/pdbedit.py", line 100, in list_users
    users[user_data['unix username']] = user_data
KeyError: u'unix username'
Traceback (most recent call last):
  File "/opt/local/bin/salt-call", line 11, in <module>
    salt_call()
  File "/opt/local/lib/python2.7/site-packages/salt/scripts.py", line 410, in salt_call
    client.run()
  File "/opt/local/lib/python2.7/site-packages/salt/cli/call.py", line 57, in run
    caller.run()
  File "/opt/local/lib/python2.7/site-packages/salt/cli/caller.py", line 134, in run
    ret = self.call()
  File "/opt/local/lib/python2.7/site-packages/salt/cli/caller.py", line 212, in call
    ret['return'] = func(*args, **kwargs)
  File "/var/cache/salt/minion/extmods/modules/pdbedit.py", line 100, in list_users
    users[user_data['unix username']] = user_data
KeyError: u'unix username'

Setup

N/a

Steps to Reproduce Issue

Run develop of salt against a pdbedit from samba 4.9.x

I will look into this when I have some a bit of time.

@sjorge sjorge changed the title salt.modules.pdbedit broken on Samba .49.x salt.modules.pdbedit broken on Samba 4.9.x Nov 16, 2018
@Ch3LL

This comment has been minimized.

Copy link
Contributor

commented Nov 16, 2018

thanks for the PR!

@Ch3LL Ch3LL added this to the Approved milestone Nov 16, 2018
@cachedout cachedout closed this in a3684e4 Nov 16, 2018
cachedout pushed a commit that referenced this issue Nov 16, 2018
Mike Place
Fix pdbedit module on samba 4.9 (Fixes #50538)
Ch3LL added a commit to Ch3LL/salt that referenced this issue Jan 17, 2019
garethgreenaway added a commit that referenced this issue Jan 18, 2019
Backport #50538 into 2019.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.