--- a/migration/3.0.0_Any.py Fri Apr 25 14:21:23 2014 +0200
+++ b/migration/3.0.0_Any.py Wed Feb 26 15:42:03 2014 +0100
@@ -29,9 +29,9 @@
from cubes.apycot import recipes
r_script_names = {
- u'apycot.recipe.quick': 'quick_script',
- u'apycot.recipe.full': 'full_script',
- u'apycot.recipe.scenario_runner': 'scenario_runner_script'
+ u'apycot.recipe.quick': recipes.quick_script,
+ u'apycot.recipe.full': recipes.full_script,
+ u'apycot.recipe.scenario_runner': recipes.scenario_runner_script,
}
warning_msg = """
@@ -42,17 +42,11 @@
for r_name in r_script_names:
## update script in recipe
- r_entity = rql('Any X WHERE X is Recipe, X name %(r_name)s,'
- 'X script "#to be updated"',
- {'r_name': r_name})
- if len(r_entity) > 0:
- r_entity = r_entity.get_entity(0, 0)
- r_entity.set_attributes(script=getattr(recipes, r_script_names[r_name]))
+ rql('SET X script %(script)s WHERE X is Recipe, X script "#to be updated", '
+ 'X name %(name)s',
+ {'script': r_script_names[r_name],
+ 'name': r_name})
## update script for existing TestExecution and Chekresults
- r_set = rql('Any X WHERE X execution_of Y, Y name %(r_name)s',
- {'r_name': r_name})
- for e in r_set.entities():
- if e.script is None:
- e.set_attributes(script=warning_msg + getattr(recipes,
- r_script_names[r_name]))
-
+ rql('SET X script %(script)s WHERE X execution_of Y, Y name %(name)s',
+ {'script': warning_msg + r_script_names[r_name],
+ 'name': r_name})