)]}'
{"contrib/barbican/barbican/resources/order.py":[{"author":{"_account_id":9542,"name":"Pavlo Shchelokovskyy","email":"pshchelokovskyy@mirantis.com","username":"pshchelo"},"change_message_id":"fee2d7b68f823ac6fa7b86f445a4d293c76a42e0","unresolved":false,"context_lines":[{"line_number":61,"context_line":"            properties.Schema.NUMBER,"},{"line_number":62,"context_line":"            _(\u0027The bit-length of the secret.\u0027),"},{"line_number":63,"context_line":"            constraints\u003d["},{"line_number":64,"context_line":"                constraints.Range(min\u003d1),"},{"line_number":65,"context_line":"            ],"},{"line_number":66,"context_line":"        ),"},{"line_number":67,"context_line":"        MODE: properties.Schema("}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAWH%2F%2B9YU%3D","line":64,"updated":"2014-03-21 11:40:56.000000000","message":"according to docs https://github.com/cloudkeep/barbican/wiki/Release-Notes :\n\n\"Only 128, 192 or 256 are supported\", so you should add this as a constraint","commit_id":"6ba048e8ec70dea0dde5f73b917209bcc10855f0"},{"author":{"_account_id":9542,"name":"Pavlo Shchelokovskyy","email":"pshchelokovskyy@mirantis.com","username":"pshchelo"},"change_message_id":"fee2d7b68f823ac6fa7b86f445a4d293c76a42e0","unresolved":false,"context_lines":[{"line_number":92,"context_line":"            (prop, self.properties.get(prop))"},{"line_number":93,"context_line":"            for prop in self.PROPERTIES"},{"line_number":94,"context_line":"        )"},{"line_number":95,"context_line":"        order_ref \u003d self.client.barbican().orders.create(**info)"},{"line_number":96,"context_line":"        self.resource_id_set(order_ref)"},{"line_number":97,"context_line":"        return order_ref"},{"line_number":98,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAWH%2F%2B9Uk%3D","line":95,"updated":"2014-03-21 11:40:56.000000000","message":"this might fail for some reason, for example wrong date format for expiration that is currently not enforced by the template.","commit_id":"6ba048e8ec70dea0dde5f73b917209bcc10855f0"},{"author":{"_account_id":8289,"name":"huangtianhua","email":"tiantian223@163.com","username":"huangtianhua"},"change_message_id":"9a6bf426e03c59cd7b8c0cedbf4439737e826f29","unresolved":false,"context_lines":[{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    def check_create_complete(self, order_href):"},{"line_number":104,"context_line":"        order \u003d self.client.barbican().orders.get(order_href)"},{"line_number":105,"context_line":"        return order.status \u003d\u003d \u0027ACTIVE\u0027"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    def handle_delete(self):"},{"line_number":108,"context_line":"        if not self.resource_id:"}],"source_content_type":"text/x-python","patch_set":9,"id":"7adec928_8e1ef961","line":105,"updated":"2014-05-14 03:14:34.000000000","message":"Is there has \"Error\" status, if the status is \"Error\" stop to check it.","commit_id":"08d1d7a05b7463caff4f88bdb9cebc9bdf2f6fb4"},{"author":{"_account_id":8289,"name":"huangtianhua","email":"tiantian223@163.com","username":"huangtianhua"},"change_message_id":"9a6bf426e03c59cd7b8c0cedbf4439737e826f29","unresolved":false,"context_lines":[{"line_number":120,"context_line":"                raise"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"    def _resolve_attribute(self, name):"},{"line_number":123,"context_line":"        order \u003d self.client.barbican().orders.get(self.resource_id)"},{"line_number":124,"context_line":"        if name \u003d\u003d \u0027order_ref\u0027:"},{"line_number":125,"context_line":"            return order.order_ref"},{"line_number":126,"context_line":"        if name \u003d\u003d \u0027secret_ref\u0027:"}],"source_content_type":"text/x-python","patch_set":9,"id":"7adec928_ae19f57a","line":123,"updated":"2014-05-14 03:14:34.000000000","message":"How about there is no order with the self.resource_id, may be the exception raises?","commit_id":"08d1d7a05b7463caff4f88bdb9cebc9bdf2f6fb4"},{"author":{"_account_id":6577,"name":"Sergey Kraynev","email":"sergejyit@gmail.com","username":"skraynev"},"change_message_id":"6e6afdcf568873e6fdc9de784ae6a86fe27f3416","unresolved":false,"context_lines":[{"line_number":93,"context_line":"        \u0027status\u0027: _(\u0027The status of the order\u0027),"},{"line_number":94,"context_line":"        \u0027order_ref\u0027: _(\u0027The URI to the order\u0027),"},{"line_number":95,"context_line":"        \u0027secret_ref\u0027: _(\u0027The URI to the created secret\u0027),"},{"line_number":96,"context_line":"    }"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    def __init__(self, name, json_snippet, stack):"},{"line_number":99,"context_line":"        super(Order, self).__init__(name, json_snippet, stack)"}],"source_content_type":"text/x-python","patch_set":11,"id":"7adec928_2d0fe4e2","line":96,"updated":"2014-05-22 09:17:55.000000000","message":"Please use new schema for definition attributes.\nDetails here [1], [2].\n\n[1] https://review.openstack.org/#/c/89332/\n\n[2] https://review.openstack.org/#/c/89331/","commit_id":"5aefe148ef90aca3048e42e766bcbfa7f21285ca"},{"author":{"_account_id":8289,"name":"huangtianhua","email":"tiantian223@163.com","username":"huangtianhua"},"change_message_id":"156e2be71e3caea36b493b7b8421c83f416e81bd","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        if order.status \u003d\u003d \u0027ERROR\u0027:"},{"line_number":112,"context_line":"            reason \u003d order.error_reason"},{"line_number":113,"context_line":"            code \u003d order.error_status_code"},{"line_number":114,"context_line":"            msg \u003d (_(\"Order \u0027%(name)s\u0027 failed: %(code)s - %(reason)s\")"},{"line_number":115,"context_line":"                   % {\u0027name\u0027: self.name, \u0027code\u0027: code, \u0027reason\u0027: reason})"},{"line_number":116,"context_line":"            raise exception.Error(msg)"},{"line_number":117,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"7adec928_0bc5a53c","line":114,"updated":"2014-05-22 15:36:30.000000000","message":"may be add the action \"create\" is better:\n\"Order \u0027%(name)s\u0027 create failed: %(code)s - %(reason)s\"","commit_id":"5aefe148ef90aca3048e42e766bcbfa7f21285ca"},{"author":{"_account_id":9189,"name":"Anderson Mesquita","email":"andersonvom@gmail.com","username":"andersonvom"},"change_message_id":"d6daf85dbb14181ee7b794a148d9570486af2cf7","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        if order.status \u003d\u003d \u0027ERROR\u0027:"},{"line_number":112,"context_line":"            reason \u003d order.error_reason"},{"line_number":113,"context_line":"            code \u003d order.error_status_code"},{"line_number":114,"context_line":"            msg \u003d (_(\"Order \u0027%(name)s\u0027 failed: %(code)s - %(reason)s\")"},{"line_number":115,"context_line":"                   % {\u0027name\u0027: self.name, \u0027code\u0027: code, \u0027reason\u0027: reason})"},{"line_number":116,"context_line":"            raise exception.Error(msg)"},{"line_number":117,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"3ae8d1ca_0ef962c8","line":114,"in_reply_to":"7adec928_0bc5a53c","updated":"2014-05-28 18:49:07.000000000","message":"I don\u0027t think there\u0027s a need for that since the status of both the stack and the resource will be CREATE_FAILED.  It would just make the message more verbose with not a lot of value.","commit_id":"5aefe148ef90aca3048e42e766bcbfa7f21285ca"},{"author":{"_account_id":6577,"name":"Sergey Kraynev","email":"sergejyit@gmail.com","username":"skraynev"},"change_message_id":"e1089dad99f6bc778b7b4d18547373fdca377a94","unresolved":false,"context_lines":[{"line_number":140,"context_line":"                        {\u0027name\u0027: self.resource_id, \u0027exc\u0027: str(exc)})"},{"line_number":141,"context_line":"            return \u0027\u0027"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"        if name \u003d\u003d \u0027order_ref\u0027:"},{"line_number":144,"context_line":"            return order.order_ref"},{"line_number":145,"context_line":"        if name \u003d\u003d \u0027secret_ref\u0027:"},{"line_number":146,"context_line":"            return order.secret_ref"}],"source_content_type":"text/x-python","patch_set":11,"id":"7adec928_c7983b6d","line":143,"updated":"2014-05-21 12:18:30.000000000","message":"Also you could use same approach such as for verification resource. I mean getattr.","commit_id":"5aefe148ef90aca3048e42e766bcbfa7f21285ca"},{"author":{"_account_id":6577,"name":"Sergey Kraynev","email":"sergejyit@gmail.com","username":"skraynev"},"change_message_id":"96f91da1acdcfe302ca73ae43d5b0127c90cb52c","unresolved":false,"context_lines":[{"line_number":21,"context_line":"from .. import clients  # noqa"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"logger \u003d logging.getLogger(__name__)"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"class Order(resource.Resource):"}],"source_content_type":"text/x-python","patch_set":12,"id":"1ae5cdf2_33e4d33a","line":24,"updated":"2014-05-30 06:54:34.000000000","message":"you should use LOG instead of logger","commit_id":"03c62a7cf8fc450e89ab0d36ec86a55ccd461fde"},{"author":{"_account_id":9189,"name":"Anderson Mesquita","email":"andersonvom@gmail.com","username":"andersonvom"},"change_message_id":"1dd7c59874c355c90cd7f3edcaffdc7762e479cb","unresolved":false,"context_lines":[{"line_number":21,"context_line":"from .. import clients  # noqa"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"logger \u003d logging.getLogger(__name__)"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"class Order(resource.Resource):"}],"source_content_type":"text/x-python","patch_set":12,"id":"1ae5cdf2_16209b48","line":24,"in_reply_to":"1ae5cdf2_33e4d33a","updated":"2014-05-30 12:58:26.000000000","message":"Done","commit_id":"03c62a7cf8fc450e89ab0d36ec86a55ccd461fde"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"c7872d1e640c8b16bfc6971bc793780578ba37c1","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        ALGORITHM: properties.Schema("},{"line_number":66,"context_line":"            properties.Schema.STRING,"},{"line_number":67,"context_line":"            _(\u0027The algorithm type used to generate the secret.\u0027),"},{"line_number":68,"context_line":"            default\u003d\u0027aes\u0027,"},{"line_number":69,"context_line":"            constraints\u003d["},{"line_number":70,"context_line":"                constraints.AllowedValues(["},{"line_number":71,"context_line":"                    \u0027aes\u0027,"}],"source_content_type":"text/x-python","patch_set":12,"id":"3ae8d1ca_4cac40ee","line":68,"updated":"2014-05-28 05:02:14.000000000","message":"Change 79355 (Add OS:Barbican:Secret resource) doesn\u0027t specify a default for this field. I like the idea of having defaults, so I side with your change.","commit_id":"03c62a7cf8fc450e89ab0d36ec86a55ccd461fde"},{"author":{"_account_id":9189,"name":"Anderson Mesquita","email":"andersonvom@gmail.com","username":"andersonvom"},"change_message_id":"1dd7c59874c355c90cd7f3edcaffdc7762e479cb","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        ALGORITHM: properties.Schema("},{"line_number":66,"context_line":"            properties.Schema.STRING,"},{"line_number":67,"context_line":"            _(\u0027The algorithm type used to generate the secret.\u0027),"},{"line_number":68,"context_line":"            default\u003d\u0027aes\u0027,"},{"line_number":69,"context_line":"            constraints\u003d["},{"line_number":70,"context_line":"                constraints.AllowedValues(["},{"line_number":71,"context_line":"                    \u0027aes\u0027,"}],"source_content_type":"text/x-python","patch_set":12,"id":"1ae5cdf2_16e7bb13","line":68,"in_reply_to":"3ae8d1ca_4cac40ee","updated":"2014-05-30 12:58:26.000000000","message":"See thread below.","commit_id":"03c62a7cf8fc450e89ab0d36ec86a55ccd461fde"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"c7872d1e640c8b16bfc6971bc793780578ba37c1","unresolved":false,"context_lines":[{"line_number":87,"context_line":"            properties.Schema.STRING,"},{"line_number":88,"context_line":"            _(\u0027The type/mode of the algorithm associated with the secret \u0027"},{"line_number":89,"context_line":"              \u0027information.\u0027),"},{"line_number":90,"context_line":"            default\u003d\u0027cbc\u0027,"},{"line_number":91,"context_line":"            constraints\u003d["},{"line_number":92,"context_line":"                constraints.AllowedValues(["},{"line_number":93,"context_line":"                    \u0027cbc\u0027,"}],"source_content_type":"text/x-python","patch_set":12,"id":"3ae8d1ca_2cdd3471","line":90,"updated":"2014-05-28 05:02:14.000000000","message":"As with above change 79355 (Add OS:Barbican:Secret resource) doesn\u0027t specify a default for this field. \n\nI think it\u0027s important that all Barbican resources behave the same, so I\u0027d like both resources to either supply a default or not, so end users don\u0027t experience any inconsistencies. \n\nLike I mentioned above, I like to make is as simple for a user to use, so I like the idea of defaults, so I\u0027d side with your change. But I think a discussion has to be had between to two of you.","commit_id":"03c62a7cf8fc450e89ab0d36ec86a55ccd461fde"},{"author":{"_account_id":9189,"name":"Anderson Mesquita","email":"andersonvom@gmail.com","username":"andersonvom"},"change_message_id":"1dd7c59874c355c90cd7f3edcaffdc7762e479cb","unresolved":false,"context_lines":[{"line_number":87,"context_line":"            properties.Schema.STRING,"},{"line_number":88,"context_line":"            _(\u0027The type/mode of the algorithm associated with the secret \u0027"},{"line_number":89,"context_line":"              \u0027information.\u0027),"},{"line_number":90,"context_line":"            default\u003d\u0027cbc\u0027,"},{"line_number":91,"context_line":"            constraints\u003d["},{"line_number":92,"context_line":"                constraints.AllowedValues(["},{"line_number":93,"context_line":"                    \u0027cbc\u0027,"}],"source_content_type":"text/x-python","patch_set":12,"id":"1ae5cdf2_b687e760","line":90,"in_reply_to":"1ae5cdf2_b3bb8371","updated":"2014-05-30 12:58:26.000000000","message":"I agree with Sergey in that we shouldn\u0027t remove properties just because they take a single value.  It will make the Heat resource mimic the Barbican resource in a better way.  Like Randall said before, we shouldn\u0027t be in the business of fixing other people\u0027s APIs.  If that\u0027s how their API works, that\u0027s how we should implement it, IMO.\n\nAs for these parameters being optional, I think people are mixing things up.  They are all described in their API page (https://github.com/cloudkeep/barbican/wiki/Application-Programming-Interface) and they behave differently for different barbican resources.\n\nSecret parameters ARE almost ALL optional.  Order parameters ARE NOT.  This is what\u0027s been causing the confusion with folks reviewing these patches.\n\nFrom the Barbican API page:\n\n    Where the elements of the `secret` element match those of the `secret` POST\n    request above, but without the `payload` attributes. Note however that\n    unlike with the `secrets` resource, the `algorithm`, `bit_length` and\n    `mode` attributes are validated, to ensure that a secret can be generated\n    per these specifications. The Release Notes detail which secret types can\n    be generated by Barbican.","commit_id":"03c62a7cf8fc450e89ab0d36ec86a55ccd461fde"},{"author":{"_account_id":9189,"name":"Anderson Mesquita","email":"andersonvom@gmail.com","username":"andersonvom"},"change_message_id":"d000095785e8ae76ca7530eb8f2a0006147c0ff3","unresolved":false,"context_lines":[{"line_number":87,"context_line":"            properties.Schema.STRING,"},{"line_number":88,"context_line":"            _(\u0027The type/mode of the algorithm associated with the secret \u0027"},{"line_number":89,"context_line":"              \u0027information.\u0027),"},{"line_number":90,"context_line":"            default\u003d\u0027cbc\u0027,"},{"line_number":91,"context_line":"            constraints\u003d["},{"line_number":92,"context_line":"                constraints.AllowedValues(["},{"line_number":93,"context_line":"                    \u0027cbc\u0027,"}],"source_content_type":"text/x-python","patch_set":12,"id":"3ae8d1ca_b1841fd5","line":90,"in_reply_to":"3ae8d1ca_2cdd3471","updated":"2014-05-28 18:41:13.000000000","message":"While I do like the idea of having sensible defaults, I think there\u0027s a\nfundamental difference between these two.\n\nA \"Secret\" resource is just a placeholder for an existing secret a user may\nhave.  That is, the user already has something they consider a secret (possibly\ngenerated using ANY method: rot13, aes, substitution cyphers, sha1, etc).  IMO,\nit doesn\u0027t make a lot of sense to assume any defaults for the user since they\ncan use ANYTHING.  Furthermore, this value is not validated in any way by\nbarbican.  Their values are informational only and optional.\n\nAn \"Order\" resource on the other hand will generate a new secret for the user\nand only supports a specific algorithm/mode.  The only reason I\u0027m defaulting it\nto something is because there is only a single possible value for that\nparameter.  When it starts supporting more than one, IMO we should change the\nresource to remove the default, since it could be seen as a security risk.\n\nThat said, I think it makes sense that these resources behave differently in terms of the default values their parameters will have.","commit_id":"03c62a7cf8fc450e89ab0d36ec86a55ccd461fde"},{"author":{"_account_id":6577,"name":"Sergey Kraynev","email":"sergejyit@gmail.com","username":"skraynev"},"change_message_id":"96f91da1acdcfe302ca73ae43d5b0127c90cb52c","unresolved":false,"context_lines":[{"line_number":87,"context_line":"            properties.Schema.STRING,"},{"line_number":88,"context_line":"            _(\u0027The type/mode of the algorithm associated with the secret \u0027"},{"line_number":89,"context_line":"              \u0027information.\u0027),"},{"line_number":90,"context_line":"            default\u003d\u0027cbc\u0027,"},{"line_number":91,"context_line":"            constraints\u003d["},{"line_number":92,"context_line":"                constraints.AllowedValues(["},{"line_number":93,"context_line":"                    \u0027cbc\u0027,"}],"source_content_type":"text/x-python","patch_set":12,"id":"1ae5cdf2_b3bb8371","line":90,"in_reply_to":"3ae8d1ca_a035a7f8","updated":"2014-05-30 06:54:34.000000000","message":"Randall, thank you for the email to barbican team, I believe, that their opinion will help us with this problem too.\nI am not sure, that properties with one allow value and default should be deleted. IMO, we should have consistent model of resource. I agree, that it looks strange to have property, that do nothing, but it\u0027s reality. If it is presented in API, it should be.\n\nOther question is about using default if you have one allow value.\nAccording to documentation in BP most of properties are optional, and have not default values and passed to barbican client as None. I think, that in this case using default in property schema is redundant and should be removed.\nWhen you use default value it means, that heat pass it to client. However, when client always get this parameter it became not optional.","commit_id":"03c62a7cf8fc450e89ab0d36ec86a55ccd461fde"},{"author":{"_account_id":7256,"name":"Randall Burt","email":"randall.burt@rackspace.com","username":"randall-burt"},"change_message_id":"87c70634af4f7cac85444291f09a1c746f748a96","unresolved":false,"context_lines":[{"line_number":87,"context_line":"            properties.Schema.STRING,"},{"line_number":88,"context_line":"            _(\u0027The type/mode of the algorithm associated with the secret \u0027"},{"line_number":89,"context_line":"              \u0027information.\u0027),"},{"line_number":90,"context_line":"            default\u003d\u0027cbc\u0027,"},{"line_number":91,"context_line":"            constraints\u003d["},{"line_number":92,"context_line":"                constraints.AllowedValues(["},{"line_number":93,"context_line":"                    \u0027cbc\u0027,"}],"source_content_type":"text/x-python","patch_set":12,"id":"3ae8d1ca_a035a7f8","line":90,"in_reply_to":"3ae8d1ca_b1841fd5","updated":"2014-05-28 20:43:38.000000000","message":"Actually, if this schema is \"correct\" and there\u0027s only one allowed value, then this property should go away entirely since the template author doesn\u0027t have any choice as to what to put here. IMO this is true for the other properties that have a default value and only one allowed value.","commit_id":"03c62a7cf8fc450e89ab0d36ec86a55ccd461fde"}],"contrib/barbican/barbican/tests/test_order.py":[{"author":{"_account_id":6577,"name":"Sergey Kraynev","email":"sergejyit@gmail.com","username":"skraynev"},"change_message_id":"32cc1fc2fa8708ae36dc3ec40c71468a13bbb143","unresolved":false,"context_lines":[{"line_number":47,"context_line":"            \u0027algorithm\u0027: \u0027aes\u0027,"},{"line_number":48,"context_line":"            \u0027bit_length\u0027: 256,"},{"line_number":49,"context_line":"            \u0027mode\u0027: \u0027cbc\u0027,"},{"line_number":50,"context_line":"        }"},{"line_number":51,"context_line":"        self.res_template \u003d self.template[\u0027resources\u0027][\u0027order\u0027]"},{"line_number":52,"context_line":"        self.res_template[\u0027Properties\u0027] \u003d self.props"},{"line_number":53,"context_line":"        self._register_resources()"}],"source_content_type":"text/x-python","patch_set":9,"id":"7adec928_2ee253d5","line":50,"updated":"2014-05-13 09:46:17.000000000","message":"IMO, moving properties in separate variable instead of defining it in template above.","commit_id":"08d1d7a05b7463caff4f88bdb9cebc9bdf2f6fb4"},{"author":{"_account_id":6577,"name":"Sergey Kraynev","email":"sergejyit@gmail.com","username":"skraynev"},"change_message_id":"32cc1fc2fa8708ae36dc3ec40c71468a13bbb143","unresolved":false,"context_lines":[{"line_number":48,"context_line":"            \u0027bit_length\u0027: 256,"},{"line_number":49,"context_line":"            \u0027mode\u0027: \u0027cbc\u0027,"},{"line_number":50,"context_line":"        }"},{"line_number":51,"context_line":"        self.res_template \u003d self.template[\u0027resources\u0027][\u0027order\u0027]"},{"line_number":52,"context_line":"        self.res_template[\u0027Properties\u0027] \u003d self.props"},{"line_number":53,"context_line":"        self._register_resources()"},{"line_number":54,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"7adec928_cec9ef79","line":51,"updated":"2014-05-13 09:46:17.000000000","message":"you could remove redundant variable self.template and do:\n\nself.res_template \u003d self.stack.t[\u0027resources\u0027][\u0027order\u0027]","commit_id":"08d1d7a05b7463caff4f88bdb9cebc9bdf2f6fb4"}]}
