root/IoTa-Installer/lib/db.py @ bf9c3717
2e0a7cb1 | Sylvain L. Sauvage | # -*- coding: utf-8 -*-
|
|
#
|
|||
# This program is a part of the IoTa project.
|
|||
#
|
|||
# Copyright © 2012 Université de Caen Basse-Normandie, GREYC
|
|||
19b58bab | Rémy Ménard | #
|
|
2e0a7cb1 | Sylvain L. Sauvage | # This program is free software: you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|||
# the Free Software Foundation, either version 3 of the License, or
|
|||
# (at your option) any later version.
|
|||
#
|
|||
# This program is distributed in the hope that it will be useful,
|
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|||
# GNU General Public License for more details.
|
|||
# <http://www.gnu.org/licenses/>
|
|||
#
|
|||
# See AUTHORS for a list of contributors.
|
|||
#
|
|||
import installer
|
|||
import utils
|
|||
from config import CONFIG
|
|||
class DBConfigurer(installer.Configurer):
|
|||
def __init__(self):
|
|||
installer.Configurer.__init__(self, "Database", "db", [
|
|||
("Enter the MySQL host", "db", "host", {}),
|
|||
("Enter the MySQL port", "db", "port", {}),
|
|||
("Enter the MySQL login", "db", "login", {}),
|
|||
("Enter the MySQL password", "db", "password", {}),
|
|||
96454bcd | Sylvain L. Sauvage | ("Enter the host part for the users we will create (name, IP, or '%')", "db", "user_host", {}),
|
|
2e0a7cb1 | Sylvain L. Sauvage | ("Install the Java MySQL connector?", "db", "jar_install", {"type": "YN"})
|
|
])
|
|||
def postConfigure(self):
|
|||
96454bcd | Sylvain L. Sauvage | if self.cisTrue("jar_install"):
|
|
2e0a7cb1 | Sylvain L. Sauvage | lib = CONFIG.get("tomcat", "catalina_home") + "lib/"
|
|
96454bcd | Sylvain L. Sauvage | utils.sh_cp(self.cget("repo"), lib)
|
|
2e0a7cb1 | Sylvain L. Sauvage | utils.stopTomcat()
|
|
utils.startTomcat()
|