ttrss: Ensure database used is PostgreSQL

- Installing dbcommon-pgsql and not install dbcommon-mysql does not
  ensure that PostgreSQL is selected as the database for the
  application.  Set a debconf value to force selection of PostgreSQL.

- Minor styling fixes.
This commit is contained in:
Sunil Mohan Adapa 2016-03-12 17:17:50 +05:30
parent 368e64c5ca
commit 4c6d572e67
No known key found for this signature in database
GPG Key ID: 36C361440C9BC971
3 changed files with 12 additions and 2 deletions

View File

@ -23,6 +23,7 @@ Configuration helper for Tiny Tiny RSS.
import argparse
import augeas
import subprocess
from plinth import action_utils
@ -35,6 +36,7 @@ def parse_arguments():
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers(dest='subcommand', help='Sub command')
subparsers.add_parser('pre-setup', help='Perform pre-setup operations')
subparsers.add_parser('setup', help='Setup Tiny Tiny RSS configuration')
subparsers.add_parser('enable', help='Enable Tiny Tiny RSS site')
subparsers.add_parser('disable', help='Disable Tiny Tiny RSS site')
@ -42,6 +44,13 @@ def parse_arguments():
return parser.parse_args()
def subcommand_pre_setup(_):
"""Preseed debconf values before packages are installed."""
subprocess.check_output(
['debconf-set-selections'],
input=b'tt-rss tt-rss/database-type string pgsql')
def subcommand_setup(_):
"""Setup Tiny Tiny RSS configuration."""
aug = load_augeas()

View File

@ -58,6 +58,7 @@ def init():
def setup(helper, old_version=None):
"""Install and configure the module."""
helper.call('pre', actions.superuser_run, 'ttrss', ['pre-setup'])
helper.install(['tt-rss', 'postgresql', 'dbconfig-pgsql', 'php-pgsql'])
helper.call('post', actions.superuser_run, 'ttrss', ['setup'])
helper.call('post', service.notify_enabled, None, True)
@ -72,7 +73,7 @@ def get_status():
def is_enabled():
"""Return whether the module is enabled."""
return (action_utils.service_is_enabled('tt-rss') and
action_utils.webserver_is_enabled('tt-rss-plinth'))
action_utils.webserver_is_enabled('tt-rss-plinth'))
def is_running():

View File

@ -16,7 +16,7 @@
#
"""
URLs for the ttrss module.
URLs for the Tiny Tiny RSS module.
"""
from django.conf.urls import url