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

Error using napalm netusers #38775

Closed
charburns opened this issue Jan 17, 2017 · 1 comment
Closed

Error using napalm netusers #38775

charburns opened this issue Jan 17, 2017 · 1 comment
Labels
Bug broken, incorrect, or confusing behavior
Milestone

Comments

@charburns
Copy link

Description of Issue/Question

Error using napalm netusers

Setup

root@salt:/srv/pillar# cat juniper01.sls
proxy:
proxytype: napalm
driver: junos
host: 10.64.10.1
username: salt
passwd: blahblah
optional_args:
port: 22
config_format: set

users:
foo:
level: 15
password: ''
sshkeys:
- ssh-rsa AaA foo@bar.com

root@salt:/srv/salt/router/# cat users.sls
{% set default_users = pillar.get('users', {}) -%}
{% set device_users = pillar.get('users.config', {}) -%}

cf_users:
netusers.managed:
- users: {{device_users}}
- defaults: {{default_users}}

Steps to Reproduce Issue

root@salt:/srv/pillar# salt juniper01 net.connected
juniper01:
----------
out:
True
root@salt:/srv/pillar# salt juniper01 state.sls router.users
juniper01:

      ID: cf_users
Function: netusers.managed
  Result: False
 Comment: An exception occurred in this state: Traceback (most recent call last):
            File "/usr/lib/python2.7/dist-packages/salt/state.py", line 1744, in call
              **cdata['kwargs'])
            File "/usr/lib/python2.7/dist-packages/salt/loader.py", line 1702, in wrapper
              return f(*args, **kwargs)
            File "/usr/lib/python2.7/dist-packages/salt/states/netusers.py", line 357, in managed
              diff = _compute_diff(configured_users, expected_users)
            File "/usr/lib/python2.7/dist-packages/salt/states/netusers.py", line 114, in _compute_diff
              add = dict((username, expected.get(username)) for (username, _) in add_usernames)
            File "/usr/lib/python2.7/dist-packages/salt/states/netusers.py", line 114, in <genexpr>
              add = dict((username, expected.get(username)) for (username, _) in add_usernames)
          ValueError: too many values to unpack
 Started: 19:52:51.938999
Duration: 193.051 ms
 Changes:

Summary for juniper01

Succeeded: 0
Failed: 1

Total states run: 1
Total run time: 193.051 ms
ERROR: Minions returned with non-zero exit code

Versions Report

root@salt:~# salt --versions-report
Salt Version:
Salt: 2016.11.1

Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: 2.4.2
gitdb: 0.6.4
gitpython: 1.0.1
ioflo: Not Installed
Jinja2: 2.8
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: 1.0.3
msgpack-pure: Not Installed
msgpack-python: 0.4.6
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pygit2: Not Installed
Python: 2.7.12 (default, Nov 19 2016, 06:48:10)
python-gnupg: Not Installed
PyYAML: 3.11
PyZMQ: 15.2.0
RAET: Not Installed
smmap: 0.9.0
timelib: Not Installed
Tornado: 4.2.1
ZMQ: 4.1.4

System Versions:
dist: Ubuntu 16.04 xenial
machine: x86_64
release: 4.4.0-59-generic
system: Linux

@gtmanfred
Copy link
Contributor

Thanks for the pr to fix this @mirceaulinic

@gtmanfred gtmanfred added the Bug broken, incorrect, or confusing behavior label Jan 17, 2017
@gtmanfred gtmanfred added this to the Approved milestone Jan 17, 2017
gitebra pushed a commit to gitebra/salt that referenced this issue Jan 18, 2017
* upstream/develop: (53 commits)
  Add CLI Examples for functions in the namecheap_ns execution module
  update adml text search to use 'starts-with' as some policies text has trailing spaces
  Fix saltstack#38775
  Adding unless-stopped as an option to restart policy.
  pillar/file_tree.py: Data read from files is now passed through the compile_template_str-function before being put into the pillar. Default renderer pipeline, as well as renderer blacklist and renderer whitelist can be configured from the salt master config.
  Fix Lint
  renderers/gpg.py: Pylint fixes
  renderers/gpg.py: Added check and workaround if data is of type cStringIO.InputType (which it is when handed from template.py)
  Add solrcloud module
  pep8
  No mutable default args, remove unneeded import
  DOCS: correct examples of running test suite
  DOCS: add links to File State Backups page where necessary (saltstack#38735)
  Pylint fix
  Proofread jinja_to_execution_module tutorial (saltstack#38720)
  Remove "event_publisher_pub_hwm" and "salt_event_pub_hwm" from config/__init__.py
  Fix for dynamic git_pillar when pillarenv is used
  Add NameError to exception in avahi_announce beacon
  The `test` option is only valid for the minion, not the master
  Localfs should also be changed of course
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior
Projects
None yet
Development

No branches or pull requests

2 participants