summaryrefslogtreecommitdiffstats
path: root/tools/upgrade
diff options
context:
space:
mode:
authorTim Laszlo <tim.laszlo@gmail.com>2012-10-15 07:47:31 -0500
committerTim Laszlo <tim.laszlo@gmail.com>2012-10-15 07:47:31 -0500
commit3c154d9beeae2a7a411cbaaae8797d1f0c2f063c (patch)
tree5bb991f782cfc8fee3e9dd4c4832d0429e96693c /tools/upgrade
parent7768f250c826dac8153d25b635eba6504e608be3 (diff)
downloadbcfg2-3c154d9beeae2a7a411cbaaae8797d1f0c2f063c.tar.gz
bcfg2-3c154d9beeae2a7a411cbaaae8797d1f0c2f063c.tar.bz2
bcfg2-3c154d9beeae2a7a411cbaaae8797d1f0c2f063c.zip
migrate_db: set the current interaction after import
Diffstat (limited to 'tools/upgrade')
-rwxr-xr-xtools/upgrade/1.3/migrate_dbstats.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/upgrade/1.3/migrate_dbstats.py b/tools/upgrade/1.3/migrate_dbstats.py
index 3f3a02721..7a330cc99 100755
--- a/tools/upgrade/1.3/migrate_dbstats.py
+++ b/tools/upgrade/1.3/migrate_dbstats.py
@@ -258,6 +258,14 @@ def _restructure():
logger.info("Successfully restructured reason data")
return True
+ logger.info("Updating recent interactions")
+ for newint in new_models.Interaction.objects.recent():
+ try:
+ newint.save()
+ except:
+ logger.error("Failed to set current interaction %s for %s" %
+ (newint.id, newint.client.name), exc_info=1)
+
if __name__ == '__main__':
Bcfg2.Logger.setup_logging('bcfg2-report-collector',