Skip to content

Commit af9f41b

Browse files
committed
Merge branch 'master' into topic/windows-build
2 parents fae8c2f + fc8b993 commit af9f41b

5 files changed

Lines changed: 25 additions & 8 deletions

File tree

CHANGELOG.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
Changelog
22
=========
33

4+
3.3.9 (2019-01-07)
5+
------------------
6+
7+
* Improved DNS lookup check
8+
9+
10+
3.3.8 (2018-08-14)
11+
------------------
12+
13+
* Ensure 'stage' argument sanity
14+
* Use a wrapper function to determine the available environments
15+
416

517
3.3.7 (2018-02-28)
618
------------------

divio_cli/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "3.3.8"
1+
__version__ = "3.3.9"

divio_cli/check_system.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ class DockerEngineDNSCheck(DockerEngineBaseCheck):
177177
"busybox",
178178
"sh",
179179
"-c", # run in new a shell to avoid problems with timeout
180-
"timeout -t 5 nslookup control.divio.com",
180+
"timeout -t 5 nslookup -type=a control.divio.com.",
181181
)
182182

183183
def fmt_exception(self, exc):

divio_cli/cli.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
open_project_cloud_site,
2222
print_package_renamed_warning,
2323
table,
24+
get_available_environments,
2425
)
2526
from .validators.addon import validate_addon
2627
from .validators.boilerplate import validate_boilerplate
@@ -208,7 +209,7 @@ def sort_projects(items):
208209
@click.option(
209210
"--backup/--no-backup", default=None, help="Take a backup on deployment."
210211
)
211-
@click.argument("stage", default="test")
212+
@click.argument("stage", default="test", type=click.Choice(get_available_environments()))
212213
@allow_remote_id_override
213214
@click.pass_obj
214215
def project_deploy(obj, remote_id, stage, backup):
@@ -217,7 +218,7 @@ def project_deploy(obj, remote_id, stage, backup):
217218

218219

219220
@project.command(name="deploy-log")
220-
@click.argument("stage", default="test")
221+
@click.argument("stage", default="test", type=click.Choice(get_available_environments()))
221222
@allow_remote_id_override
222223
@click.pass_obj
223224
def project_deploy_log(obj, remote_id, stage):
@@ -418,7 +419,7 @@ def project_pull():
418419

419420

420421
@project_pull.command(name="db")
421-
@click.argument("stage", default="test")
422+
@click.argument("stage", default="test", type=click.Choice(get_available_environments()))
422423
@allow_remote_id_override
423424
@click.pass_obj
424425
def pull_db(obj, remote_id, stage):
@@ -432,7 +433,7 @@ def pull_db(obj, remote_id, stage):
432433

433434

434435
@project_pull.command(name="media")
435-
@click.argument("stage", default="test")
436+
@click.argument("stage", default="test", type=click.Choice(get_available_environments()))
436437
@allow_remote_id_override
437438
@click.pass_obj
438439
def pull_media(obj, remote_id, stage):
@@ -449,7 +450,7 @@ def project_push():
449450

450451

451452
@project_push.command(name="db")
452-
@click.argument("stage", default="test")
453+
@click.argument("stage", default="test", type=click.Choice(get_available_environments()))
453454
@click.option(
454455
"-d",
455456
"--dumpfile",
@@ -487,7 +488,7 @@ def push_db(obj, remote_id, stage, dumpfile, noinput):
487488

488489

489490
@project_push.command(name="media")
490-
@click.argument("stage", default="test")
491+
@click.argument("stage", default="test", type=click.Choice(get_available_environments()))
491492
@click.option(
492493
"--noinput", is_flag=True, default=False, help="Don't ask for confirmation"
493494
)

divio_cli/utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,10 @@ def json_dumps_unicode(d, **kwargs):
319319
return json.dumps(d, ensure_ascii=False, **kwargs).encode("utf-8")
320320

321321

322+
def get_available_environments():
323+
return ['test', 'live']
324+
325+
322326
class Map(dict):
323327
"""
324328
A dictionary which also allows accessing values by dot notation.

0 commit comments

Comments
 (0)