You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by mf...@redhat.com on 2013/02/21 15:45:03 UTC

[PATCH core] Core: Run db:migrate rake task after mock:fixtures:reset

From: Michal Fojtik <mf...@redhat.com>

Since the database is erased, Deltacloud will exit(1)
when started using CIMI frontend. This patch will execute
the migration after mock dir cleanup.

Signed-off-by: Michal fojtik <mf...@redhat.com>
---
 server/Rakefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/server/Rakefile b/server/Rakefile
index da068b8..31838a7 100644
--- a/server/Rakefile
+++ b/server/Rakefile
@@ -70,6 +70,7 @@ namespace :mock do
       puts "Copy mock data to #{MOCK_STORAGE_DIR}"
       puts "  (from #{srcdir})"
       FileUtils::cp_r(data, MOCK_STORAGE_DIR, :verbose => false)
+      Rake::Task['db:migrate'].invoke
     end
 
     desc "Remove Mock driver fixtures"
-- 
1.8.1.2


Re: [PATCH core] Core: Run db:migrate rake task after mock:fixtures:reset

Posted by David Lutterkort <lu...@redhat.com>.
On Thu, 2013-02-21 at 15:45 +0100, mfojtik@redhat.com wrote:
> From: Michal Fojtik <mf...@redhat.com>
> 
> Since the database is erased, Deltacloud will exit(1)
> when started using CIMI frontend. This patch will execute
> the migration after mock dir cleanup.

I don't understand why this is needed - the various mock:fixtures:*
tasks manipulate files in MOCK_STORAGE_DIR
(/var/tmp/deltacloud-$USER/mock) whereas the db lives
in /var/tmp/deltacloud-$USER

If any of those tasks really touch the DB, we should fix them instead.
In the future, we'll have DB's that do not live
in /var/tmp/deltacloud-$USER (e.g., pg) and we shouldn't bake DB changes
into the mock:fixtures:* tasks.

David