Skip to content
Permalink
Browse files
Merge pull request #64 from imduffy15/enhancement-#62
Ticket is focused around bringing up ec2stack without having to use the interactive command prompt supplied by ec2stack-configure.

The proposed fix removes the requirement to use ec2stack-configure, if a config file exists it will use it. If no database exists it will just create it.

The docker piece separate.... we can open future tickets should a user have issues with it.

Going to merge and close.
  • Loading branch information
imduffy15 committed Dec 5, 2014
2 parents 4d30d0e + c4d1a67 commit c41f7d5837a46e26d27441be98f240b859235ec2
Showing 5 changed files with 13 additions and 37 deletions.

This file was deleted.

@@ -14,8 +14,4 @@ script:
- pylint --rcfile=pylint.rc *.py ec2stack
- nosetests --with-coverage --cover-erase --cover-package=ec2stack --cover-html
after_success:
- '[ "${TRAVIS_BRANCH}" = "master" ] && bash .deploy-coverage.sh'
- coveralls
env:
global:
secure: dUNHx6q6ziCb7pXr/fb/OZS8fyB14RF8/rEEggBEzgn2L7KM78LVFyFNmW+QZ7lvJpZ806mfjdmvmz0DpR1k6kfokrr6txBzHDMEUebc9RnVnmsoNNWIRLiV/+YzUsVeFixogVz/z06yaycOC8knVExcNfGMfmiBg5PextydXSQ=
@@ -8,6 +8,9 @@
import sys
import argparse

from alembic import command
from alembic.config import Config as AlembicConfig

from flask import Flask
from ConfigParser import SafeConfigParser

@@ -140,6 +143,12 @@ def _load_database():
)

if not os.path.exists(database_file):
sys.exit('No database found, please run ec2stack-configure')
directory = os.path.join(os.path.dirname(__file__), '../migrations')
config = AlembicConfig(os.path.join(
directory,
'alembic.ini'
))
config.set_main_option('script_location', directory)
command.upgrade(config, 'head', sql=False, tag=None)

return 'sqlite:///' + database_file
@@ -7,9 +7,7 @@
import os
import argparse

from alembic import command
from ConfigParser import SafeConfigParser
from alembic.config import Config as AlembicConfig


def main():
@@ -19,7 +17,6 @@ def main():
"""
config_folder = _create_config_folder()
_create_config_file(config_folder)
_create_database()


def _create_config_folder():
@@ -281,16 +278,3 @@ def _read_in_config_attribute_or_use_default(message, default):
attribute = default

return attribute


def _create_database():
"""
Creates/Updates the database.
"""
directory = os.path.join(os.path.dirname(__file__), '../migrations')
config = AlembicConfig(os.path.join(
directory,
'alembic.ini'
))
config.set_main_option('script_location', directory)
command.upgrade(config, 'head', sql=False, tag=None)
@@ -26,12 +26,12 @@ qualname =

[logger_sqlalchemy]
level = WARN
handlers =
handlers = console
qualname = sqlalchemy.engine

[logger_alembic]
level = INFO
handlers =
level = WARN
handlers = console
qualname = alembic

[handler_console]

0 comments on commit c41f7d5

Please sign in to comment.