From b9d252a1fc3afc5db31a4459a3c296b80a0999db Mon Sep 17 00:00:00 2001 From: Ronny Abraham Date: Wed, 24 Oct 2018 02:42:27 +0300 Subject: [PATCH] modified import statements in deploy to resolve conflict that led to docker and database modules being considered a submodule of deploy --- modules/deploy.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/modules/deploy.py b/modules/deploy.py index 18bcfb5..f7f9df1 100644 --- a/modules/deploy.py +++ b/modules/deploy.py @@ -24,13 +24,16 @@ from .django import generate as django_generate from .django import collectstatic as django_collectstatic from . import initialize -from . import docker -from . import database as db - import os import logging +# NOTE: +# we have a bunch of imports scattered through the func definitions +# this is done b/c otherwise fabric will consider the modules we are +# importing from to be a SUB-MODULE of deploy. So leave them where +# they are + @task def setup_rootpath(): @@ -76,6 +79,7 @@ def setup_rootpath(): @task def bootstrap(): + from . import docker configuration = env.config if env.debug: @@ -191,6 +195,7 @@ def bootstrap(): # # create and initialize the database + from . import database as db print_console("in db.generate") db.generate() @@ -224,6 +229,7 @@ def bootstrap_part1(): @task def bootstrap_part2(): + from . import docker configuration = env.config if env.debug: @@ -326,6 +332,8 @@ def bootstrap_part2(): # # create and initialize the database + from . import database as db + print_console("in db.generate") db.generate() @@ -682,6 +690,7 @@ def remove(full=True): nginx_remove() supervisor_remove() + from . import database as db db.drop_all() #