Skip to content

Commit

Permalink
Merge pull request #187 from divio/fix/various
Browse files Browse the repository at this point in the history
Fix yaml package name and optional cryptography package
  • Loading branch information
stefanfoulis authored Apr 7, 2017
2 parents 5365b8e + 7aa4a60 commit 1027dc9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
12 changes: 11 additions & 1 deletion divio_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
from . import exceptions
from . import localdev
from . import messages
from . import crypto
try:
from . import crypto
except ImportError:
crypto = None
from .localdev.utils import get_aldryn_project_settings
from .cloud import CloudClient, get_endpoint
from .check_system import check_requirements, check_requirements_human
Expand Down Expand Up @@ -484,6 +487,13 @@ def backup():
@click.argument('destination', type=click.File('wb'))
def backup_decrypt(key, backup, destination):
"""Decrypt a backup downloaded from Divio Cloud"""
if not crypto:
click.secho(
'\nPlease install the crypo extensions to use the crypto commands: '
'pip install divio-cli[crypto]',
fg='red'
)
return
key = base64.b64decode(key.read(1024).strip())
decryptor = crypto.StreamDecryptor(key=key)

Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ click
requests
tabulate
six
cryptography
attrs
yaml
pyaml
5 changes: 5 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
license='BSD',
platforms=['OS Independent'],
install_requires=requirements,
extras_require={
'crypto': [
'cryptography',
],
},
entry_points="""
[console_scripts]
divio = divio_cli.cli:cli
Expand Down

0 comments on commit 1027dc9

Please sign in to comment.