)]}'
{"doc/specs/in-progress/pluggable-types.rst":[{"author":{"_account_id":10475,"name":"Alexander Maretskiy","email":"amaretskiy@mirantis.com","username":"maretskiy"},"change_message_id":"b2b951e23dc3a8d9fa68ac863407cfe03751fb06","unresolved":false,"context_lines":[{"line_number":8,"context_line":"Pluggable Types"},{"line_number":9,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Rally\u0027s current type resolution subsystem (``rally.common.types``)"},{"line_number":12,"context_line":"isn\u0027t easily pluggable, is tied to OpenStack, and cannot handle resources"},{"line_number":13,"context_line":"that must be resolved by the context of each iteration rather than the"},{"line_number":14,"context_line":"context of the subtask. This spec aims to solve all three problems."}],"source_content_type":"text/x-rst","patch_set":1,"id":"1a26ad4f_ca9cea6b","line":11,"updated":"2015-10-28 15:37:36.000000000","message":"rally.task.types","commit_id":"8b0f0b9d844ac42b01033c446a84c6b06ec9b125"},{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"d98cc3ca88c611e4cab99f196f34d2b16a680482","unresolved":false,"context_lines":[{"line_number":8,"context_line":"Pluggable Types"},{"line_number":9,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Rally\u0027s current type resolution subsystem (``rally.common.types``)"},{"line_number":12,"context_line":"isn\u0027t easily pluggable, is tied to OpenStack, and cannot handle resources"},{"line_number":13,"context_line":"that must be resolved by the context of each iteration rather than the"},{"line_number":14,"context_line":"context of the subtask. This spec aims to solve all three problems."}],"source_content_type":"text/x-rst","patch_set":1,"id":"1a26ad4f_a6043d7e","line":11,"in_reply_to":"1a26ad4f_ca9cea6b","updated":"2015-10-28 22:35:43.000000000","message":"Done","commit_id":"8b0f0b9d844ac42b01033c446a84c6b06ec9b125"},{"author":{"_account_id":10475,"name":"Alexander Maretskiy","email":"amaretskiy@mirantis.com","username":"maretskiy"},"change_message_id":"b2b951e23dc3a8d9fa68ac863407cfe03751fb06","unresolved":false,"context_lines":[{"line_number":99,"context_line":"This will allow the resource classes to retain persistent information"},{"line_number":100,"context_line":"about a single decorated scenario function. ``transform`` will also be"},{"line_number":101,"context_line":"renamed to ``preprocess``, which will be more consistent with"},{"line_number":102,"context_line":"``rally.common.types.preprocess`` and will make it easier to add a"},{"line_number":103,"context_line":"second resource type resolution hook, described below."},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"Third, a new hook will be added to the runners. In addition to"}],"source_content_type":"text/x-rst","patch_set":1,"id":"1a26ad4f_a9173b50","line":102,"updated":"2015-10-28 15:37:36.000000000","message":"rally.task.types.preprocess","commit_id":"8b0f0b9d844ac42b01033c446a84c6b06ec9b125"},{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"d98cc3ca88c611e4cab99f196f34d2b16a680482","unresolved":false,"context_lines":[{"line_number":99,"context_line":"This will allow the resource classes to retain persistent information"},{"line_number":100,"context_line":"about a single decorated scenario function. ``transform`` will also be"},{"line_number":101,"context_line":"renamed to ``preprocess``, which will be more consistent with"},{"line_number":102,"context_line":"``rally.common.types.preprocess`` and will make it easier to add a"},{"line_number":103,"context_line":"second resource type resolution hook, described below."},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"Third, a new hook will be added to the runners. In addition to"}],"source_content_type":"text/x-rst","patch_set":1,"id":"1a26ad4f_26f90d81","line":102,"in_reply_to":"1a26ad4f_a9173b50","updated":"2015-10-28 22:35:43.000000000","message":"Done","commit_id":"8b0f0b9d844ac42b01033c446a84c6b06ec9b125"},{"author":{"_account_id":10475,"name":"Alexander Maretskiy","email":"amaretskiy@mirantis.com","username":"maretskiy"},"change_message_id":"b2b951e23dc3a8d9fa68ac863407cfe03751fb06","unresolved":false,"context_lines":[{"line_number":106,"context_line":"``types.preprocess()``, which is run after contexts but before the"},{"line_number":107,"context_line":"scenarios start, ``types.preiteration()`` will run before each"},{"line_number":108,"context_line":"iteration of the scenario. Together with the change to make"},{"line_number":109,"context_line":"``types.set()`` accept objects instead of classes, this will solve the"},{"line_number":110,"context_line":"issue of resources that must be resolved per-iteration."},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"For instance, to resolve images, ``ImageResourceType.preprocess()``"}],"source_content_type":"text/x-rst","patch_set":1,"id":"1a26ad4f_cc4de573","line":109,"updated":"2015-10-28 15:37:36.000000000","message":"Can we also rename `types.set\u0027 to something different?\n\n`types.set\u0027 is a naming issue because `set\u0027 is in module namespace so it clashes with built-in type name (this rule is mentioned in http://docs.openstack.org/developer/hacking/).","commit_id":"8b0f0b9d844ac42b01033c446a84c6b06ec9b125"},{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"d98cc3ca88c611e4cab99f196f34d2b16a680482","unresolved":false,"context_lines":[{"line_number":106,"context_line":"``types.preprocess()``, which is run after contexts but before the"},{"line_number":107,"context_line":"scenarios start, ``types.preiteration()`` will run before each"},{"line_number":108,"context_line":"iteration of the scenario. Together with the change to make"},{"line_number":109,"context_line":"``types.set()`` accept objects instead of classes, this will solve the"},{"line_number":110,"context_line":"issue of resources that must be resolved per-iteration."},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"For instance, to resolve images, ``ImageResourceType.preprocess()``"}],"source_content_type":"text/x-rst","patch_set":1,"id":"1a26ad4f_463d292a","line":109,"in_reply_to":"1a26ad4f_cc4de573","updated":"2015-10-28 22:35:43.000000000","message":"Done","commit_id":"8b0f0b9d844ac42b01033c446a84c6b06ec9b125"},{"author":{"_account_id":10475,"name":"Alexander Maretskiy","email":"amaretskiy@mirantis.com","username":"maretskiy"},"change_message_id":"b2b951e23dc3a8d9fa68ac863407cfe03751fb06","unresolved":false,"context_lines":[{"line_number":125,"context_line":""},{"line_number":126,"context_line":".. code-block:: python"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"    class ResourceType(object):"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"        @abc.abstractmethod"},{"line_number":131,"context_line":"        def preprocess(self, context, resource_config):"}],"source_content_type":"text/x-rst","patch_set":1,"id":"1a26ad4f_ef945338","line":128,"updated":"2015-10-28 15:37:36.000000000","message":"This probably should be inherited from Plugin, isn\u0027t it?","commit_id":"8b0f0b9d844ac42b01033c446a84c6b06ec9b125"},{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"d98cc3ca88c611e4cab99f196f34d2b16a680482","unresolved":false,"context_lines":[{"line_number":125,"context_line":""},{"line_number":126,"context_line":".. code-block:: python"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"    class ResourceType(object):"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"        @abc.abstractmethod"},{"line_number":131,"context_line":"        def preprocess(self, context, resource_config):"}],"source_content_type":"text/x-rst","patch_set":1,"id":"1a26ad4f_46f68990","line":128,"in_reply_to":"1a26ad4f_ef945338","updated":"2015-10-28 22:35:43.000000000","message":"Done","commit_id":"8b0f0b9d844ac42b01033c446a84c6b06ec9b125"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"c85214e8b5732faa0d3e84395a30f11171792ab8","unresolved":false,"context_lines":[{"line_number":5,"context_line":" http://creativecommons.org/licenses/by/3.0/legalcode"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":8,"context_line":"Pluggable Types"},{"line_number":9,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Rally\u0027s current type resolution subsystem (``rally.task.types``) isn\u0027t"}],"source_content_type":"text/x-rst","patch_set":2,"id":"1a26ad4f_294bc72b","line":8,"updated":"2015-11-02 09:17:49.000000000","message":"Make Resource Types pluggable","commit_id":"bfaa7b35f738ca2f796d76ecb60ba68ba84dea6c"},{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"706a8795d1c7c75ba4cd0f26232b5a8908c1bca7","unresolved":false,"context_lines":[{"line_number":5,"context_line":" http://creativecommons.org/licenses/by/3.0/legalcode"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":8,"context_line":"Pluggable Types"},{"line_number":9,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Rally\u0027s current type resolution subsystem (``rally.task.types``) isn\u0027t"}],"source_content_type":"text/x-rst","patch_set":2,"id":"1a26ad4f_56feceae","line":8,"in_reply_to":"1a26ad4f_294bc72b","updated":"2015-11-02 16:22:12.000000000","message":"Done","commit_id":"bfaa7b35f738ca2f796d76ecb60ba68ba84dea6c"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"c85214e8b5732faa0d3e84395a30f11171792ab8","unresolved":false,"context_lines":[{"line_number":62,"context_line":""},{"line_number":63,"context_line":".. code-block:: python"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def transform(cls, resource_config, context\u003dNone, clients\u003dNone):"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"Within the types subsystem proper, only ``context`` will be passed;"},{"line_number":68,"context_line":"``clients`` will remain for compatibility with the validation"}],"source_content_type":"text/x-rst","patch_set":2,"id":"1a26ad4f_e9fe2fad","line":65,"updated":"2015-11-02 09:17:49.000000000","message":"We can do it better: \n\n  def transform(self, resource_config, context\u003dNone, clients\u003dNone):\n\nin such case we can have base Resource classes for OpenStack and keep some common work inside. (Like we are doing in OpenStackScenario class)","commit_id":"bfaa7b35f738ca2f796d76ecb60ba68ba84dea6c"},{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"706a8795d1c7c75ba4cd0f26232b5a8908c1bca7","unresolved":false,"context_lines":[{"line_number":62,"context_line":""},{"line_number":63,"context_line":".. code-block:: python"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def transform(cls, resource_config, context\u003dNone, clients\u003dNone):"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"Within the types subsystem proper, only ``context`` will be passed;"},{"line_number":68,"context_line":"``clients`` will remain for compatibility with the validation"}],"source_content_type":"text/x-rst","patch_set":2,"id":"1a26ad4f_96e6a613","line":65,"in_reply_to":"1a26ad4f_e9fe2fad","updated":"2015-11-02 16:22:12.000000000","message":"Done","commit_id":"bfaa7b35f738ca2f796d76ecb60ba68ba84dea6c"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"c85214e8b5732faa0d3e84395a30f11171792ab8","unresolved":false,"context_lines":[{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def transform(cls, resource_config, context\u003dNone, clients\u003dNone):"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"Within the types subsystem proper, only ``context`` will be passed;"},{"line_number":68,"context_line":"``clients`` will remain for compatibility with the validation"},{"line_number":69,"context_line":"subsystem, which does not have a context object yet, and remains tied"},{"line_number":70,"context_line":"to OpenStack."}],"source_content_type":"text/x-rst","patch_set":2,"id":"1a26ad4f_69cd3fb6","line":67,"updated":"2015-11-02 09:17:49.000000000","message":"seems like reasonable change","commit_id":"bfaa7b35f738ca2f796d76ecb60ba68ba84dea6c"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"c85214e8b5732faa0d3e84395a30f11171792ab8","unresolved":false,"context_lines":[{"line_number":91,"context_line":""},{"line_number":92,"context_line":".. code-block:: python"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    @types.set(image\u003dtypes.ImageResourceType(),"},{"line_number":95,"context_line":"               flavor\u003dtypes.FlavorResourceType())"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"This will allow the resource classes to retain persistent information"}],"source_content_type":"text/x-rst","patch_set":2,"id":"1a26ad4f_441e2a60","line":94,"updated":"2015-11-02 09:17:49.000000000","message":"Based on my experience in Rally this is path to hell. \n\nWe shouldn\u0027t use \"direct\" class in plugin description. This creates many issues:\n  - No way to rename/move class without breaking backward compatibility issues\n  - This requires users to import all types in code (and they will be often in different modules) which will create mess of imports \n  - This is not \"plugin\" way that we have in code \n  - We will need to reinvent deprecation mechanism for this (instead of making one that works for all plugins) \n  - We will need to do hack to show this in our docs \n  - This won\u0027t allow us to split in different namespaces \n\nI would suggest to have here something like: \n\n   @types.convert(\n      image\u003d{\"type\": \"image_type\", \"args\": {}}, \n      flavor\u003d{\"type\": \"flavor_type\", \"args\": {}}, \n)\n\nwhere image_type, flavor_type are the names of resource plugins and args is optional argument that will be passed to this plugin during initialization","commit_id":"bfaa7b35f738ca2f796d76ecb60ba68ba84dea6c"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"c85214e8b5732faa0d3e84395a30f11171792ab8","unresolved":false,"context_lines":[{"line_number":94,"context_line":"    @types.set(image\u003dtypes.ImageResourceType(),"},{"line_number":95,"context_line":"               flavor\u003dtypes.FlavorResourceType())"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"This will allow the resource classes to retain persistent information"},{"line_number":98,"context_line":"about a single decorated scenario function. ``transform`` will also be"},{"line_number":99,"context_line":"renamed to ``preprocess``, which will be more consistent with"},{"line_number":100,"context_line":"``rally.task.types.preprocess`` and will make it easier to add a"}],"source_content_type":"text/x-rst","patch_set":2,"id":"1a26ad4f_e42f3686","line":97,"updated":"2015-11-02 09:17:49.000000000","message":"not sure that I understand what information you would like to store?","commit_id":"bfaa7b35f738ca2f796d76ecb60ba68ba84dea6c"},{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"706a8795d1c7c75ba4cd0f26232b5a8908c1bca7","unresolved":false,"context_lines":[{"line_number":94,"context_line":"    @types.set(image\u003dtypes.ImageResourceType(),"},{"line_number":95,"context_line":"               flavor\u003dtypes.FlavorResourceType())"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"This will allow the resource classes to retain persistent information"},{"line_number":98,"context_line":"about a single decorated scenario function. ``transform`` will also be"},{"line_number":99,"context_line":"renamed to ``preprocess``, which will be more consistent with"},{"line_number":100,"context_line":"``rally.task.types.preprocess`` and will make it easier to add a"}],"source_content_type":"text/x-rst","patch_set":2,"id":"1a26ad4f_c16bfab7","line":97,"in_reply_to":"1a26ad4f_e42f3686","updated":"2015-11-02 16:22:12.000000000","message":"You give a good example in your comment on line 118.","commit_id":"bfaa7b35f738ca2f796d76ecb60ba68ba84dea6c"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"c85214e8b5732faa0d3e84395a30f11171792ab8","unresolved":false,"context_lines":[{"line_number":100,"context_line":"``rally.task.types.preprocess`` and will make it easier to add a"},{"line_number":101,"context_line":"second resource type resolution hook, described below."},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"Third, we will rename ``types.set()`` to ``types.convert()``. This"},{"line_number":104,"context_line":"change is only marginally related, but it\u0027s important because ``set``"},{"line_number":105,"context_line":"is a reserved keyword and is in violation of the OpenStack Style"},{"line_number":106,"context_line":"Guidelines. Since we\u0027re making so many changes to this code, this spec"}],"source_content_type":"text/x-rst","patch_set":2,"id":"1a26ad4f_6471e6a7","line":103,"updated":"2015-11-02 09:17:49.000000000","message":"I really like this name","commit_id":"bfaa7b35f738ca2f796d76ecb60ba68ba84dea6c"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"c85214e8b5732faa0d3e84395a30f11171792ab8","unresolved":false,"context_lines":[{"line_number":104,"context_line":"change is only marginally related, but it\u0027s important because ``set``"},{"line_number":105,"context_line":"is a reserved keyword and is in violation of the OpenStack Style"},{"line_number":106,"context_line":"Guidelines. Since we\u0027re making so many changes to this code, this spec"},{"line_number":107,"context_line":"is a good time to change the name of the function."},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"Fourth, a new hook will be added to the runners. In addition to"},{"line_number":110,"context_line":"``types.preprocess()``, which is run after contexts but before the"}],"source_content_type":"text/x-rst","patch_set":2,"id":"1a26ad4f_04b2724c","line":107,"updated":"2015-11-02 09:17:49.000000000","message":"agree","commit_id":"bfaa7b35f738ca2f796d76ecb60ba68ba84dea6c"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"c85214e8b5732faa0d3e84395a30f11171792ab8","unresolved":false,"context_lines":[{"line_number":115,"context_line":""},{"line_number":116,"context_line":"For instance, to resolve images, ``ImageResourceType.preprocess()``"},{"line_number":117,"context_line":"would resolve images for each set of credentials created for the"},{"line_number":118,"context_line":"subtask, as well as for the admin credentials, and cache them;"},{"line_number":119,"context_line":"``ImageResourceType.preiteration()`` would be passed the mapped"},{"line_number":120,"context_line":"scenario context and the resource configuration, and would choose the"},{"line_number":121,"context_line":"correct image ID to pass to the scenario. Note that image listing and"}],"source_content_type":"text/x-rst","patch_set":2,"id":"1a26ad4f_44970a3a","line":118,"updated":"2015-11-02 09:17:49.000000000","message":"no actually we shouldn\u0027t do *any* request to OpenStack inside the preiteration method (we should make it even static) to avoid such things.\n\nOtherwise it will add a LOT of noise in iteration \u0026 load that we are doing.\n\nThis should just take results from instances of types of plugins and do the mapping. \n\nI will try to explain via code snippet: \n\n   class ImageResource(plugin_base): \n\n       def __init__(self, arg_name, arg_value, **kwargs):\n           self.arg_name \u003d arg_name\n           self.arg_value \u003d arg_value \n\n        def preprocess(self, arg_name, arg_value, context): \n          self.images_per_tenant \u003d {}\n          for user, tenant in utils.iterateovertenant(context[\"users\"]):\n              self.images_per_tenant[tenant[\"uuid\"]] \u003d osclients.Client(user).glance.image_get(self.arg_value)[\"id\"]\n\n      @staticmethod\n       def map_for_scenario(scenario_context, **kw): \n          kw[self.arg_name] \u003d self.images_per_tenant[conext[\"tenant\"][\"uuid\"]]\n\n\n\n__init__ method can be moved to the some base class (here it is put just to make it clear)","commit_id":"bfaa7b35f738ca2f796d76ecb60ba68ba84dea6c"},{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"706a8795d1c7c75ba4cd0f26232b5a8908c1bca7","unresolved":false,"context_lines":[{"line_number":115,"context_line":""},{"line_number":116,"context_line":"For instance, to resolve images, ``ImageResourceType.preprocess()``"},{"line_number":117,"context_line":"would resolve images for each set of credentials created for the"},{"line_number":118,"context_line":"subtask, as well as for the admin credentials, and cache them;"},{"line_number":119,"context_line":"``ImageResourceType.preiteration()`` would be passed the mapped"},{"line_number":120,"context_line":"scenario context and the resource configuration, and would choose the"},{"line_number":121,"context_line":"correct image ID to pass to the scenario. Note that image listing and"}],"source_content_type":"text/x-rst","patch_set":2,"id":"1a26ad4f_a1403e35","line":118,"in_reply_to":"1a26ad4f_44970a3a","updated":"2015-11-02 16:22:12.000000000","message":"That\u0027s what I envisioned and what I describe here. preprocess() does the requests to OpenStack; preiteration() (better called map_for_scenario(), as you suggest) just maps the results that have already been queried. (See, for instance, lines 121-123.)\n\nIn your example, map_for_scenario obviously can\u0027t be static since it references \u0027self\u0027, which is a good example of the persistent information I expect resource classes to retain. (See line 97.)","commit_id":"bfaa7b35f738ca2f796d76ecb60ba68ba84dea6c"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"c85214e8b5732faa0d3e84395a30f11171792ab8","unresolved":false,"context_lines":[{"line_number":116,"context_line":"For instance, to resolve images, ``ImageResourceType.preprocess()``"},{"line_number":117,"context_line":"would resolve images for each set of credentials created for the"},{"line_number":118,"context_line":"subtask, as well as for the admin credentials, and cache them;"},{"line_number":119,"context_line":"``ImageResourceType.preiteration()`` would be passed the mapped"},{"line_number":120,"context_line":"scenario context and the resource configuration, and would choose the"},{"line_number":121,"context_line":"correct image ID to pass to the scenario. Note that image listing and"},{"line_number":122,"context_line":"resolution is not done by ``preiteration()``; we should strive to keep"}],"source_content_type":"text/x-rst","patch_set":2,"id":"1a26ad4f_e49ad66d","line":119,"updated":"2015-11-02 09:17:49.000000000","message":"maybe we can use map_for_scenario we have already such method in our Context classes.","commit_id":"bfaa7b35f738ca2f796d76ecb60ba68ba84dea6c"},{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"706a8795d1c7c75ba4cd0f26232b5a8908c1bca7","unresolved":false,"context_lines":[{"line_number":116,"context_line":"For instance, to resolve images, ``ImageResourceType.preprocess()``"},{"line_number":117,"context_line":"would resolve images for each set of credentials created for the"},{"line_number":118,"context_line":"subtask, as well as for the admin credentials, and cache them;"},{"line_number":119,"context_line":"``ImageResourceType.preiteration()`` would be passed the mapped"},{"line_number":120,"context_line":"scenario context and the resource configuration, and would choose the"},{"line_number":121,"context_line":"correct image ID to pass to the scenario. Note that image listing and"},{"line_number":122,"context_line":"resolution is not done by ``preiteration()``; we should strive to keep"}],"source_content_type":"text/x-rst","patch_set":2,"id":"1a26ad4f_362d52a8","line":119,"in_reply_to":"1a26ad4f_e49ad66d","updated":"2015-11-02 16:22:12.000000000","message":"Done","commit_id":"bfaa7b35f738ca2f796d76ecb60ba68ba84dea6c"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"dca9c3b25386d56fdb4695e93f7b7cf381c538c6","unresolved":false,"context_lines":[{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    def preprocess(self, resource_config, context\u003dNone, clients\u003dNone):"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"Within the types subsystem proper, only ``context`` will be passed;"},{"line_number":113,"context_line":"``clients`` will remain for compatibility with the validation"},{"line_number":114,"context_line":"subsystem, which does not have a context object yet, and remains tied"},{"line_number":115,"context_line":"to OpenStack."}],"source_content_type":"text/x-rst","patch_set":3,"id":"fa80f949_1a41d60b","line":112,"updated":"2015-11-04 08:59:58.000000000","message":"so the problem with context here is that validation won\u0027t have it at all. (because it is done before any of context is created) \n\nI hope this won\u0027t block us in future..","commit_id":"57b1da321a7a7eb9e7f2975c40f4311fa1ef84e0"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"dca9c3b25386d56fdb4695e93f7b7cf381c538c6","unresolved":false,"context_lines":[{"line_number":158,"context_line":"    class ResourceType(plugin.Plugin):"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"        @abc.abstractmethod"},{"line_number":161,"context_line":"        def preprocess(self, context, resource_config):"},{"line_number":162,"context_line":"            pass"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"        def map_for_scenario(self, context, resource_config):"}],"source_content_type":"text/x-rst","patch_set":3,"id":"fa80f949_3ae29a04","line":161,"updated":"2015-11-04 08:59:58.000000000","message":"as we are refactoring all names we should pick better name for resource_config (because it is not clear for me)","commit_id":"57b1da321a7a7eb9e7f2975c40f4311fa1ef84e0"},{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"da2398bd1bb2611cf9195e791c7acc0bfdb7ec94","unresolved":false,"context_lines":[{"line_number":158,"context_line":"    class ResourceType(plugin.Plugin):"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"        @abc.abstractmethod"},{"line_number":161,"context_line":"        def preprocess(self, context, resource_config):"},{"line_number":162,"context_line":"            pass"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"        def map_for_scenario(self, context, resource_config):"}],"source_content_type":"text/x-rst","patch_set":3,"id":"fa80f949_b779b595","line":161,"in_reply_to":"fa80f949_3ae29a04","updated":"2015-11-04 14:26:45.000000000","message":"Got any recommendations? \"resource_config\" isn\u0027t the clearest, but it is accurate. I\u0027m not sure what else to call the config block for a resource.","commit_id":"57b1da321a7a7eb9e7f2975c40f4311fa1ef84e0"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"1ba70606ee53c09d8dafa0849420630488b591a6","unresolved":false,"context_lines":[{"line_number":158,"context_line":"    class ResourceType(plugin.Plugin):"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"        @abc.abstractmethod"},{"line_number":161,"context_line":"        def preprocess(self, context, resource_config):"},{"line_number":162,"context_line":"            pass"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"        def map_for_scenario(self, context, resource_config):"}],"source_content_type":"text/x-rst","patch_set":3,"id":"fa80f949_f2a412ba","line":161,"in_reply_to":"fa80f949_b779b595","updated":"2015-11-05 03:24:43.000000000","message":"I don\u0027t like the part \"resource\" in resource_config \u003d)","commit_id":"57b1da321a7a7eb9e7f2975c40f4311fa1ef84e0"},{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"aea639de69d4c862c28dac5b32541a369044c1e5","unresolved":false,"context_lines":[{"line_number":158,"context_line":"    class ResourceType(plugin.Plugin):"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"        @abc.abstractmethod"},{"line_number":161,"context_line":"        def preprocess(self, context, resource_config):"},{"line_number":162,"context_line":"            pass"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"        def map_for_scenario(self, context, resource_config):"}],"source_content_type":"text/x-rst","patch_set":3,"id":"fa80f949_1230b600","line":161,"in_reply_to":"fa80f949_f2a412ba","updated":"2015-11-05 03:48:34.000000000","message":"Done","commit_id":"57b1da321a7a7eb9e7f2975c40f4311fa1ef84e0"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"dca9c3b25386d56fdb4695e93f7b7cf381c538c6","unresolved":false,"context_lines":[{"line_number":162,"context_line":"            pass"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"        def map_for_scenario(self, context, resource_config):"},{"line_number":165,"context_line":"            return self.value"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"    class FlavorResourceType(ResourceType):"},{"line_number":168,"context_line":"        def preprocess(self, resource_config, context\u003dNone, clients\u003dNone):"}],"source_content_type":"text/x-rst","patch_set":3,"id":"fa80f949_ba176aec","line":165,"updated":"2015-11-04 08:59:58.000000000","message":"Imho I would prefer here next signature:\n\n\n   def map_for_scenario(self, scenario_context, **scenario_args): \n        return scenario_args\n\nBtw it is worth to rename context to scenario_context.","commit_id":"57b1da321a7a7eb9e7f2975c40f4311fa1ef84e0"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"1ba70606ee53c09d8dafa0849420630488b591a6","unresolved":false,"context_lines":[{"line_number":162,"context_line":"            pass"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"        def map_for_scenario(self, context, resource_config):"},{"line_number":165,"context_line":"            return self.value"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"    class FlavorResourceType(ResourceType):"},{"line_number":168,"context_line":"        def preprocess(self, resource_config, context\u003dNone, clients\u003dNone):"}],"source_content_type":"text/x-rst","patch_set":3,"id":"fa80f949_d288ee24","line":165,"in_reply_to":"fa80f949_3794e589","updated":"2015-11-05 03:24:43.000000000","message":"It\u0027s more flexible mechanism, and I believe we will need such flexiblity in feature, making it possible to do now will allow us to reduce in future amount of required non backward compatible changes..","commit_id":"57b1da321a7a7eb9e7f2975c40f4311fa1ef84e0"},{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"da2398bd1bb2611cf9195e791c7acc0bfdb7ec94","unresolved":false,"context_lines":[{"line_number":162,"context_line":"            pass"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"        def map_for_scenario(self, context, resource_config):"},{"line_number":165,"context_line":"            return self.value"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"    class FlavorResourceType(ResourceType):"},{"line_number":168,"context_line":"        def preprocess(self, resource_config, context\u003dNone, clients\u003dNone):"}],"source_content_type":"text/x-rst","patch_set":3,"id":"fa80f949_3794e589","line":165,"in_reply_to":"fa80f949_ba176aec","updated":"2015-11-04 14:26:45.000000000","message":"I just want to be clear here -- are you suggesting that the type plugins should be able to rewrite *all* of the arguments for a scenario, not just the one type argument?","commit_id":"57b1da321a7a7eb9e7f2975c40f4311fa1ef84e0"},{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"aea639de69d4c862c28dac5b32541a369044c1e5","unresolved":false,"context_lines":[{"line_number":162,"context_line":"            pass"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"        def map_for_scenario(self, context, resource_config):"},{"line_number":165,"context_line":"            return self.value"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"    class FlavorResourceType(ResourceType):"},{"line_number":168,"context_line":"        def preprocess(self, resource_config, context\u003dNone, clients\u003dNone):"}],"source_content_type":"text/x-rst","patch_set":3,"id":"fa80f949_ed50b30c","line":165,"in_reply_to":"fa80f949_d288ee24","updated":"2015-11-05 03:48:34.000000000","message":"Can you give an example of when a type decorator would need to modify an argument other than the one that pertains to the type that it is resolving?\n\nThis seems like it will just move the code to find the correct argument into the ResourceType class, so for the vast majority of ResourceType classes -- in fact, for all currently existing ResourceType classes -- we\u0027ll have a boilerplate preprocess() that finds the right argument and then offloads type conversion to another function. That seems like an unnecessary rearrangement of code unless we have a concrete use case for this. If we don\u0027t, we can rearrange the code thusly at some later data, because YAGNI.","commit_id":"57b1da321a7a7eb9e7f2975c40f4311fa1ef84e0"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"dca9c3b25386d56fdb4695e93f7b7cf381c538c6","unresolved":false,"context_lines":[{"line_number":169,"context_line":"            self.value \u003d resource_config.get(\"id\")"},{"line_number":170,"context_line":"            if not self.value:"},{"line_number":171,"context_line":"                novaclient \u003d clients.nova()"},{"line_number":172,"context_line":"                self.value \u003d _id_from_name(resource_config\u003dresource_config,"},{"line_number":173,"context_line":"                                           resources\u003dnovaclient.flavors.list(),"},{"line_number":174,"context_line":"                                           typename\u003d\"flavor\")"},{"line_number":175,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"fa80f949_fa92d256","line":172,"updated":"2015-11-04 08:59:58.000000000","message":"Probably I am missing something, but this just won\u0027t work. \n\nThe whole idea of introducing method map_for_scenario is to calculated value (that is precached in preprocess). Like preprocess will find all flavors id for all tenants. And map_for_scenario will pick one of them based on what we have in scenario context","commit_id":"57b1da321a7a7eb9e7f2975c40f4311fa1ef84e0"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"1ba70606ee53c09d8dafa0849420630488b591a6","unresolved":false,"context_lines":[{"line_number":169,"context_line":"            self.value \u003d resource_config.get(\"id\")"},{"line_number":170,"context_line":"            if not self.value:"},{"line_number":171,"context_line":"                novaclient \u003d clients.nova()"},{"line_number":172,"context_line":"                self.value \u003d _id_from_name(resource_config\u003dresource_config,"},{"line_number":173,"context_line":"                                           resources\u003dnovaclient.flavors.list(),"},{"line_number":174,"context_line":"                                           typename\u003d\"flavor\")"},{"line_number":175,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"fa80f949_92990671","line":172,"in_reply_to":"fa80f949_5741690a","updated":"2015-11-05 03:24:43.000000000","message":"So in any case I would still prefer to do aovid this self.value magic it\u0027s better to keep thing explicit where it is possible.","commit_id":"57b1da321a7a7eb9e7f2975c40f4311fa1ef84e0"},{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"aea639de69d4c862c28dac5b32541a369044c1e5","unresolved":false,"context_lines":[{"line_number":169,"context_line":"            self.value \u003d resource_config.get(\"id\")"},{"line_number":170,"context_line":"            if not self.value:"},{"line_number":171,"context_line":"                novaclient \u003d clients.nova()"},{"line_number":172,"context_line":"                self.value \u003d _id_from_name(resource_config\u003dresource_config,"},{"line_number":173,"context_line":"                                           resources\u003dnovaclient.flavors.list(),"},{"line_number":174,"context_line":"                                           typename\u003d\"flavor\")"},{"line_number":175,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"fa80f949_2d479b4c","line":172,"in_reply_to":"fa80f949_92990671","updated":"2015-11-05 03:48:34.000000000","message":"There is no magic here -- it resolves the flavor ID in preprocess and then returns it in map_for_scenario(). It\u0027s just the simple case of the workflow we\u0027ve agreed upon. How can that be more explicit?","commit_id":"57b1da321a7a7eb9e7f2975c40f4311fa1ef84e0"},{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"da2398bd1bb2611cf9195e791c7acc0bfdb7ec94","unresolved":false,"context_lines":[{"line_number":169,"context_line":"            self.value \u003d resource_config.get(\"id\")"},{"line_number":170,"context_line":"            if not self.value:"},{"line_number":171,"context_line":"                novaclient \u003d clients.nova()"},{"line_number":172,"context_line":"                self.value \u003d _id_from_name(resource_config\u003dresource_config,"},{"line_number":173,"context_line":"                                           resources\u003dnovaclient.flavors.list(),"},{"line_number":174,"context_line":"                                           typename\u003d\"flavor\")"},{"line_number":175,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"fa80f949_5741690a","line":172,"in_reply_to":"fa80f949_fa92d256","updated":"2015-11-04 14:26:45.000000000","message":"You\u0027re not missing anything -- that\u0027s exactly the workflow I describe above -- I just chose a bad example to illustrate it. Since flavors aren\u0027t per-tenant they don\u0027t need that workflow and can be simpler, but it was a poor choice on my part to give an example of the simple workflow but not of the complex one. I\u0027ll add an example of ImageResourceType, which will hopefully clear this up.","commit_id":"57b1da321a7a7eb9e7f2975c40f4311fa1ef84e0"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"074863a882d8abce46a79ba309eb50f5ea987a62","unresolved":false,"context_lines":[{"line_number":177,"context_line":"    class ResourceType(plugin.Plugin):"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"        @abc.abstractmethod"},{"line_number":180,"context_line":"        def preprocess(self, context, config):"},{"line_number":181,"context_line":"            pass"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"        def map_for_scenario(self, scenario_context, config):"}],"source_content_type":"text/x-rst","patch_set":4,"id":"fa80f949_57a83edb","line":180,"updated":"2015-11-06 03:23:14.000000000","message":"Sorry for pointing here, but config of what? I don\u0027t like resource_config because \"resource\" is not clear and just config is way less clear. \n\nWhat it configures? can you understand the structure of it by name? I can\u0027t..","commit_id":"8ff066de4039443cef974adc2edd3b8d9807429c"},{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"02f36a2f29ba7b8ea67190c26221240c224e283f","unresolved":false,"context_lines":[{"line_number":177,"context_line":"    class ResourceType(plugin.Plugin):"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"        @abc.abstractmethod"},{"line_number":180,"context_line":"        def preprocess(self, context, config):"},{"line_number":181,"context_line":"            pass"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"        def map_for_scenario(self, scenario_context, config):"}],"source_content_type":"text/x-rst","patch_set":4,"id":"fa80f949_acf03cff","line":180,"in_reply_to":"fa80f949_57a83edb","updated":"2015-11-06 05:02:37.000000000","message":"It\u0027s configuring a resource. (It\u0027s worth noting that we already call it a resource in \"ResourceType\".) What else can we call it if not \"resource_config\"?","commit_id":"8ff066de4039443cef974adc2edd3b8d9807429c"},{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"d83d0891ac1db38036cf1b041bda949a34f9599e","unresolved":false,"context_lines":[{"line_number":177,"context_line":"    class ResourceType(plugin.Plugin):"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"        @abc.abstractmethod"},{"line_number":180,"context_line":"        def preprocess(self, context, config):"},{"line_number":181,"context_line":"            pass"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"        def map_for_scenario(self, scenario_context, config):"}],"source_content_type":"text/x-rst","patch_set":4,"id":"fa80f949_7e6ae5b4","line":180,"in_reply_to":"fa80f949_acf03cff","updated":"2015-11-06 14:49:23.000000000","message":"I\u0027ve changed this back to resource_config. If we come up with a better name I\u0027m happy to change it back, but in the mean time that\u0027s the best we\u0027ve got.","commit_id":"8ff066de4039443cef974adc2edd3b8d9807429c"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"074863a882d8abce46a79ba309eb50f5ea987a62","unresolved":false,"context_lines":[{"line_number":181,"context_line":"            pass"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"        def map_for_scenario(self, scenario_context, config):"},{"line_number":184,"context_line":"            return self.value"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"    class FlavorResourceType(ResourceType):"},{"line_number":187,"context_line":"        def preprocess(self, config, context\u003dNone, clients\u003dNone):"}],"source_content_type":"text/x-rst","patch_set":4,"id":"fa80f949_d7b42e36","line":184,"updated":"2015-11-06 03:23:14.000000000","message":"so there shound\u0027t be any self.value here.... it makes interfaces unclear, it makes people every time look at the base type class..","commit_id":"8ff066de4039443cef974adc2edd3b8d9807429c"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"60b1a9d4712b3b9dd3135659e90e38b43fe1aa73","unresolved":false,"context_lines":[{"line_number":181,"context_line":"            pass"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"        def map_for_scenario(self, scenario_context, config):"},{"line_number":184,"context_line":"            return self.value"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"    class FlavorResourceType(ResourceType):"},{"line_number":187,"context_line":"        def preprocess(self, config, context\u003dNone, clients\u003dNone):"}],"source_content_type":"text/x-rst","patch_set":4,"id":"fa80f949_6cd494bc","line":184,"in_reply_to":"fa80f949_2caf6ce3","updated":"2015-11-06 05:45:28.000000000","message":"Imho it is not worth hiding... It\u0027s only one line and not always used.","commit_id":"8ff066de4039443cef974adc2edd3b8d9807429c"},{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"d83d0891ac1db38036cf1b041bda949a34f9599e","unresolved":false,"context_lines":[{"line_number":181,"context_line":"            pass"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"        def map_for_scenario(self, scenario_context, config):"},{"line_number":184,"context_line":"            return self.value"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"    class FlavorResourceType(ResourceType):"},{"line_number":187,"context_line":"        def preprocess(self, config, context\u003dNone, clients\u003dNone):"}],"source_content_type":"text/x-rst","patch_set":4,"id":"fa80f949_fc04a018","line":184,"in_reply_to":"fa80f949_6cd494bc","updated":"2015-11-06 14:49:23.000000000","message":"Done","commit_id":"8ff066de4039443cef974adc2edd3b8d9807429c"},{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"02f36a2f29ba7b8ea67190c26221240c224e283f","unresolved":false,"context_lines":[{"line_number":181,"context_line":"            pass"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"        def map_for_scenario(self, scenario_context, config):"},{"line_number":184,"context_line":"            return self.value"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"    class FlavorResourceType(ResourceType):"},{"line_number":187,"context_line":"        def preprocess(self, config, context\u003dNone, clients\u003dNone):"}],"source_content_type":"text/x-rst","patch_set":4,"id":"fa80f949_2caf6ce3","line":184,"in_reply_to":"fa80f949_d7b42e36","updated":"2015-11-06 05:02:37.000000000","message":"That\u0027s the nature of inheritance. If we don\u0027t put it here, we\u0027ll just be repeating this every time in every ResourceType subclass.","commit_id":"8ff066de4039443cef974adc2edd3b8d9807429c"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"074863a882d8abce46a79ba309eb50f5ea987a62","unresolved":false,"context_lines":[{"line_number":202,"context_line":"                    self._images.setdefault(image[\"owner\"], []).append(image)"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"        def map_for_scenario(self, scenario_context, config):"},{"line_number":205,"context_line":"            if self.value:"},{"line_number":206,"context_line":"                super(ImageResourceType, self).map_for_scenario("},{"line_number":207,"context_line":"                    scenario_context, config)"},{"line_number":208,"context_line":"            else:"}],"source_content_type":"text/x-rst","patch_set":4,"id":"fa80f949_f79852c2","line":205,"updated":"2015-11-06 03:23:14.000000000","message":"doesn\u0027t look for me valid... why we need to call super method here at all. \n\nI see here already issue with implicit self.value...","commit_id":"8ff066de4039443cef974adc2edd3b8d9807429c"},{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"d83d0891ac1db38036cf1b041bda949a34f9599e","unresolved":false,"context_lines":[{"line_number":202,"context_line":"                    self._images.setdefault(image[\"owner\"], []).append(image)"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"        def map_for_scenario(self, scenario_context, config):"},{"line_number":205,"context_line":"            if self.value:"},{"line_number":206,"context_line":"                super(ImageResourceType, self).map_for_scenario("},{"line_number":207,"context_line":"                    scenario_context, config)"},{"line_number":208,"context_line":"            else:"}],"source_content_type":"text/x-rst","patch_set":4,"id":"fa80f949_3e49bd60","line":205,"in_reply_to":"fa80f949_acf59c57","updated":"2015-11-06 14:49:23.000000000","message":"I\u0027m still not sure what you find magical about this, but I\u0027ve tried to address what I think the problem might be in the new patchset. If I still haven\u0027t grokked your intentions, though, some example code of what you\u0027d like to see would really help me.","commit_id":"8ff066de4039443cef974adc2edd3b8d9807429c"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"60b1a9d4712b3b9dd3135659e90e38b43fe1aa73","unresolved":false,"context_lines":[{"line_number":202,"context_line":"                    self._images.setdefault(image[\"owner\"], []).append(image)"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"        def map_for_scenario(self, scenario_context, config):"},{"line_number":205,"context_line":"            if self.value:"},{"line_number":206,"context_line":"                super(ImageResourceType, self).map_for_scenario("},{"line_number":207,"context_line":"                    scenario_context, config)"},{"line_number":208,"context_line":"            else:"}],"source_content_type":"text/x-rst","patch_set":4,"id":"fa80f949_acf59c57","line":205,"in_reply_to":"fa80f949_ec8ba466","updated":"2015-11-06 05:45:28.000000000","message":"So I would like to avoid this affect at all. And not use self.value beacuse it adds magic without any reason...","commit_id":"8ff066de4039443cef974adc2edd3b8d9807429c"},{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"02f36a2f29ba7b8ea67190c26221240c224e283f","unresolved":false,"context_lines":[{"line_number":202,"context_line":"                    self._images.setdefault(image[\"owner\"], []).append(image)"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"        def map_for_scenario(self, scenario_context, config):"},{"line_number":205,"context_line":"            if self.value:"},{"line_number":206,"context_line":"                super(ImageResourceType, self).map_for_scenario("},{"line_number":207,"context_line":"                    scenario_context, config)"},{"line_number":208,"context_line":"            else:"}],"source_content_type":"text/x-rst","patch_set":4,"id":"fa80f949_ec8ba466","line":205,"in_reply_to":"fa80f949_f79852c2","updated":"2015-11-06 05:02:37.000000000","message":"We don\u0027t *need* to -- we could just return self.value -- but calling super uses inheritance correctly. I.e., if the parent map_for_scenario() changes, we get those changes.\n\nThis is only here to handle the case where someone passes an image ID in the scenario config, and we obviously have a single image that will apply to all iterations. Perhaps a comment to that effect would help clarify this?","commit_id":"8ff066de4039443cef974adc2edd3b8d9807429c"}]}
