Changeset - 70b2a828bf1e
[Not reviewed]
stable
0 1 0
Thomas De Schampheleire - 8 years ago 2018-01-21 14:23:55
thomas.de_schampheleire@nokia.com
setup-db: print completion message to avoid confusion (issue #303)

There are cases where the last message of setup-db is a warning, giving the
impression that the overall command failed which may not actually be the
case.

For example, when git is not installed, warnings are given, but they are not
an actual error. Kallithea will work fine for Mercurial repositories.

To avoid any confusion, print a completion message at the end.
Any real errors will abort the command and not make it this far.
1 file changed with 2 insertions and 0 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/paster_commands/setup_db.py
Show inline comments
 
@@ -87,24 +87,26 @@ class Command(AbstractInstallCommand):
 
            section = 'app:' + section
 
        else:
 
            plain_section = section.split(':', 1)[0]
 
        if not config_spec.startswith('config:'):
 
            config_spec = 'config:' + config_spec
 
        if plain_section != 'main':
 
            config_spec += '#' + plain_section
 
        config_file = config_spec[len('config:'):].split('#', 1)[0]
 
        config_file = os.path.join(os.getcwd(), config_file)
 
        self.logging_file_config(config_file)
 
        conf = appconfig(config_spec, relative_to=os.getcwd())
 
        ep_name = conf.context.entry_point_name
 
        ep_group = conf.context.protocol
 
        dist = conf.context.distribution
 
        if dist is None:
 
            raise BadCommand(
 
                "The section %r is not the application (probably a filter).  "
 
                "You should add #section_name, where section_name is the "
 
                "section that configures your application" % plain_section)
 
        installer = self.get_installer(dist, ep_group, ep_name)
 
        installer.setup_config(
 
            self, config_file, section, self.sysconfig_install_vars(installer))
 
        self.call_sysconfig_functions(
 
            'post_setup_hook', installer, config_file)
 

	
 
        print 'Database set up successfully.'
0 comments (0 inline, 0 general)