diff options
author | Timotheus Pokorra <tp@tbits.net> | 2015-04-13 09:30:37 (GMT) |
---|---|---|
committer | Timotheus Pokorra <tp@tbits.net> | 2015-04-13 09:30:37 (GMT) |
commit | e008709c6abf514b4e4e4e0775a179edcf911589 (patch) | |
tree | 16ee6c9a2a7181ff42ca86c7cbcad6841fbce599 | |
parent | 331cb5edc84e784b164f7e7fb67a835c606c13fa (diff) | |
download | pykolab-master.tar.gz |
implementing --mysqlserver parameter for setup-kolab to specify if a new or existing MySQL server should be used (#4971)HEADmaster
this is useful for silent/unattended installs
-rw-r--r-- | pykolab/setup/setup_mysql.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/pykolab/setup/setup_mysql.py b/pykolab/setup/setup_mysql.py index 174cbc7..460a4d5 100644 --- a/pykolab/setup/setup_mysql.py +++ b/pykolab/setup/setup_mysql.py @@ -35,6 +35,16 @@ conf = pykolab.getConf() def __init__(): components.register('mysql', execute, description=description()) +def cli_options(): + ldap_group = conf.add_cli_parser_option_group(_("MySQL Options")) + + ldap_group.add_option( + "--mysqlserver", + dest = "mysqlserver", + action = "store", + help = _("Specify whether to use an (existing) or (new) MySQL server.") + ) + def description(): return _("Setup MySQL.") @@ -73,7 +83,13 @@ def execute(*args, **kw): os.path.exists('/var/run/mysqld/mysqld.sock') or \ os.path.exists('/var/run/mysql/mysql.sock') or \ os.path.exists('/var/run/mysqld/mysqld.pid'): - answer = utils.ask_menu(_("What MySQL server are we setting up?"), options) + if conf.mysqlserver: + if conf.mysqlserver == 'existing': + answer = 1 + elif conf.mysqlserver == 'new': + answer = 2 + if answer == 0: + answer = utils.ask_menu(_("What MySQL server are we setting up?"), options) if answer == "1" or answer == 1: print >> sys.stderr, utils.multiline_message( |