Merge "Give correct example for translation_rules definition"

This commit is contained in:
Jenkins 2016-11-17 03:25:46 +00:00 committed by Gerrit Code Review
commit 674c34bfd2
1 changed files with 13 additions and 5 deletions

View File

@ -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