Merge pull request #1402 from EmilienMottet/develop

fix tablename cassandra export and variabilize the cassandra table-name
This commit is contained in:
Nicolas Hennion 2019-01-23 21:30:21 +01:00 committed by GitHub
commit 871a0d1405
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -115,11 +115,11 @@ class Export(GlancesExport):
# Write input to the Cassandra table
try:
stmt = "INSERT INTO {} (plugin, time, stat) VALUES (?, ?, ?)".format(self.table)
query = self.session.prepare(stmt)
self.session.execute(
"""
INSERT INTO localhost (plugin, time, stat)
VALUES (%s, %s, %s)
""",
query,
(name, uuid_from_time(datetime.now()), data)
)
except Exception as e: