divio / divio-cli

Command line interface to the Divio Cloud (formerly aldryn-client)
http://control.divio.com
Other
21 stars 19 forks source link

Divio addon upload fails on python 3 system #206

Closed vxsx closed 6 years ago

vxsx commented 6 years ago
Traceback (most recent call last):
File "/usr/local/bin/divio", line 11, in <module>
sys.exit(cli())
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/divio_cli/cli.py", line 546, in addon_upload
ret = upload_addon(ctx.obj.client, ctx.parent.params['path'])
File "/usr/local/lib/python3.6/site-packages/divio_cli/upload/addon.py", line 64, in upload_addon
archive_obj = create_addon_archive(path)
File "/usr/local/lib/python3.6/site-packages/divio_cli/upload/addon.py", line 53, in create_addon_archive
add_addon_meta_files(tar, path)
File "/usr/local/lib/python3.6/site-packages/divio_cli/upload/addon.py", line 36, in add_addon_meta_files
tar_add_bytesio(tar, BytesIO(fobj.read()), 'aldryn_config.py')
TypeError: a bytes-like object is required, not 'str'

https://github.com/divio/divio-cli/blob/master/divio_cli/upload/addon.py#L35

Possibly other things fail as well

vxsx commented 6 years ago

/cc @jmelett

chescales commented 6 years ago

@vxsx could you please give some example of how to reproduce the bug in my machine? That'd be super helpful. Thanks

vxsx commented 6 years ago

@chescales

  1. setup latest beta of divio app
  2. create an addon
  3. in the divio shell work on an addon
  4. after the dummy addon is done - divio addon validate && divio addon upload
chescales commented 6 years ago

@vxsx as mentioned in the chat, it seemed to work for me with an empty new addon, is there any more feedback or a specific link to an addon? It may be related to the addon itself, or to a specific case for a more complete addon.

$ divio addon validate
Addon is valid!
$ divio addon upload
Warning: Divio Cloud config file 'aldryn_config.py' not found. Your app will not have any configurable settings.
warning: no files found matching '*' under directory '*/boilerplates'
warning: no files found matching '*' under directory '*/templates'
warning: no files found matching '*' under directory '*/static'
warning: no files found matching '*' under directory '*/locale'
warning: check: missing required meta-data: url

ok
Configuration file is valid

New version 0.0.1 of chesco-test-addon uploaded to alpha channel

Configure your addon here https://control.divio.com/account/my-addons/996/
$ python --version
Python 3.6.3