summaryrefslogtreecommitdiffstats
path: root/quickrun.py
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2014-09-25 14:54:08 -0400
committerPatrick Uiterwijk <puiterwijk@redhat.com>2014-10-06 20:09:05 +0200
commit74c34364eab412dc5b4dca1ee955ab051b081ff3 (patch)
tree77e7ffc930c61882c5c02b2e8cc70fec745ea580 /quickrun.py
parentf2e8afd77eac38543622134623d48fc4b7566ec1 (diff)
downloadipsilon-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>
Diffstat (limited to 'quickrun.py')
-rwxr-xr-xquickrun.py37
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)