Changeset - 1bca030715c4
[Not reviewed]
feature-cli
0 1 0
Dennis Fink - 9 years ago 2015-10-24 01:05:26
dennis.fink@c3l.lu
Fix delete command
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
ennstatus/cli/commands/config.py
Show inline comments
 
@@ -80,25 +80,25 @@ def delete(obj, name):
 

	
 
    with obj['config_file'].open() as f:
 
        config = json.load(f)
 
    name = name.lower()
 

	
 
    try:
 
        del config['ENNSTATUS_SERVERS'][name]
 
    except KeyError:
 
        raise SystemExit('{} does not exists!'.format(name))
 

	
 
    try:
 
        config['ENNSTATUS_BRIDGE_PROGRAM'].remove(name)
 
    except KeyError:
 
    except (KeyError, ValueError):
 
        pass
 

	
 
    with obj['config_file'].open(mode='w', encoding='utf-8') as f:
 
        json.dump(config, f, indent=4, sort_keys=True)
 

	
 
    filename = obj['data_dir'] / (name + '.json')
 
    try:
 
        filename.unlink()
 
    except FileNotFoundError:
 
        pass
 

	
 

	
0 comments (0 inline, 0 general)