Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Commit

Permalink
Possible solution to modify ec2stack-configure to be run non-interact…
Browse files Browse the repository at this point in the history
…ively #62
  • Loading branch information
imduffy15 committed Dec 5, 2014
1 parent 4d30d0e commit 2662cae
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 35 deletions.
13 changes: 0 additions & 13 deletions .deploy-coverage.sh

This file was deleted.

4 changes: 0 additions & 4 deletions .travis.yml
Expand Up @@ -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=
11 changes: 10 additions & 1 deletion ec2stack/__init__.py
Expand Up @@ -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

Expand Down Expand Up @@ -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
14 changes: 0 additions & 14 deletions ec2stack/configure.py
Expand Up @@ -19,7 +19,6 @@ def main():
"""
config_folder = _create_config_folder()
_create_config_file(config_folder)
_create_database()


def _create_config_folder():
Expand Down Expand Up @@ -281,16 +280,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)
6 changes: 3 additions & 3 deletions migrations/alembic.ini
Expand Up @@ -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]
Expand Down

0 comments on commit 2662cae

Please sign in to comment.