From b579d9f58216349395a017bbfb4bdf84f88c8c12 Mon Sep 17 00:00:00 2001 From: huangtianhua Date: Tue, 18 Oct 2016 10:50:47 +0800 Subject: [PATCH] Give correct example for translation_rules definition Change-Id: I21208ac0803b4dd7835bac619c64fc3b6fb25988 --- doc/source/developing_guides/supportstatus.rst | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/doc/source/developing_guides/supportstatus.rst b/doc/source/developing_guides/supportstatus.rst index 47646d68da..1abfb8a8c3 100644 --- a/doc/source/developing_guides/supportstatus.rst +++ b/doc/source/developing_guides/supportstatus.rst @@ -258,9 +258,17 @@ must overload `translation_rules` method, which should return a list of .. code-block:: python - def translation_rules(self): - return [properties.TranslationRule( - self.properties, - properties.TranslationRule.REPLACE, + def translation_rules(self, properties): + rules = [ + translation.TranslationRule( + properties, + translation.TranslationRule.REPLACE, translation_path=[self.NETWORKS, self.NETWORK_ID], - value_name=self.NETWORK_UUID)] + value_name=self.NETWORK_UUID), + translation.TranslationRule( + properties, + translation.TranslationRule.RESOLVE, + translation_path=[self.FLAVOR], + client_plugin=self.client_plugin('nova'), + finder='find_flavor_by_name_or_id')] + return rules