diff options
author | Simo Sorce <simo@redhat.com> | 2014-09-25 14:54:08 -0400 |
---|---|---|
committer | Patrick Uiterwijk <puiterwijk@redhat.com> | 2014-10-06 20:09:05 +0200 |
commit | 74c34364eab412dc5b4dca1ee955ab051b081ff3 (patch) | |
tree | 77e7ffc930c61882c5c02b2e8cc70fec745ea580 | |
parent | f2e8afd77eac38543622134623d48fc4b7566ec1 (diff) | |
download | ipsilon-74c34364eab412dc5b4dca1ee955ab051b081ff3.tar.gz ipsilon-74c34364eab412dc5b4dca1ee955ab051b081ff3.tar.xz ipsilon-74c34364eab412dc5b4dca1ee955ab051b081ff3.zip |
Use installation template in quickrun
Instead of using a duplicate use installation template so there is
less risk of forgetting something in either.
Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
-rwxr-xr-x | quickrun.py | 37 |
1 files changed, 10 insertions, 27 deletions
diff --git a/quickrun.py b/quickrun.py index b8af4b2..8eb64a6 100755 --- a/quickrun.py +++ b/quickrun.py @@ -34,24 +34,7 @@ def parse_args(): return vars(parser.parse_args()) -CONF_TEMPLATE=''' -[global] -debug = True - -log.screen = True -base.mount = "/idp" -base.dir = "${BASEDIR}" -admin.config.db = "${ADMINDB}" -user.prefs.db = "${USERSDB}" -transactions.db = "${TRANSDB}" - -tools.sessions.on = True -tools.sessions.storage_type = "file" -tools.sessions.storage_path = "${WORKDIR}/sessions" -tools.sessions.timeout = 60 -tools.sessions.secure = False -tools.sessions.httponly = False -''' +CONF_TEMPLATE="templates/install/ipsilon.conf" ADMIN_TEMPLATE=''' CREATE TABLE login_config (name TEXT,option TEXT,value TEXT); @@ -73,20 +56,20 @@ def config(workdir): f.write(ADMIN_TEMPLATE) subprocess.call(['sqlite3', '-init', sql, admin_db, '.quit']) - users_db = os.path.join(workdir, 'users.sqlite') + users_db = os.path.join(workdir, 'userprefs.sqlite') sql = os.path.join(workdir, 'users.sql') with open(sql, 'w+') as f: f.write(USERS_TEMPLATE) subprocess.call(['sqlite3', '-init', sql, users_db, '.quit']) - trans_db = os.path.join(workdir, 'transactions.sqlite') - - t = Template(CONF_TEMPLATE) - text = t.substitute({'BASEDIR': os.getcwd(), - 'WORKDIR': workdir, - 'ADMINDB': admin_db, - 'USERSDB': users_db, - 'TRANSDB': trans_db}) + with open(CONF_TEMPLATE) as f: + conf_template = f.read() + t = Template(conf_template) + text = t.substitute({'debugging': 'True', + 'instance': 'idp', + 'staticdir': os.getcwd(), + 'datadir': workdir, + 'secure': 'False'}) conf = os.path.join(workdir, 'ipsilon.conf') with open(conf, 'w+') as f: f.write(text) |