datawire / kubernaut

Instant ephemeral Kubernetes clusters for development and testing
Apache License 2.0
117 stars 8 forks source link

`kubernaut set-token` fails with a traceback #27

Closed exarkun closed 6 years ago

exarkun commented 6 years ago

I pip install kubernaut'ed (on Python 2.7; Ubuntu). When I got to the set-token step:

Traceback (most recent call last):
  File "/home/exarkun/Environments/everything/bin/kubernaut", line 11, in <module>
    sys.exit(cli())
  File "/home/exarkun/Environments/everything/local/lib/python2.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/exarkun/Environments/everything/local/lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/exarkun/Environments/everything/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/exarkun/Environments/everything/local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/exarkun/Environments/everything/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/exarkun/Environments/everything/local/lib/python2.7/site-packages/kubernaut/cli.py", line 137, in wrapper
    return func(*args, **kwargs)
  File "/home/exarkun/Environments/everything/local/lib/python2.7/site-packages/kubernaut/cli.py", line 221, in cli_set_token
    save_config(config)
  File "/home/exarkun/Environments/everything/local/lib/python2.7/site-packages/kubernaut/cli.py", line 99, in save_config
    json.dump(config_data, cf, indent=2)
  File "/usr/lib/python2.7/json/__init__.py", line 190, in dump
    fp.write(chunk)
TypeError: write() argument 1 must be unicode, not str
alexgervais commented 6 years ago

I get the same error. Installed with Python 3.6.4, pip 9.0.1

plombardi89 commented 6 years ago

@alexgervais kubernaut --version? This should be fixed in 0.1.40...

alexgervais commented 6 years ago

It is failing on a fresh install of kubernaut v0.1.40

plombardi89 commented 6 years ago

I was unable to reproduce this last night, but I was able to reproduce it this morning with python 3.6.3... digging into it now.

plombardi89 commented 6 years ago

@alexgervais I need to fix GH-31 now to get this one out officially but you can install from source with pip install -e . or pointing at the git repo.

alexgervais commented 6 years ago

@plombardi89 success! Thanks!