Wrap create bucket in try/catch
This commit is contained in:
		
							parent
							
								
									90ae8fac32
								
							
						
					
					
						commit
						622f9a65c1
					
				
					 1 changed files with 12 additions and 9 deletions
				
			
		|  | @ -22,6 +22,7 @@ class InfluxDB2Manager(object): | |||
| 
 | ||||
|         bucket_api = self.influx.buckets_api() | ||||
| 
 | ||||
|         try: | ||||
|             bucket = bucket_api.find_bucket_by_name(self.server.bucket) | ||||
| 
 | ||||
|             if bucket is None: | ||||
|  | @ -34,6 +35,8 @@ class InfluxDB2Manager(object): | |||
|                         my_org = org | ||||
| 
 | ||||
|                 self.influx.buckets_api().create_bucket(bucket_name=self.server.bucket, org_id=my_org.id) | ||||
|         except Exception as e: | ||||
|             self.logger.error('Failed creating new InfluxDB bucket! Error: %s', e) | ||||
| 
 | ||||
|     def write_points(self, data): | ||||
|         d = data | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue