diff options
author | Steve McIntyre <steve.mcintyre@linaro.org> | 2015-10-23 17:59:04 +0100 |
---|---|---|
committer | Steve McIntyre <steve.mcintyre@linaro.org> | 2015-10-23 17:59:04 +0100 |
commit | af24aaa9f2bfa52ae0a93e22125c90f78febc7d3 (patch) | |
tree | 10181ef1948aa647b01ae7f24d1d6ce44b004add | |
parent | ea343aa44b865d27c4524cd22768d57af6a07f59 (diff) |
Fix up the db.get_last_modified_time() output
Explicitly return just the data, not a list.
Change-Id: Ia4344faba039c771b5aad2c6e3aed516d2ef96ec
-rwxr-xr-x | admin.py | 2 | ||||
-rw-r--r-- | db/db.py | 2 |
2 files changed, 2 insertions, 2 deletions
@@ -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}) @@ -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): |