diff options
author | Mattia Rizzolo <mattia@mapreri.org> | 2015-06-12 19:17:56 +0200 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2015-06-12 20:02:13 +0200 |
commit | fe9b6335b4876cb8f02a306199ed13e787e2b1f4 (patch) | |
tree | 4ecb1b2d9f46bf24e0ccb781b1e4f45831ce6a50 /bin/reproducible_db_maintenance.py | |
parent | b7198e0e12e5a3a89932f74752640c817cbdf923 (diff) | |
download | jenkins.debian.net-fe9b6335b4876cb8f02a306199ed13e787e2b1f4.tar.xz |
reproducible: *.py: from datetime import datetime, timedelta instead of all datetime
Diffstat (limited to 'bin/reproducible_db_maintenance.py')
-rwxr-xr-x | bin/reproducible_db_maintenance.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/bin/reproducible_db_maintenance.py b/bin/reproducible_db_maintenance.py index b2947384..8b802200 100755 --- a/bin/reproducible_db_maintenance.py +++ b/bin/reproducible_db_maintenance.py @@ -13,7 +13,7 @@ from reproducible_common import * -now = datetime.datetime.now().strftime("%Y-%m-%d-%H-%M-%S") +now = datetime.now().strftime("%Y-%m-%d-%H-%M-%S") # the original schema is here @@ -420,12 +420,12 @@ def db_update(): log.info('Found schema updates.') for update in range(current+1, last+1): log.info('Applying database update #' + str(update) + '. Queries:') - startTime = datetime.datetime.now() + startTime = datetime.now() for query in schema_updates[update]: log.info('\t' + query) query_db(query) log.info(str(len(schema_updates[update])) + ' queries executed in ' + - str(datetime.datetime.now() - startTime)) + str(datetime.now() - startTime)) return True @@ -440,7 +440,7 @@ if __name__ == '__main__': changed_created = db_create_tables() changed = db_update() if changed or changed_created: - log.info('Total execution time: ' + str(datetime.datetime.now() - - datetime.datetime.strptime(now, "%Y-%m-%d-%H-%M-%S"))) + log.info('Total execution time: ' + str(datetime.now() - + datetime.strptime(now, "%Y-%m-%d-%H-%M-%S"))) else: log.info('No pending updates.') |