aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve McIntyre <steve.mcintyre@linaro.org>2015-10-23 17:59:04 +0100
committerSteve McIntyre <steve.mcintyre@linaro.org>2015-10-23 17:59:04 +0100
commitaf24aaa9f2bfa52ae0a93e22125c90f78febc7d3 (patch)
tree10181ef1948aa647b01ae7f24d1d6ce44b004add
parentea343aa44b865d27c4524cd22768d57af6a07f59 (diff)
Fix up the db.get_last_modified_time() output
Explicitly return just the data, not a list. Change-Id: Ia4344faba039c771b5aad2c6e3aed516d2ef96ec
-rwxr-xr-xadmin.py2
-rw-r--r--db/db.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/admin.py b/admin.py
index 1d9063b..1b345ee 100755
--- a/admin.py
+++ b/admin.py
@@ -749,7 +749,7 @@ elif opts.status:
print 'The default vlan tag (%d) is vlan_id %d' % (config.vland.default_vlan_tag, default_vlan_id)
stat = call_vland('daemon_query', {'command':'daemon.status', 'data': None})
print 'VLANd is running %s' % stat['running']
- lastmod = datetime.datetime.strptime(stat['last_modified'][0], '%Y-%m-%dT%H:%M:%S.%f')
+ lastmod = datetime.datetime.strptime(stat['last_modified'], '%Y-%m-%dT%H:%M:%S.%f')
print 'DB Last modified %s' % lastmod.strftime('%Y-%m-%d %H:%M:%S %Z')
print 'DB via VLANd:'
switches = call_vland('db_query', {'command':'db.all_switches', 'data':None})
diff --git a/db/db.py b/db/db.py
index 180a934..21ead71 100644
--- a/db/db.py
+++ b/db/db.py
@@ -552,7 +552,7 @@ class VlanDB:
def get_last_modified_time(self):
sql = "SELECT last_modified FROM state"
self.cursor.execute(sql)
- return self.cursor.fetchone()
+ return self.cursor.fetchone()[0]
# Grab one row of a query on one column; useful as a quick wrapper
def _get_row(self, table, field, value):