dropbox / pynsot

A Python client and CLI utility for the Network Source of Truth (NSoT) REST API.
https://pynsot.readthedocs.io
Other
46 stars 25 forks source link

KeyError 'auth_method' on first use #42

Closed coxley closed 9 years ago

coxley commented 9 years ago
$ pip freeze | grep nsot                            
nsot==0.7.2
pynsot==0.14

$ nsot sites add --name Production --description "Production Site"
/home/codey/.pynsotrc not found; would you like to create it? [Y/n]:
Please enter URL: http://localhost
Please enter SECRET_KEY: secret=
Please enter EMAIL: codey@example.com
Traceback (most recent call last):
  File "/home/codey/docs/envs/ipam/bin/nsot", line 11, in <module>
    sys.exit(app())
  File "/home/codey/docs/envs/ipam/lib/python2.7/site-packages/click/core.py", line 664, in __call__
    return self.main(*args, **kwargs)
  File "/home/codey/docs/envs/ipam/lib/python2.7/site-packages/click/core.py", line 644, in main
    rv = self.invoke(ctx)
  File "/home/codey/docs/envs/ipam/lib/python2.7/site-packages/click/core.py", line 991, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/codey/docs/envs/ipam/lib/python2.7/site-packages/click/core.py", line 991, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/codey/docs/envs/ipam/lib/python2.7/site-packages/click/core.py", line 837, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/codey/docs/envs/ipam/lib/python2.7/site-packages/click/core.py", line 464, in invoke
    return callback(*args, **kwargs)
  File "/home/codey/docs/envs/ipam/lib/python2.7/site-packages/pynsot/commands/cmd_sites.py", line 80, in add
    ctx.obj.add(data)
  File "/home/codey/docs/envs/ipam/lib/python2.7/site-packages/pynsot/app.py", line 372, in add
    result = self.resource.post(data)
  File "/home/codey/docs/envs/ipam/lib/python2.7/site-packages/pynsot/app.py", line 116, in resource
    return self.api.get_resource(self.resource_name)
  File "/home/codey/docs/envs/ipam/lib/python2.7/site-packages/pynsot/app.py", line 97, in api
    self._api = client.get_api_client(**self.client_args)
  File "/home/codey/docs/envs/ipam/lib/python2.7/site-packages/pynsot/client.py", line 267, in get_api_client
    auth_method = client_args.pop('auth_method')
KeyError: 'auth_method'
jathanism commented 9 years ago

Regression! Good thing we've got more unit tests going in by he pound! There's even a unit test for this that I disabled to get a production fix in.

https://github.com/dropbox/pynsot/blob/master/tests/test_dotfile.py#L49