mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
don't swallow exceptions
This commit is contained in:
parent
a7e9c1e381
commit
6a5211c8d8
1 changed files with 3 additions and 11 deletions
|
@ -152,11 +152,7 @@ def db_create(name, user=None, password=None, host=None, port=None):
|
|||
log.info('DB {0!r} already exists'.format(name))
|
||||
return False
|
||||
client = _client(user=user, password=password, host=host, port=port)
|
||||
try:
|
||||
client.create_database(name)
|
||||
except:
|
||||
log.exception('InfluxDB client raised an exception')
|
||||
return False
|
||||
client.create_database(name)
|
||||
return True
|
||||
|
||||
|
||||
|
@ -332,12 +328,8 @@ def user_create(name, passwd, database=None, user=None, password=None,
|
|||
|
||||
# influxdb 0.9+
|
||||
if hasattr(client, 'create_user'):
|
||||
try:
|
||||
client.create_user(name, passwd)
|
||||
return True
|
||||
except:
|
||||
log.exception('InfluxDB client raised an exception')
|
||||
return False
|
||||
client.create_user(name, passwd)
|
||||
return True
|
||||
|
||||
# influxdb 0.8 and older
|
||||
if database:
|
||||
|
|
Loading…
Add table
Reference in a new issue