style: apply flake8 and black formatting
To check for errors: $ pre-commit run --all-files To install as pre-commit hook: $ pre-commit install
This commit is contained in:
parent
8c7d0ed947
commit
751182b70d
8 changed files with 171 additions and 89 deletions
|
|
@ -6,11 +6,11 @@ def export_to_influxdb(action, measurements):
|
|||
from influxdb import InfluxDBClient
|
||||
|
||||
influx_client = InfluxDBClient(
|
||||
host=os.getenv('INFLUXDB_HOST', 'localhost'),
|
||||
port=os.getenv('INFLUXDB_PORT', 8086),
|
||||
username=os.getenv('INFLUXDB_USERNAME', 'root'),
|
||||
password=os.getenv('INFLUXDB_PASSWORD', 'root'),
|
||||
database=os.getenv('INFLUXDB_DATABASE')
|
||||
host=os.getenv("INFLUXDB_HOST", "localhost"),
|
||||
port=os.getenv("INFLUXDB_PORT", 8086),
|
||||
username=os.getenv("INFLUXDB_USERNAME", "root"),
|
||||
password=os.getenv("INFLUXDB_PASSWORD", "root"),
|
||||
database=os.getenv("INFLUXDB_DATABASE"),
|
||||
)
|
||||
json_body = [
|
||||
{
|
||||
|
|
@ -22,4 +22,4 @@ def export_to_influxdb(action, measurements):
|
|||
try:
|
||||
influx_client.write_points(json_body)
|
||||
except Exception as e:
|
||||
print('Failed to write to influxdb: ', e)
|
||||
print("Failed to write to influxdb: ", e)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue