Changeset - 3d53c627707a
[Not reviewed]
feature-cli
0 1 0
Dennis Fink - 9 years ago 2015-10-25 22:25:25
dennis.fink@c3l.lu
Disable logging when using the cli tool
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
ennstatus/cli/commands/stats.py
Show inline comments
 
@@ -32,13 +32,13 @@ def count(obj, by_type):
 
            return len(hosts)
 

	
 

	
 
    app = create_app()
 

	
 
    with app.app_context():
 
        app.logger.removeHandler(app.logger.handlers[1])
 
        app.logger.disabled = True
 
        servers = split_all_servers_to_types()
 

	
 
    if not by_type:
 

	
 
        click.echo(
 
            'We have %s servers in total!' % (
 
@@ -63,13 +63,13 @@ def count(obj, by_type):
 
@click.option('--by-type', 'by_type', is_flag=True, default=False)
 
@click.pass_obj
 
def countries(obj, by_type):
 
    app = create_app()
 

	
 
    with app.app_context():
 
        app.logger.removeHandler(app.logger.handlers[1])
 
        app.logger.disabled = True
 
        servers = split_all_servers_to_types()
 

	
 
    if not by_type:
 
        countries = defaultdict(int)
 

	
 
        for key, value in servers.items():
0 comments (0 inline, 0 general)