)]}'
{"smaug/services/protection/plugins/protectables/volume.py":[{"author":{"_account_id":2023,"name":"Saggi Mizrahi","email":"ficoos+osreview@gmail.com","username":"ficoos"},"change_message_id":"2f249f54d61c044013ac6b1a6490dc6b550496aa","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"cinder_client_opts \u003d ["},{"line_number":26,"context_line":"    cfg.StrOpt(\u0027cinder_endpoint\u0027,"},{"line_number":27,"context_line":"               help\u003d\u0027The info of the cinder endpoint. \u0027"},{"line_number":28,"context_line":"                    \u0027Format is: separated values of the form: \u0027"},{"line_number":29,"context_line":"                    \u0027\u003cservice_type\u003e;\u003cendpoint_url\u003e;\u003cendpoint_type\u003e\u0027),"},{"line_number":30,"context_line":"    cfg.StrOpt(\u0027cinder_catalog_info\u0027,"},{"line_number":31,"context_line":"               default\u003d\u0027volumev2;cinder;publicURL\u0027,"},{"line_number":32,"context_line":"               help\u003d\u0027Info to match when looking for cinder in the service \u0027"},{"line_number":33,"context_line":"               \u0027catalog. Format is: separated values of the form: \u0027"},{"line_number":34,"context_line":"               \u0027\u003cservice_type\u003e;\u003cservice_name\u003e;\u003cendpoint_type\u003e - \u0027"},{"line_number":35,"context_line":"               \u0027Only used if cinder_endpoint is unset\u0027),"},{"line_number":36,"context_line":"]"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"cfg.CONF.register_opts(cinder_client_opts, group\u003d\u0027cinder_client\u0027)"},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7af24918_b5ef84af","line":36,"range":{"start_line":25,"start_character":0,"end_line":36,"end_character":1},"updated":"2016-03-01 15:22:44.000000000","message":"Aren\u0027t we getting this from keystone?","commit_id":"9b01301ccbacc8e21977efbb58e87d5b8f873c98"},{"author":{"_account_id":16203,"name":"zengyingzhe","email":"zengyingzhe@huawei.com","username":"zengyingzhe"},"change_message_id":"ea685a62e19136fa73a7e05de2859b6ff851b4fa","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"cinder_client_opts \u003d ["},{"line_number":26,"context_line":"    cfg.StrOpt(\u0027cinder_endpoint\u0027,"},{"line_number":27,"context_line":"               help\u003d\u0027The info of the cinder endpoint. \u0027"},{"line_number":28,"context_line":"                    \u0027Format is: separated values of the form: \u0027"},{"line_number":29,"context_line":"                    \u0027\u003cservice_type\u003e;\u003cendpoint_url\u003e;\u003cendpoint_type\u003e\u0027),"},{"line_number":30,"context_line":"    cfg.StrOpt(\u0027cinder_catalog_info\u0027,"},{"line_number":31,"context_line":"               default\u003d\u0027volumev2;cinder;publicURL\u0027,"},{"line_number":32,"context_line":"               help\u003d\u0027Info to match when looking for cinder in the service \u0027"},{"line_number":33,"context_line":"               \u0027catalog. Format is: separated values of the form: \u0027"},{"line_number":34,"context_line":"               \u0027\u003cservice_type\u003e;\u003cservice_name\u003e;\u003cendpoint_type\u003e - \u0027"},{"line_number":35,"context_line":"               \u0027Only used if cinder_endpoint is unset\u0027),"},{"line_number":36,"context_line":"]"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"cfg.CONF.register_opts(cinder_client_opts, group\u003d\u0027cinder_client\u0027)"},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7af24918_e53488fc","line":36,"range":{"start_line":25,"start_character":0,"end_line":36,"end_character":1},"in_reply_to":"7af24918_b5ef84af","updated":"2016-03-02 08:15:25.000000000","message":"The endpoint is got from keystone by default.\nThe RequestContext got an attribute service_catalog, it contains all the service endpoints info from keystone.\nAs for cinder_endpoint, it just provides a way for admin to configure explicitly.\nThis implementation refers cinder.","commit_id":"9b01301ccbacc8e21977efbb58e87d5b8f873c98"},{"author":{"_account_id":2023,"name":"Saggi Mizrahi","email":"ficoos+osreview@gmail.com","username":"ficoos"},"change_message_id":"2f249f54d61c044013ac6b1a6490dc6b550496aa","unresolved":false,"context_lines":[{"line_number":48,"context_line":"    _CLIENT_VERSIONS \u003d (_CLIENT_VERSION_1, _CLIENT_VERSION_2) \u003d (\u00271\u0027, \u00272\u0027)"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    @property"},{"line_number":51,"context_line":"    def client(self):"},{"line_number":52,"context_line":"        if not self._client:"},{"line_number":53,"context_line":"            self._client \u003d self._create()"},{"line_number":54,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7af24918_358894e7","line":51,"range":{"start_line":51,"start_character":8,"end_line":51,"end_character":14},"updated":"2016-03-01 15:22:44.000000000","message":"Is this really public?","commit_id":"9b01301ccbacc8e21977efbb58e87d5b8f873c98"},{"author":{"_account_id":16203,"name":"zengyingzhe","email":"zengyingzhe@huawei.com","username":"zengyingzhe"},"change_message_id":"ea685a62e19136fa73a7e05de2859b6ff851b4fa","unresolved":false,"context_lines":[{"line_number":48,"context_line":"    _CLIENT_VERSIONS \u003d (_CLIENT_VERSION_1, _CLIENT_VERSION_2) \u003d (\u00271\u0027, \u00272\u0027)"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    @property"},{"line_number":51,"context_line":"    def client(self):"},{"line_number":52,"context_line":"        if not self._client:"},{"line_number":53,"context_line":"            self._client \u003d self._create()"},{"line_number":54,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7af24918_c5306c04","line":51,"range":{"start_line":51,"start_character":8,"end_line":51,"end_character":14},"in_reply_to":"7af24918_358894e7","updated":"2016-03-02 08:15:25.000000000","message":"Done","commit_id":"9b01301ccbacc8e21977efbb58e87d5b8f873c98"},{"author":{"_account_id":17151,"name":"chenying","email":"chenyingko@gmail.com","username":"chenying"},"change_message_id":"c5204b4af231bf2efb3d4c62229ed652b66a6497","unresolved":false,"context_lines":[{"line_number":66,"context_line":"                    \"\u0027cinder_catalog_info\u0027, must be in the form \""},{"line_number":67,"context_line":"                    \"\u003cservice_type\u003e;\u003cservice_name\u003e;\u003cendpoint_type\u003e\"))"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"            for entry in self._context.service_catalog:"},{"line_number":70,"context_line":"                if entry.get(\u0027type\u0027) \u003d\u003d service_type:"},{"line_number":71,"context_line":"                    return (service_type,"},{"line_number":72,"context_line":"                            entry.get(\u0027endpoints\u0027)[0].get(endpoint_type),"}],"source_content_type":"text/x-python","patch_set":1,"id":"7af24918_306a3b81","line":69,"range":{"start_line":69,"start_character":39,"end_line":69,"end_character":54},"updated":"2016-03-02 02:45:10.000000000","message":"When do you init service_catalog in the _context?","commit_id":"9b01301ccbacc8e21977efbb58e87d5b8f873c98"},{"author":{"_account_id":16203,"name":"zengyingzhe","email":"zengyingzhe@huawei.com","username":"zengyingzhe"},"change_message_id":"ea685a62e19136fa73a7e05de2859b6ff851b4fa","unresolved":false,"context_lines":[{"line_number":66,"context_line":"                    \"\u0027cinder_catalog_info\u0027, must be in the form \""},{"line_number":67,"context_line":"                    \"\u003cservice_type\u003e;\u003cservice_name\u003e;\u003cendpoint_type\u003e\"))"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"            for entry in self._context.service_catalog:"},{"line_number":70,"context_line":"                if entry.get(\u0027type\u0027) \u003d\u003d service_type:"},{"line_number":71,"context_line":"                    return (service_type,"},{"line_number":72,"context_line":"                            entry.get(\u0027endpoints\u0027)[0].get(endpoint_type),"}],"source_content_type":"text/x-python","patch_set":1,"id":"7af24918_102734b7","line":69,"range":{"start_line":69,"start_character":39,"end_line":69,"end_character":54},"in_reply_to":"7af24918_306a3b81","updated":"2016-03-02 08:15:25.000000000","message":"This\u0027s initiated while RequestContext constructing.\nPlease look at auth.py","commit_id":"9b01301ccbacc8e21977efbb58e87d5b8f873c98"},{"author":{"_account_id":2023,"name":"Saggi Mizrahi","email":"ficoos+osreview@gmail.com","username":"ficoos"},"change_message_id":"2f249f54d61c044013ac6b1a6490dc6b550496aa","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        return self._SUPPORT_RESOURCE_TYPE"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def get_parent_resource_types(self):"},{"line_number":125,"context_line":"        return [\"OS::Nova::Server\", ]"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def list_resources(self):"},{"line_number":128,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":1,"id":"7af24918_7574dcce","line":125,"range":{"start_line":125,"start_character":15,"end_line":125,"end_character":37},"updated":"2016-03-01 15:22:44.000000000","message":"You can have this as class bound tuple to prevent modification and reuse the same instance.","commit_id":"9b01301ccbacc8e21977efbb58e87d5b8f873c98"},{"author":{"_account_id":16203,"name":"zengyingzhe","email":"zengyingzhe@huawei.com","username":"zengyingzhe"},"change_message_id":"ea685a62e19136fa73a7e05de2859b6ff851b4fa","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        return self._SUPPORT_RESOURCE_TYPE"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def get_parent_resource_types(self):"},{"line_number":125,"context_line":"        return [\"OS::Nova::Server\", ]"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def list_resources(self):"},{"line_number":128,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":1,"id":"7af24918_50589c32","line":125,"range":{"start_line":125,"start_character":15,"end_line":125,"end_character":37},"in_reply_to":"7af24918_7574dcce","updated":"2016-03-02 08:15:25.000000000","message":"Done","commit_id":"9b01301ccbacc8e21977efbb58e87d5b8f873c98"},{"author":{"_account_id":15069,"name":"zhonghuali","email":"lizhonghua.li@huawei.com","username":"sloblee"},"change_message_id":"c395a732de6b807ef85e686241af52684dc3c3e7","unresolved":false,"context_lines":[{"line_number":138,"context_line":"                                      id\u003dvol.id)"},{"line_number":139,"context_line":"                    for vol in volumes]"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"    def fetch_child_resources(self, parent_resource):"},{"line_number":142,"context_line":"        def _is_attached_to(vol):"},{"line_number":143,"context_line":"            return any([s.get(\u0027server_id\u0027) \u003d\u003d parent_resource.id"},{"line_number":144,"context_line":"                        for s in vol.attachments])"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aed3d3a_829c4f5e","line":141,"range":{"start_line":141,"start_character":8,"end_line":141,"end_character":29},"updated":"2016-02-29 10:16:18.000000000","message":"it\u0027s easy to misunderstand the name and what it does. from the name, it looks will return the sub-resources that belong to one volume, but from the implement, it actually return all the volumes that attached to the given server.I think it would be better update another method name or define in other way.","commit_id":"9b01301ccbacc8e21977efbb58e87d5b8f873c98"},{"author":{"_account_id":16203,"name":"zengyingzhe","email":"zengyingzhe@huawei.com","username":"zengyingzhe"},"change_message_id":"e9b7e17f7eb9c703c154518337a8b8bc75a454fb","unresolved":false,"context_lines":[{"line_number":138,"context_line":"                                      id\u003dvol.id)"},{"line_number":139,"context_line":"                    for vol in volumes]"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"    def fetch_child_resources(self, parent_resource):"},{"line_number":142,"context_line":"        def _is_attached_to(vol):"},{"line_number":143,"context_line":"            return any([s.get(\u0027server_id\u0027) \u003d\u003d parent_resource.id"},{"line_number":144,"context_line":"                        for s in vol.attachments])"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aed3d3a_bc2973e8","line":141,"range":{"start_line":141,"start_character":8,"end_line":141,"end_character":29},"in_reply_to":"9aed3d3a_829c4f5e","updated":"2016-03-01 08:47:45.000000000","message":"If it\u0027s really confusing so much, we may discuss and consider if there\u0027s a better name.","commit_id":"9b01301ccbacc8e21977efbb58e87d5b8f873c98"},{"author":{"_account_id":13070,"name":"Eran Gampel","email":"eran@gampel.net","username":"Gampel"},"change_message_id":"32024cbf216bd49811d95973c4875eef80c9a88b","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        return self._SUPPORT_RESOURCE_TYPE"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def get_parent_resource_types(self):"},{"line_number":100,"context_line":"        return (\"OS::Nova::Server\", )"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    def list_resources(self):"},{"line_number":103,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"7af24918_708ef52e","line":100,"range":{"start_line":100,"start_character":16,"end_line":100,"end_character":34},"updated":"2016-03-04 11:58:02.000000000","message":"Please consider using a const file like \nhttps://review.openstack.org/#/c/281011/5/smaug/common/constants.py","commit_id":"4b95b50f3f1aeec4b81a318ad80d39974abf112e"},{"author":{"_account_id":13070,"name":"Eran Gampel","email":"eran@gampel.net","username":"Gampel"},"change_message_id":"2be71860314ed68ce5cee2f59b8af33c8d5727ed","unresolved":false,"context_lines":[{"line_number":113,"context_line":"                                      id\u003dvol.id)"},{"line_number":114,"context_line":"                    for vol in volumes]"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    def fetch_child_resources(self, parent_resource):"},{"line_number":117,"context_line":"        def _is_attached_to(vol):"},{"line_number":118,"context_line":"            return any([s.get(\u0027server_id\u0027) \u003d\u003d parent_resource.id"},{"line_number":119,"context_line":"                        for s in vol.attachments])"}],"source_content_type":"text/x-python","patch_set":2,"id":"7af24918_96c6cb47","line":116,"range":{"start_line":116,"start_character":36,"end_line":116,"end_character":51},"updated":"2016-03-05 07:08:31.000000000","message":"I think you should check here that parent_resource is a Server \nand perform this only for that server raise an exception for non module parent hierarchy","commit_id":"4b95b50f3f1aeec4b81a318ad80d39974abf112e"},{"author":{"_account_id":19346,"name":"yinwei","email":"yinweiishere@icloud.com","username":"yinwei"},"change_message_id":"9f7b155984918283eb8a44a754db069a20e06759","unresolved":false,"context_lines":[{"line_number":127,"context_line":"                type\u003dself._SUPPORT_RESOURCE_TYPE,"},{"line_number":128,"context_line":"                reason\u003dsix.text_type(e))"},{"line_number":129,"context_line":"        else:"},{"line_number":130,"context_line":"            return [resource.Resource(type\u003dself._SUPPORT_RESOURCE_TYPE,"},{"line_number":131,"context_line":"                                      id\u003dvol.id)"},{"line_number":132,"context_line":"                    for vol in volumes if _is_attached_to(vol)]"}],"source_content_type":"text/x-python","patch_set":2,"id":"7af24918_e91cd36b","line":130,"updated":"2016-03-04 01:08:00.000000000","message":"Does this mean the volumes attached to the same server of current volume become the child resources of this volume? \nIt sounds weird to me. They should be siblings instead of children, right?","commit_id":"4b95b50f3f1aeec4b81a318ad80d39974abf112e"},{"author":{"_account_id":16203,"name":"zengyingzhe","email":"zengyingzhe@huawei.com","username":"zengyingzhe"},"change_message_id":"5e04f792e9bf2d310c2e75dae9deae8d38a6c972","unresolved":false,"context_lines":[{"line_number":127,"context_line":"                type\u003dself._SUPPORT_RESOURCE_TYPE,"},{"line_number":128,"context_line":"                reason\u003dsix.text_type(e))"},{"line_number":129,"context_line":"        else:"},{"line_number":130,"context_line":"            return [resource.Resource(type\u003dself._SUPPORT_RESOURCE_TYPE,"},{"line_number":131,"context_line":"                                      id\u003dvol.id)"},{"line_number":132,"context_line":"                    for vol in volumes if _is_attached_to(vol)]"}],"source_content_type":"text/x-python","patch_set":2,"id":"7af24918_5bd30e60","line":130,"in_reply_to":"7af24918_e91cd36b","updated":"2016-03-04 01:55:12.000000000","message":"The parent_resource is a resource of type listed in get_parent_resource_types, so as to this volume plugin, the parent_resource here should be an OS::Nova::Server resource.\nSo that what fetch_child_resources here returns, are the volume list which attached to the given parent nova server.\nDoes it make sense to you?\nAnd you could check the implementation of fetch_dependent_resources method from patch https://review.openstack.org/#/c/281783/8/smaug/services/protection/protectable_registry.py.\nIt might help you to understand.","commit_id":"4b95b50f3f1aeec4b81a318ad80d39974abf112e"}],"smaug/services/protection/protectable_plugin.py":[{"author":{"_account_id":2023,"name":"Saggi Mizrahi","email":"ficoos+osreview@gmail.com","username":"ficoos"},"change_message_id":"2f249f54d61c044013ac6b1a6490dc6b550496aa","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":"    \"\"\""},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"    def __init__(self, context\u003dNone):"},{"line_number":24,"context_line":"        self._context \u003d context"},{"line_number":25,"context_line":"        self._client \u003d None"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    def instance(self, context):"},{"line_number":28,"context_line":"        return self.__class__(context)"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    @abc.abstractmethod"},{"line_number":31,"context_line":"    def get_resource_type(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"7af24918_a05f400d","line":28,"range":{"start_line":23,"start_character":0,"end_line":28,"end_character":38},"updated":"2016-03-01 15:22:44.000000000","message":"What is this for?","commit_id":"9b01301ccbacc8e21977efbb58e87d5b8f873c98"},{"author":{"_account_id":15069,"name":"zhonghuali","email":"lizhonghua.li@huawei.com","username":"sloblee"},"change_message_id":"c395a732de6b807ef85e686241af52684dc3c3e7","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        pass"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    @abc.abstractmethod"},{"line_number":55,"context_line":"    def fetch_child_resources(self, parent_resource):"},{"line_number":56,"context_line":"        \"\"\"List child resources of resource_type under given parent resource."},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"        :param parent_resource: The parent resource to list child resources."}],"source_content_type":"text/x-python","patch_set":1,"id":"9aed3d3a_c20bf728","line":55,"range":{"start_line":55,"start_character":8,"end_line":55,"end_character":29},"updated":"2016-02-29 10:16:18.000000000","message":"I wonder how to control the dependency between each resource type. take an example: I create a server plugin instance, and call this method by giving a server resource. it will lastly return None because of my incorrect usage.but I really want to know the sub-resources of the server.","commit_id":"9b01301ccbacc8e21977efbb58e87d5b8f873c98"},{"author":{"_account_id":16203,"name":"zengyingzhe","email":"zengyingzhe@huawei.com","username":"zengyingzhe"},"change_message_id":"e9b7e17f7eb9c703c154518337a8b8bc75a454fb","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        pass"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    @abc.abstractmethod"},{"line_number":55,"context_line":"    def fetch_child_resources(self, parent_resource):"},{"line_number":56,"context_line":"        \"\"\"List child resources of resource_type under given parent resource."},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"        :param parent_resource: The parent resource to list child resources."}],"source_content_type":"text/x-python","patch_set":1,"id":"9aed3d3a_1c0a1f8a","line":55,"range":{"start_line":55,"start_character":8,"end_line":55,"end_character":29},"in_reply_to":"9aed3d3a_c20bf728","updated":"2016-03-01 08:47:45.000000000","message":"Please look at the fetch_dependent_resources method from another patch. https://review.openstack.org/#/c/281783/7/smaug/services/protection/protectable_registry.py\nI guess it could answer your question.","commit_id":"9b01301ccbacc8e21977efbb58e87d5b8f873c98"}],"smaug/services/protection/protectable_plugins/volume.py":[{"author":{"_account_id":13070,"name":"Eran Gampel","email":"eran@gampel.net","username":"Gampel"},"change_message_id":"73f7ca07df3b1c2c74cc42b17f3fe8c9eb82bf95","unresolved":false,"context_lines":[{"line_number":114,"context_line":"                                      id\u003dvol.id)"},{"line_number":115,"context_line":"                    for vol in volumes]"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def fetch_child_resources(self, parent_resource):"},{"line_number":118,"context_line":"        def _is_attached_to(vol):"},{"line_number":119,"context_line":"            return any([s.get(\u0027server_id\u0027) \u003d\u003d parent_resource.id"},{"line_number":120,"context_line":"                        for s in vol.attachments])"}],"source_content_type":"text/x-python","patch_set":3,"id":"5aef4532_5a452215","line":117,"range":{"start_line":117,"start_character":8,"end_line":117,"end_character":29},"updated":"2016-03-09 08:50:55.000000000","message":"Please change the name","commit_id":"aabd3cfc207980938f183f39ff756fdfa6e734e6"},{"author":{"_account_id":19346,"name":"yinwei","email":"yinweiishere@icloud.com","username":"yinwei"},"change_message_id":"2325f6f57086c2c9dd5d10c6718e9ef7ba3ba5e7","unresolved":false,"context_lines":[{"line_number":120,"context_line":"                        for s in vol.attachments])"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"        try:"},{"line_number":123,"context_line":"            volumes \u003d self._client.volumes.list(detailed\u003dTrue)"},{"line_number":124,"context_line":"        except Exception as e:"},{"line_number":125,"context_line":"            LOG.exception(_LE(\"List all detailed volumes \""},{"line_number":126,"context_line":"                              \"from cinder failed.\"))"}],"source_content_type":"text/x-python","patch_set":3,"id":"5aef4532_06afc981","line":123,"updated":"2016-03-09 07:24:38.000000000","message":"Sorry, I still have question for this lay out of protectables.  \nIf get_child_resources returns resources of its parent type, it means actually each resource type needs understand its parent type resource.\nTake image as eg would be more clear, if the parent is a server, from image\u0027s metadata, you couldn\u0027t tell which server depends on it.  But from server\u0027s metadata, you know the volumes and images the server depends on.\nWhat I suggest is to adjust the layout:\n1. add a protectable named as project;\n2. each get_child_resources return child resources of this resource type instead of the parent resource type.","commit_id":"aabd3cfc207980938f183f39ff756fdfa6e734e6"},{"author":{"_account_id":13070,"name":"Eran Gampel","email":"eran@gampel.net","username":"Gampel"},"change_message_id":"ad1110d9a83a3fada23a54e6b9ebb878362d953c","unresolved":false,"context_lines":[{"line_number":120,"context_line":"                        for s in vol.attachments])"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"        try:"},{"line_number":123,"context_line":"            volumes \u003d self._client.volumes.list(detailed\u003dTrue)"},{"line_number":124,"context_line":"        except Exception as e:"},{"line_number":125,"context_line":"            LOG.exception(_LE(\"List all detailed volumes \""},{"line_number":126,"context_line":"                              \"from cinder failed.\"))"}],"source_content_type":"text/x-python","patch_set":3,"id":"5aef4532_a4fecd35","line":123,"in_reply_to":"5aef4532_06afc981","updated":"2016-03-09 08:25:10.000000000","message":"We discuss this yesterday at the meeting \nI agree that the name is confusing and we decided on a different name  \nget_dependent_resources( partnt_resource)\nBut for the direction we need to define who knows parent about the children or children about there parents  and saggi an i had allot of discussion about it.\n\nOur conclusion was that Parent should know who are is possible children types. and define a protectable for resource that allways return only its resource type info via list or if we provide a parent resource to get the dependent that.\nWe think that in this way when we introduce new resources we will be less likely to change other resources plugins protactabole.\n\nI hope this make sense if not we can discuss it on IRC","commit_id":"aabd3cfc207980938f183f39ff756fdfa6e734e6"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"e8dcb27dca085e80b68578307ae2f57a02511ea9","unresolved":false,"context_lines":[{"line_number":24,"context_line":""},{"line_number":25,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"cinder_client_opts \u003d ["},{"line_number":28,"context_line":"    cfg.StrOpt(\u0027cinder_endpoint\u0027,"},{"line_number":29,"context_line":"               help\u003d\u0027The info of the cinder endpoint. \u0027"},{"line_number":30,"context_line":"                    \u0027Format is: separated values of the form: \u0027"},{"line_number":31,"context_line":"                    \u0027\u003cservice_type\u003e;\u003cendpoint_url\u003e;\u003cendpoint_type\u003e\u0027),"},{"line_number":32,"context_line":"    cfg.StrOpt(\u0027cinder_catalog_info\u0027,"},{"line_number":33,"context_line":"               default\u003d\u0027volumev2;cinder;publicURL\u0027,"},{"line_number":34,"context_line":"               help\u003d\u0027Info to match when looking for cinder in the service \u0027"},{"line_number":35,"context_line":"               \u0027catalog. Format is: separated values of the form: \u0027"},{"line_number":36,"context_line":"               \u0027\u003cservice_type\u003e;\u003cservice_name\u003e;\u003cendpoint_type\u003e - \u0027"},{"line_number":37,"context_line":"               \u0027Only used if cinder_endpoint is unset\u0027),"},{"line_number":38,"context_line":"]"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"cfg.CONF.register_opts(cinder_client_opts, group\u003d\u0027cinder_client\u0027)"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"class VolumeProtectablePlugin(protectable_plugin.ProtectablePlugin):"}],"source_content_type":"text/x-python","patch_set":5,"id":"5aef4532_ba6dfdcd","line":40,"range":{"start_line":27,"start_character":0,"end_line":40,"end_character":65},"updated":"2016-03-10 08:16:20.000000000","message":"Move cinder client configuration to a common client configuration location.\nAlso, seems like the convention is to use \u0027:\u0027 as a delimiter, and not \u0027;\u0027.","commit_id":"4b10343f88eee30109b8da130ce9e407bdf2aed0"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"e8dcb27dca085e80b68578307ae2f57a02511ea9","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    \"\"\""},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    _SUPPORT_RESOURCE_TYPE \u003d constants.VOLUME_RESOURCE_TYPE"},{"line_number":49,"context_line":"    _SERVICE_TYPES \u003d (_VOLUME, _VOLUME_V2) \u003d (\u0027volume\u0027, \u0027volumev2\u0027)"},{"line_number":50,"context_line":"    _CLIENT_VERSIONS \u003d (_CLIENT_VERSION_1, _CLIENT_VERSION_2) \u003d (\u00271\u0027, \u00272\u0027)"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    @property"},{"line_number":53,"context_line":"    def _client(self):"},{"line_number":54,"context_line":"        if not self._client_instance:"},{"line_number":55,"context_line":"            self._client_instance \u003d self._create()"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"        return self._client_instance"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def _get_url(self):"},{"line_number":60,"context_line":"        \u0027\u0027\u0027Return the url of cinder endpoint.\u0027\u0027\u0027"},{"line_number":61,"context_line":"        if cfg.CONF.cinder_client.cinder_endpoint is None:"},{"line_number":62,"context_line":"            return utils.parse_service_catalog_info("},{"line_number":63,"context_line":"                \u0027cinder_catalog_info\u0027,"},{"line_number":64,"context_line":"                cfg.CONF.cinder_client.cinder_catalog_info,"},{"line_number":65,"context_line":"                self._context.service_catalog"},{"line_number":66,"context_line":"            )"},{"line_number":67,"context_line":"        else:"},{"line_number":68,"context_line":"            return utils.parse_service_endpoint("},{"line_number":69,"context_line":"                \u0027cinder_endpoint\u0027,"},{"line_number":70,"context_line":"                cfg.CONF.cinder_client.cinder_endpoint,"},{"line_number":71,"context_line":"                self._context.project_id"},{"line_number":72,"context_line":"            )"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def _create(self):"},{"line_number":75,"context_line":"        try:"},{"line_number":76,"context_line":"            service_type, url, endpoint_type \u003d self._get_url()"},{"line_number":77,"context_line":"        except Exception:"},{"line_number":78,"context_line":"            LOG.error(_LE(\"Get cinder service endpoint url failed.\"))"},{"line_number":79,"context_line":"            raise"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"        LOG.info(_LI(\u0027Creating cinder client with url %s.\u0027), url)"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"        client_version \u003d (self._CLIENT_VERSION_2"},{"line_number":84,"context_line":"                          if service_type \u003d\u003d self._VOLUME_V2"},{"line_number":85,"context_line":"                          else self._CLIENT_VERSION_1)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"        args \u003d {"},{"line_number":88,"context_line":"            \u0027project_id\u0027: self._context.project_id,"},{"line_number":89,"context_line":"        }"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"        client \u003d cc.Client(client_version, **args)"},{"line_number":92,"context_line":"        client.client.auth_token \u003d self._context.auth_token"},{"line_number":93,"context_line":"        client.client.management_url \u003d url"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"        return client"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    def get_resource_type(self):"},{"line_number":98,"context_line":"        return self._SUPPORT_RESOURCE_TYPE"}],"source_content_type":"text/x-python","patch_set":5,"id":"5aef4532_3a1a8d17","line":95,"range":{"start_line":49,"start_character":0,"end_line":95,"end_character":21},"updated":"2016-03-10 08:16:20.000000000","message":"Move the client creation to a common location (for use in other protectable or protection plug-ins","commit_id":"4b10343f88eee30109b8da130ce9e407bdf2aed0"}],"smaug/services/protection/utils.py":[{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"e8dcb27dca085e80b68578307ae2f57a02511ea9","unresolved":false,"context_lines":[{"line_number":28,"context_line":"    except ValueError:"},{"line_number":29,"context_line":"        msg \u003d _(\"Failed to parse the configuration option %s, \""},{"line_number":30,"context_line":"                \"must be in the form: \""},{"line_number":31,"context_line":"                \"\u003cservice_type\u003e;\u003cservice_name\u003e;\u003cendpoint_type\u003e\") % name"},{"line_number":32,"context_line":"        raise exception.SmaugException(msg)"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    for entry in service_catalog:"}],"source_content_type":"text/x-python","patch_set":5,"id":"5aef4532_9a3da1df","line":31,"range":{"start_line":31,"start_character":0,"end_line":31,"end_character":71},"updated":"2016-03-10 08:16:20.000000000","message":"Seems like the convention is to use \u0027:\u0027 as a delimiter, and not \u0027;\u0027.","commit_id":"4b10343f88eee30109b8da130ce9e407bdf2aed0"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"e8dcb27dca085e80b68578307ae2f57a02511ea9","unresolved":false,"context_lines":[{"line_number":48,"context_line":"    except ValueError:"},{"line_number":49,"context_line":"        msg \u003d _(\"Failed to parse the configuration option %s, \""},{"line_number":50,"context_line":"                \"must be in the form: \""},{"line_number":51,"context_line":"                \"\u003cservice_type\u003e;\u003cendpoint_url\u003e;\u003cendpoint_type\u003e\") % name"},{"line_number":52,"context_line":"        raise exception.SmaugException(msg)"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    return (service_type,"}],"source_content_type":"text/x-python","patch_set":5,"id":"5aef4532_9a14814d","line":51,"range":{"start_line":51,"start_character":0,"end_line":51,"end_character":71},"updated":"2016-03-10 08:16:20.000000000","message":"Seems like the convention is to use \u0027:\u0027 as a delimiter, and not \u0027;\u0027.","commit_id":"4b10343f88eee30109b8da130ce9e407bdf2aed0"}]}
