)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"febe0c96572e74928c7831ecc3105730f95d13c1","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Adam Harwell \u003cflux.adam@gmail.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2014-08-26 18:59:21 -0500"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add Containers to python-barbicanclient"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Change-Id: Id34ac86cfae3f155e97760f14d8cf256722c7d6f"},{"line_number":10,"context_line":"Implements: blueprint client-add-containers"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"1abeadc6_127db9e7","line":7,"updated":"2014-08-27 10:17:06.000000000","message":"Even though the BP already states what\u0027s going on, could you still add a message to the commit? It could state what the CR implements, such as the containers and the container types, no need to be very verbose, but would still appreciate it.","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"}],"barbicanclient/barbican_cli/containers.py":[{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"febe0c96572e74928c7831ecc3105730f95d13c1","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        return self._list_objects(obj_list)"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"class CreateContainer(show.ShowOne, ContainerFormatter):"},{"line_number":103,"context_line":"    \"\"\"Store a container in Barbican.\"\"\""},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    def get_parser(self, prog_name):"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_b7c87775","line":102,"updated":"2014-08-27 10:17:06.000000000","message":"Why is this class inheriting from the ContainerFormatter if it doesn\u0027t use any of its methods?","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"f2b4dfc9e6cddd1e56c7e4b9c50268048d06454f","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        return self._list_objects(obj_list)"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"class CreateContainer(show.ShowOne, ContainerFormatter):"},{"line_number":103,"context_line":"    \"\"\"Store a container in Barbican.\"\"\""},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    def get_parser(self, prog_name):"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_c450d10c","line":102,"in_reply_to":"1abeadc6_b7c87775","updated":"2014-08-27 16:21:38.000000000","message":"Because all of the other types of Create do (I know it\u0027s a bad reason, but that\u0027s the truth), and because I think we\u0027re supposed to be using the methods, as you mention below.","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"8ad9dd677c5eb3262e269bf47252c276643a3f69","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        return self._list_objects(obj_list)"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"class CreateContainer(show.ShowOne, ContainerFormatter):"},{"line_number":103,"context_line":"    \"\"\"Store a container in Barbican.\"\"\""},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    def get_parser(self, prog_name):"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_ec0e8f8b","line":102,"in_reply_to":"1abeadc6_c450d10c","updated":"2014-08-27 22:52:50.000000000","message":"Done","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"febe0c96572e74928c7831ecc3105730f95d13c1","unresolved":false,"context_lines":[{"line_number":111,"context_line":"                                 \u0027%(default)s).\u0027)"},{"line_number":112,"context_line":"        parser.add_argument(\u0027--secret\u0027, \u0027-s\u0027, action\u003d\u0027append\u0027,"},{"line_number":113,"context_line":"                            help\u003d\u0027one secret to store in a container \u0027"},{"line_number":114,"context_line":"                                 \u0027(can be set multiple times)\u0027)"},{"line_number":115,"context_line":"        return parser"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def take_action(self, args):"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_1793eb4f","line":114,"updated":"2014-08-27 10:17:06.000000000","message":"Should this provide an example on how to provide secrets (the format on how they should be provided)?","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"f2b4dfc9e6cddd1e56c7e4b9c50268048d06454f","unresolved":false,"context_lines":[{"line_number":111,"context_line":"                                 \u0027%(default)s).\u0027)"},{"line_number":112,"context_line":"        parser.add_argument(\u0027--secret\u0027, \u0027-s\u0027, action\u003d\u0027append\u0027,"},{"line_number":113,"context_line":"                            help\u003d\u0027one secret to store in a container \u0027"},{"line_number":114,"context_line":"                                 \u0027(can be set multiple times)\u0027)"},{"line_number":115,"context_line":"        return parser"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def take_action(self, args):"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_641d3d66","line":114,"in_reply_to":"1abeadc6_1793eb4f","updated":"2014-08-27 16:21:38.000000000","message":"Yeah, I meant to do that. I\u0027ll add that today.","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"8ad9dd677c5eb3262e269bf47252c276643a3f69","unresolved":false,"context_lines":[{"line_number":111,"context_line":"                                 \u0027%(default)s).\u0027)"},{"line_number":112,"context_line":"        parser.add_argument(\u0027--secret\u0027, \u0027-s\u0027, action\u003d\u0027append\u0027,"},{"line_number":113,"context_line":"                            help\u003d\u0027one secret to store in a container \u0027"},{"line_number":114,"context_line":"                                 \u0027(can be set multiple times)\u0027)"},{"line_number":115,"context_line":"        return parser"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def take_action(self, args):"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_d7579c58","line":114,"in_reply_to":"1abeadc6_641d3d66","updated":"2014-08-27 22:52:50.000000000","message":"Done","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"febe0c96572e74928c7831ecc3105730f95d13c1","unresolved":false,"context_lines":[{"line_number":120,"context_line":"            name\u003dargs.name, type\u003dargs.type, secret_refs\u003dsecret_refs)"},{"line_number":121,"context_line":"        entity.save()"},{"line_number":122,"context_line":"        return ((\u0027Container\u0027,),"},{"line_number":123,"context_line":"                (entity,))"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"    @staticmethod"},{"line_number":126,"context_line":"    def _parse_secrets(secrets):"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_d79a536d","line":123,"updated":"2014-08-27 10:17:06.000000000","message":"Is this the desired output or should the output be the actual contents of the container (using the ContainerFormatter function)?\n\nIMO I would prefer to use the ContainerFormatter and let cliff do its job.","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"8ad9dd677c5eb3262e269bf47252c276643a3f69","unresolved":false,"context_lines":[{"line_number":120,"context_line":"            name\u003dargs.name, type\u003dargs.type, secret_refs\u003dsecret_refs)"},{"line_number":121,"context_line":"        entity.save()"},{"line_number":122,"context_line":"        return ((\u0027Container\u0027,),"},{"line_number":123,"context_line":"                (entity,))"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"    @staticmethod"},{"line_number":126,"context_line":"    def _parse_secrets(secrets):"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_0c274b13","line":123,"in_reply_to":"1abeadc6_64345dde","updated":"2014-08-27 22:52:50.000000000","message":"Done","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"f2b4dfc9e6cddd1e56c7e4b9c50268048d06454f","unresolved":false,"context_lines":[{"line_number":120,"context_line":"            name\u003dargs.name, type\u003dargs.type, secret_refs\u003dsecret_refs)"},{"line_number":121,"context_line":"        entity.save()"},{"line_number":122,"context_line":"        return ((\u0027Container\u0027,),"},{"line_number":123,"context_line":"                (entity,))"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"    @staticmethod"},{"line_number":126,"context_line":"    def _parse_secrets(secrets):"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_64345dde","line":123,"in_reply_to":"1abeadc6_d79a536d","updated":"2014-08-27 16:21:38.000000000","message":"I think you\u0027re correct. I\u0027m still learning how cliff works.","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":9234,"name":"Steve Heyman","email":"steve@heyman.com","username":"hockeynut"},"change_message_id":"45cf2e895087f49983fd58090573be6ffb04740b","unresolved":false,"context_lines":[{"line_number":47,"context_line":""},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"class DeleteContainer(command.Command):"},{"line_number":50,"context_line":"    \"\"\"Delete an container by providing its href.\"\"\""},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    def get_parser(self, prog_name):"},{"line_number":53,"context_line":"        parser \u003d super(DeleteContainer, self).get_parser(prog_name)"}],"source_content_type":"text/x-python","patch_set":13,"id":"fa98f980_9a9ae6c3","line":50,"updated":"2014-09-08 23:51:45.000000000","message":"nit - should be Delete \"a\" container.","commit_id":"73f071351860ee9a0cc6c7e9b0431f4f7effb54d"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"99fb4944e732ec69a39350f76729b2c64140e41c","unresolved":false,"context_lines":[{"line_number":47,"context_line":""},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"class DeleteContainer(command.Command):"},{"line_number":50,"context_line":"    \"\"\"Delete an container by providing its href.\"\"\""},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    def get_parser(self, prog_name):"},{"line_number":53,"context_line":"        parser \u003d super(DeleteContainer, self).get_parser(prog_name)"}],"source_content_type":"text/x-python","patch_set":13,"id":"fa98f980_972fdfa0","line":50,"in_reply_to":"fa98f980_9a9ae6c3","updated":"2014-09-10 15:21:38.000000000","message":"Whoops, copy/paste error, I think.","commit_id":"73f071351860ee9a0cc6c7e9b0431f4f7effb54d"},{"author":{"_account_id":9234,"name":"Steve Heyman","email":"steve@heyman.com","username":"hockeynut"},"change_message_id":"45cf2e895087f49983fd58090573be6ffb04740b","unresolved":false,"context_lines":[{"line_number":89,"context_line":"                            help\u003d\u0027specify the container name \u0027"},{"line_number":90,"context_line":"                                 \u0027(default: %(default)s)\u0027)"},{"line_number":91,"context_line":"        parser.add_argument(\u0027--type\u0027, \u0027-t\u0027, default\u003dNone,"},{"line_number":92,"context_line":"                            help\u003d\u0027the type filter for the list\u0027"},{"line_number":93,"context_line":"                                 \u0027(default: %(default)s).\u0027)"},{"line_number":94,"context_line":"        return parser"},{"line_number":95,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"fa98f980_7a8c6280","line":92,"updated":"2014-09-08 23:51:45.000000000","message":"to be consistent lets say \"specify the type...\"","commit_id":"73f071351860ee9a0cc6c7e9b0431f4f7effb54d"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"99fb4944e732ec69a39350f76729b2c64140e41c","unresolved":false,"context_lines":[{"line_number":89,"context_line":"                            help\u003d\u0027specify the container name \u0027"},{"line_number":90,"context_line":"                                 \u0027(default: %(default)s)\u0027)"},{"line_number":91,"context_line":"        parser.add_argument(\u0027--type\u0027, \u0027-t\u0027, default\u003dNone,"},{"line_number":92,"context_line":"                            help\u003d\u0027the type filter for the list\u0027"},{"line_number":93,"context_line":"                                 \u0027(default: %(default)s).\u0027)"},{"line_number":94,"context_line":"        return parser"},{"line_number":95,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"fa98f980_5213c55b","line":92,"in_reply_to":"fa98f980_7a8c6280","updated":"2014-09-10 15:21:38.000000000","message":"Fine by me.","commit_id":"73f071351860ee9a0cc6c7e9b0431f4f7effb54d"}],"barbicanclient/base.py":[{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"febe0c96572e74928c7831ecc3105730f95d13c1","unresolved":false,"context_lines":[{"line_number":20,"context_line":"def remove_empty_keys(dictionary):"},{"line_number":21,"context_line":"    empty_keys \u003d [k for k, v in dictionary.items() if not v]"},{"line_number":22,"context_line":"    for k in empty_keys:"},{"line_number":23,"context_line":"        dictionary.pop(k)"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"def indent_object_string(string, spaces\u003d8):"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_32cb95a6","line":23,"updated":"2014-08-27 10:17:06.000000000","message":"now that I think about it, I actually dislike this implementation of remove_empty_keys, I would rather have this return the new dictionary, and not modify the other one.","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"8ad9dd677c5eb3262e269bf47252c276643a3f69","unresolved":false,"context_lines":[{"line_number":20,"context_line":"def remove_empty_keys(dictionary):"},{"line_number":21,"context_line":"    empty_keys \u003d [k for k, v in dictionary.items() if not v]"},{"line_number":22,"context_line":"    for k in empty_keys:"},{"line_number":23,"context_line":"        dictionary.pop(k)"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"def indent_object_string(string, spaces\u003d8):"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_ecadaf9c","line":23,"in_reply_to":"1abeadc6_32cb95a6","updated":"2014-08-27 22:52:50.000000000","message":"Done","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"febe0c96572e74928c7831ecc3105730f95d13c1","unresolved":false,"context_lines":[{"line_number":27,"context_line":"    return \u0027\\n\u0027.join("},{"line_number":28,"context_line":"        [\u0027{0}{1}\u0027.format(\u0027 \u0027 * spaces, line)"},{"line_number":29,"context_line":"         for line in str(string).split(\u0027\\n\u0027) if line]"},{"line_number":30,"context_line":"    )"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"class ImmutableException(Exception):"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_7726df17","line":30,"updated":"2014-08-27 10:17:06.000000000","message":"This whole function seems hacky. I think this functionality should be left to cliff, not done here.","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"f2b4dfc9e6cddd1e56c7e4b9c50268048d06454f","unresolved":false,"context_lines":[{"line_number":27,"context_line":"    return \u0027\\n\u0027.join("},{"line_number":28,"context_line":"        [\u0027{0}{1}\u0027.format(\u0027 \u0027 * spaces, line)"},{"line_number":29,"context_line":"         for line in str(string).split(\u0027\\n\u0027) if line]"},{"line_number":30,"context_line":"    )"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"class ImmutableException(Exception):"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_c485315a","line":30,"in_reply_to":"1abeadc6_7726df17","updated":"2014-08-27 16:21:38.000000000","message":"I\u0027m with you on the \"hacky\", but this is used inside the __str__ function in all of the classes, I don\u0027t know if there\u0027s a way to have cliff handle it properly (since these show up *right in the middle* of another string).","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"}],"barbicanclient/client.py":[{"author":{"_account_id":9234,"name":"Steve Heyman","email":"steve@heyman.com","username":"hockeynut"},"change_message_id":"45cf2e895087f49983fd58090573be6ffb04740b","unresolved":false,"context_lines":[{"line_number":159,"context_line":""},{"line_number":160,"context_line":"    def _prepare_auth(self, headers):"},{"line_number":161,"context_line":"        if type(headers) \u003d\u003d dict and not self._session.auth:"},{"line_number":162,"context_line":"            headers[\u0027X-Project-Id\u0027] \u003d self._tenant_id"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    def get(self, href, params\u003dNone):"},{"line_number":165,"context_line":"        headers \u003d {\u0027Accept\u0027: \u0027application/json\u0027}"}],"source_content_type":"text/x-python","patch_set":13,"id":"fa98f980_3af49a86","line":162,"updated":"2014-09-08 23:51:45.000000000","message":"should be \"is\" rather than \u003d\u003d (since dict is a singleton).","commit_id":"73f071351860ee9a0cc6c7e9b0431f4f7effb54d"},{"author":{"_account_id":7789,"name":"John Wood","email":"john.wood@rackspace.com","username":"woodster"},"change_message_id":"82ccf28e5f9687347a1474a7d5bc2b2840d6d93f","unresolved":false,"context_lines":[{"line_number":159,"context_line":""},{"line_number":160,"context_line":"    def _prepare_auth(self, headers):"},{"line_number":161,"context_line":"        if type(headers) \u003d\u003d dict and not self._session.auth:"},{"line_number":162,"context_line":"            headers[\u0027X-Project-Id\u0027] \u003d self._tenant_id"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    def get(self, href, params\u003dNone):"},{"line_number":165,"context_line":"        headers \u003d {\u0027Accept\u0027: \u0027application/json\u0027}"}],"source_content_type":"text/x-python","patch_set":13,"id":"fa98f980_e3e071ce","line":162,"in_reply_to":"fa98f980_3af49a86","updated":"2014-09-10 13:13:01.000000000","message":"I think isinstance() would be better here, as it would handle sub-classes of dict (yeah, not likely but still possible).","commit_id":"73f071351860ee9a0cc6c7e9b0431f4f7effb54d"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"99fb4944e732ec69a39350f76729b2c64140e41c","unresolved":false,"context_lines":[{"line_number":159,"context_line":""},{"line_number":160,"context_line":"    def _prepare_auth(self, headers):"},{"line_number":161,"context_line":"        if type(headers) \u003d\u003d dict and not self._session.auth:"},{"line_number":162,"context_line":"            headers[\u0027X-Project-Id\u0027] \u003d self._tenant_id"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    def get(self, href, params\u003dNone):"},{"line_number":165,"context_line":"        headers \u003d {\u0027Accept\u0027: \u0027application/json\u0027}"}],"source_content_type":"text/x-python","patch_set":13,"id":"fa98f980_d24df573","line":162,"in_reply_to":"fa98f980_e3e071ce","updated":"2014-09-10 15:21:38.000000000","message":"Yeah, I normally despise isinstance(), but I think I agree that it\u0027d work here. I don\u0027t think that headers will ever be mocked or anything...","commit_id":"73f071351860ee9a0cc6c7e9b0431f4f7effb54d"}],"barbicanclient/containers.py":[{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"9b17e0f5b8ec392c19dd555d99b5376039416e0d","unresolved":false,"context_lines":[{"line_number":12,"context_line":"# implied."},{"line_number":13,"context_line":"# See the License for the specific language governing permissions and"},{"line_number":14,"context_line":"# limitations under the License."},{"line_number":15,"context_line":"import barbicanclient"},{"line_number":16,"context_line":"import functools"},{"line_number":17,"context_line":"import logging"},{"line_number":18,"context_line":"import six"}],"source_content_type":"text/x-python","patch_set":3,"id":"1abeadc6_e34cc3a0","line":15,"updated":"2014-08-21 05:56:10.000000000","message":"Look into importing just the piece we need here -- don\u0027t think this causes any circular imports, but should play it safe.","commit_id":"f92708226fc699cbb602b6f06490fd78bf7f4a5d"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"9b17e0f5b8ec392c19dd555d99b5376039416e0d","unresolved":false,"context_lines":[{"line_number":173,"context_line":"            self._container_ref \u003d resp[\u0027container_ref\u0027]"},{"line_number":174,"context_line":"        return self.container_ref"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"    def _validate(self):"},{"line_number":177,"context_line":"        if self.type is \"generic\":"},{"line_number":178,"context_line":"            return True"},{"line_number":179,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"1abeadc6_e3be8364","line":176,"updated":"2014-08-21 05:56:10.000000000","message":"Either fix or remove this function (it isn\u0027t used right now). Maybe best to do no client-side validation and just let the server handle it?","commit_id":"f92708226fc699cbb602b6f06490fd78bf7f4a5d"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"9b17e0f5b8ec392c19dd555d99b5376039416e0d","unresolved":false,"context_lines":[{"line_number":188,"context_line":""},{"line_number":189,"context_line":"        return True"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"    def _get_named_secret(self, name):"},{"line_number":192,"context_line":"        # sec_ref \u003d None"},{"line_number":193,"context_line":"        # for ref in self.secret_refs:"},{"line_number":194,"context_line":"        #     if ref.get(\u0027name\u0027) \u003d\u003d name:"}],"source_content_type":"text/x-python","patch_set":3,"id":"1abeadc6_83886fc6","line":191,"updated":"2014-08-21 05:56:10.000000000","message":"Need to remove these comments.","commit_id":"f92708226fc699cbb602b6f06490fd78bf7f4a5d"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"9b17e0f5b8ec392c19dd555d99b5376039416e0d","unresolved":false,"context_lines":[{"line_number":356,"context_line":"    def __init__(self, api):"},{"line_number":357,"context_line":"        super(ContainerManager, self).__init__(api, \u0027containers\u0027)"},{"line_number":358,"context_line":""},{"line_number":359,"context_line":"    def Container(self, container_ref\u003dNone, **kwargs):"},{"line_number":360,"context_line":"        LOG.debug(\"Getting container - Container href: {0}\""},{"line_number":361,"context_line":"                  .format(container_ref))"},{"line_number":362,"context_line":"        if container_ref:"}],"source_content_type":"text/x-python","patch_set":3,"id":"1abeadc6_4371f7de","line":359,"updated":"2014-08-21 05:56:10.000000000","message":"Possibly add more of the named arguments here instead of relying on kwargs as much -- would make code completion better for people using the client library.","commit_id":"f92708226fc699cbb602b6f06490fd78bf7f4a5d"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"9b17e0f5b8ec392c19dd555d99b5376039416e0d","unresolved":false,"context_lines":[{"line_number":384,"context_line":"            return self.Container(container_ref\u003dcontainer_ref, **kwargs)"},{"line_number":385,"context_line":"        return CertificateContainer(api\u003dself.api, type\u003d\u0027certificate\u0027, **kwargs)"},{"line_number":386,"context_line":""},{"line_number":387,"context_line":"    def create(self, secrets, name\u003dNone, container_type\u003d\"generic\"):"},{"line_number":388,"context_line":"        \"\"\""},{"line_number":389,"context_line":"        Stores a new Container in Barbican"},{"line_number":390,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"1abeadc6_e362033d","line":387,"updated":"2014-08-21 05:56:10.000000000","message":"Need to remove this.","commit_id":"f92708226fc699cbb602b6f06490fd78bf7f4a5d"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"9b17e0f5b8ec392c19dd555d99b5376039416e0d","unresolved":false,"context_lines":[{"line_number":406,"context_line":"        resp \u003d self.api.post(self.entity, container_dict)"},{"line_number":407,"context_line":"        return resp[\u0027container_ref\u0027]"},{"line_number":408,"context_line":""},{"line_number":409,"context_line":"    def get(self, container_ref):"},{"line_number":410,"context_line":"        \"\"\""},{"line_number":411,"context_line":"        Returns a Container object with metadata about the container."},{"line_number":412,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"1abeadc6_23595b8e","line":409,"updated":"2014-08-21 05:56:10.000000000","message":"And this.","commit_id":"f92708226fc699cbb602b6f06490fd78bf7f4a5d"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"9b17e0f5b8ec392c19dd555d99b5376039416e0d","unresolved":false,"context_lines":[{"line_number":457,"context_line":"        return [self._container_map[s[\u0027type\u0027]](api\u003dself.api, **s)"},{"line_number":458,"context_line":"                for s in resp[\u0027containers\u0027]]"},{"line_number":459,"context_line":""},{"line_number":460,"context_line":"    def register_consumer(self, container_ref, name, URL):"},{"line_number":461,"context_line":"        \"\"\""},{"line_number":462,"context_line":"        Add a consumer to the container"},{"line_number":463,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"1abeadc6_23e79bad","line":460,"updated":"2014-08-21 05:56:10.000000000","message":"Maybe move this onto the object? Though the idea is that other services use \"register\" as their means of retrieving the object, so if they had to retrieve the object first and then register, it\u0027d defeat part of the goal...","commit_id":"f92708226fc699cbb602b6f06490fd78bf7f4a5d"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"9b17e0f5b8ec392c19dd555d99b5376039416e0d","unresolved":false,"context_lines":[{"line_number":477,"context_line":"        resp \u003d self.api.post(href, consumer_dict)"},{"line_number":478,"context_line":"        return self._container_map[resp[\u0027type\u0027]](api\u003dself.api, **resp)"},{"line_number":479,"context_line":""},{"line_number":480,"context_line":"    def remove_consumer(self, container_ref, name, URL):"},{"line_number":481,"context_line":"        \"\"\""},{"line_number":482,"context_line":"        Remove a consumer from the container"},{"line_number":483,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"1abeadc6_e39763ea","line":480,"updated":"2014-08-21 05:56:10.000000000","message":"Same as with registration. Also, need to further consider the names for these functions...","commit_id":"f92708226fc699cbb602b6f06490fd78bf7f4a5d"},{"author":{"_account_id":9234,"name":"Steve Heyman","email":"steve@heyman.com","username":"hockeynut"},"change_message_id":"2a18dbcbdab4a07e4b4124d7a4645d876260a95d","unresolved":false,"context_lines":[{"line_number":62,"context_line":"            self._expiration \u003d parse_isotime(self._expiration)"},{"line_number":63,"context_line":"        if container_ref:"},{"line_number":64,"context_line":"            self._status \u003d status"},{"line_number":65,"context_line":"            self._created \u003d created"},{"line_number":66,"context_line":"            self._updated \u003d updated"},{"line_number":67,"context_line":"            if self._created:"},{"line_number":68,"context_line":"                self._created \u003d parse_isotime(self._created)"}],"source_content_type":"text/x-python","patch_set":4,"id":"1abeadc6_2685b106","line":65,"updated":"2014-08-22 13:37:03.000000000","message":"could combine this with the IF below into something like:\n\nself_updated \u003d parse_isotime(self._updated) if self_updated else None\n\nsame for created and expration","commit_id":"7462e1f3bf07b40455dd9e304ef4add988a6b4cf"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"f788d586117dbe4c4512239ca6fc808badbd2ce5","unresolved":false,"context_lines":[{"line_number":62,"context_line":"            self._expiration \u003d parse_isotime(self._expiration)"},{"line_number":63,"context_line":"        if container_ref:"},{"line_number":64,"context_line":"            self._status \u003d status"},{"line_number":65,"context_line":"            self._created \u003d created"},{"line_number":66,"context_line":"            self._updated \u003d updated"},{"line_number":67,"context_line":"            if self._created:"},{"line_number":68,"context_line":"                self._created \u003d parse_isotime(self._created)"}],"source_content_type":"text/x-python","patch_set":4,"id":"1abeadc6_d8592d36","line":65,"in_reply_to":"1abeadc6_2685b106","updated":"2014-08-22 23:16:25.000000000","message":"I started off doing that, and then changed it to this to be more consistent everywhere (also because I had line length issues on one or two lines, though not in this file). I can change it back to that if it\u0027s preferred.\nCan\u0027t QUITE combine, since I need to ignore the values for status/updated/created passed by the user if the container_ref isn\u0027t set.\nThis may change soon, as I\u0027m thinking about changing the abstraction around a bit (no longer passing the user dict from the factory method straight through, and including the possible user-args in the factory signature).","commit_id":"7462e1f3bf07b40455dd9e304ef4add988a6b4cf"},{"author":{"_account_id":9234,"name":"Steve Heyman","email":"steve@heyman.com","username":"hockeynut"},"change_message_id":"2a18dbcbdab4a07e4b4124d7a4645d876260a95d","unresolved":false,"context_lines":[{"line_number":188,"context_line":""},{"line_number":189,"context_line":"        return True"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"    def _get_named_secret(self, name):"},{"line_number":192,"context_line":"        # sec_ref \u003d None"},{"line_number":193,"context_line":"        # for ref in self.secret_refs:"},{"line_number":194,"context_line":"        #     if ref.get(\u0027name\u0027) \u003d\u003d name:"}],"source_content_type":"text/x-python","patch_set":4,"id":"1abeadc6_e631f95a","line":191,"updated":"2014-08-22 13:37:03.000000000","message":"is name case sensitive or not?","commit_id":"7462e1f3bf07b40455dd9e304ef4add988a6b4cf"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"f788d586117dbe4c4512239ca6fc808badbd2ce5","unresolved":false,"context_lines":[{"line_number":188,"context_line":""},{"line_number":189,"context_line":"        return True"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"    def _get_named_secret(self, name):"},{"line_number":192,"context_line":"        # sec_ref \u003d None"},{"line_number":193,"context_line":"        # for ref in self.secret_refs:"},{"line_number":194,"context_line":"        #     if ref.get(\u0027name\u0027) \u003d\u003d name:"}],"source_content_type":"text/x-python","patch_set":4,"id":"1abeadc6_186645ed","line":191,"in_reply_to":"1abeadc6_e631f95a","updated":"2014-08-22 23:16:25.000000000","message":"I do not believe it is? At least, I don\u0027t think HERE it should matter. I will change it to reflect that.","commit_id":"7462e1f3bf07b40455dd9e304ef4add988a6b4cf"},{"author":{"_account_id":9234,"name":"Steve Heyman","email":"steve@heyman.com","username":"hockeynut"},"change_message_id":"2a18dbcbdab4a07e4b4124d7a4645d876260a95d","unresolved":false,"context_lines":[{"line_number":192,"context_line":"        # sec_ref \u003d None"},{"line_number":193,"context_line":"        # for ref in self.secret_refs:"},{"line_number":194,"context_line":"        #     if ref.get(\u0027name\u0027) \u003d\u003d name:"},{"line_number":195,"context_line":"        #         sec_ref \u003d ref.get(\u0027secret_ref\u0027)"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"        for s in self.secrets:"},{"line_number":198,"context_line":"            if s[0] \u003d\u003d name:"}],"source_content_type":"text/x-python","patch_set":4,"id":"1abeadc6_46fb8d78","line":195,"updated":"2014-08-22 13:37:03.000000000","message":"assuming this will be removed later","commit_id":"7462e1f3bf07b40455dd9e304ef4add988a6b4cf"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"f788d586117dbe4c4512239ca6fc808badbd2ce5","unresolved":false,"context_lines":[{"line_number":192,"context_line":"        # sec_ref \u003d None"},{"line_number":193,"context_line":"        # for ref in self.secret_refs:"},{"line_number":194,"context_line":"        #     if ref.get(\u0027name\u0027) \u003d\u003d name:"},{"line_number":195,"context_line":"        #         sec_ref \u003d ref.get(\u0027secret_ref\u0027)"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"        for s in self.secrets:"},{"line_number":198,"context_line":"            if s[0] \u003d\u003d name:"}],"source_content_type":"text/x-python","patch_set":4,"id":"1abeadc6_386141d3","line":195,"in_reply_to":"1abeadc6_46fb8d78","updated":"2014-08-22 23:16:25.000000000","message":"Yep.","commit_id":"7462e1f3bf07b40455dd9e304ef4add988a6b4cf"},{"author":{"_account_id":9234,"name":"Steve Heyman","email":"steve@heyman.com","username":"hockeynut"},"change_message_id":"2a18dbcbdab4a07e4b4124d7a4645d876260a95d","unresolved":false,"context_lines":[{"line_number":377,"context_line":"                parts \u003d url.path.rstrip(\u0027/\u0027).split(\u0027/\u0027)"},{"line_number":378,"context_line":"                uuid.UUID(parts[-1])"},{"line_number":379,"context_line":"            except:"},{"line_number":380,"context_line":"                raise ValueError(\u0027container incorrectly specified.\u0027)"},{"line_number":381,"context_line":"            resp \u003d self.api.get(container_ref)"},{"line_number":382,"context_line":"            container_type \u003d self._container_map.get(resp.get(\u0027type\u0027))"},{"line_number":383,"context_line":"            if not container_type:"}],"source_content_type":"text/x-python","patch_set":4,"id":"1abeadc6_86768504","line":380,"updated":"2014-08-22 13:37:03.000000000","message":"capitalize Container?","commit_id":"7462e1f3bf07b40455dd9e304ef4add988a6b4cf"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"f788d586117dbe4c4512239ca6fc808badbd2ce5","unresolved":false,"context_lines":[{"line_number":377,"context_line":"                parts \u003d url.path.rstrip(\u0027/\u0027).split(\u0027/\u0027)"},{"line_number":378,"context_line":"                uuid.UUID(parts[-1])"},{"line_number":379,"context_line":"            except:"},{"line_number":380,"context_line":"                raise ValueError(\u0027container incorrectly specified.\u0027)"},{"line_number":381,"context_line":"            resp \u003d self.api.get(container_ref)"},{"line_number":382,"context_line":"            container_type \u003d self._container_map.get(resp.get(\u0027type\u0027))"},{"line_number":383,"context_line":"            if not container_type:"}],"source_content_type":"text/x-python","patch_set":4,"id":"1abeadc6_f898a9c1","line":380,"in_reply_to":"1abeadc6_86768504","updated":"2014-08-22 23:16:25.000000000","message":"This is the same capitalization as used in all of the other similar functions originally (not that it\u0027s right, just noting that this was a copy/paste issue and I will have to change it in a bunch of other places too). Will include this fix in the next patch.","commit_id":"7462e1f3bf07b40455dd9e304ef4add988a6b4cf"},{"author":{"_account_id":9234,"name":"Steve Heyman","email":"steve@heyman.com","username":"hockeynut"},"change_message_id":"2a18dbcbdab4a07e4b4124d7a4645d876260a95d","unresolved":false,"context_lines":[{"line_number":379,"context_line":"            except:"},{"line_number":380,"context_line":"                raise ValueError(\u0027container incorrectly specified.\u0027)"},{"line_number":381,"context_line":"            resp \u003d self.api.get(container_ref)"},{"line_number":382,"context_line":"            container_type \u003d self._container_map.get(resp.get(\u0027type\u0027))"},{"line_number":383,"context_line":"            if not container_type:"},{"line_number":384,"context_line":"                return TypeError(\"Unknown container type {0}\""},{"line_number":385,"context_line":"                                 .format(resp.get(\u0027type\u0027)))"}],"source_content_type":"text/x-python","patch_set":4,"id":"1abeadc6_e6cd7932","line":382,"updated":"2014-08-22 13:37:03.000000000","message":"repeated resp.get(\u0027type\u0027) below - might want to put it into a variable so its only called once.","commit_id":"7462e1f3bf07b40455dd9e304ef4add988a6b4cf"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"f788d586117dbe4c4512239ca6fc808badbd2ce5","unresolved":false,"context_lines":[{"line_number":379,"context_line":"            except:"},{"line_number":380,"context_line":"                raise ValueError(\u0027container incorrectly specified.\u0027)"},{"line_number":381,"context_line":"            resp \u003d self.api.get(container_ref)"},{"line_number":382,"context_line":"            container_type \u003d self._container_map.get(resp.get(\u0027type\u0027))"},{"line_number":383,"context_line":"            if not container_type:"},{"line_number":384,"context_line":"                return TypeError(\"Unknown container type {0}\""},{"line_number":385,"context_line":"                                 .format(resp.get(\u0027type\u0027)))"}],"source_content_type":"text/x-python","patch_set":4,"id":"1abeadc6_98efb51d","line":382,"in_reply_to":"1abeadc6_e6cd7932","updated":"2014-08-22 23:16:25.000000000","message":"I don\u0027t know for sure that it\u0027s actually a performance impact, but I guess it wouldn\u0027t hurt.","commit_id":"7462e1f3bf07b40455dd9e304ef4add988a6b4cf"},{"author":{"_account_id":9234,"name":"Steve Heyman","email":"steve@heyman.com","username":"hockeynut"},"change_message_id":"2a18dbcbdab4a07e4b4124d7a4645d876260a95d","unresolved":false,"context_lines":[{"line_number":411,"context_line":"        List all containers for the tenant"},{"line_number":412,"context_line":""},{"line_number":413,"context_line":"        :param limit: Max number of containers returned"},{"line_number":414,"context_line":"        :param offset: Offset containers to begin list"},{"line_number":415,"context_line":"        :returns: list of Container metadata objects"},{"line_number":416,"context_line":"        \"\"\""},{"line_number":417,"context_line":"        LOG.debug(\u0027Listing containers - offset {0} limit {1}\u0027.format(offset,"}],"source_content_type":"text/x-python","patch_set":4,"id":"1abeadc6_c6f15d6c","line":414,"updated":"2014-08-22 13:37:03.000000000","message":"need :param for name","commit_id":"7462e1f3bf07b40455dd9e304ef4add988a6b4cf"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"f788d586117dbe4c4512239ca6fc808badbd2ce5","unresolved":false,"context_lines":[{"line_number":411,"context_line":"        List all containers for the tenant"},{"line_number":412,"context_line":""},{"line_number":413,"context_line":"        :param limit: Max number of containers returned"},{"line_number":414,"context_line":"        :param offset: Offset containers to begin list"},{"line_number":415,"context_line":"        :returns: list of Container metadata objects"},{"line_number":416,"context_line":"        \"\"\""},{"line_number":417,"context_line":"        LOG.debug(\u0027Listing containers - offset {0} limit {1}\u0027.format(offset,"}],"source_content_type":"text/x-python","patch_set":4,"id":"1abeadc6_d8f5aded","line":414,"in_reply_to":"1abeadc6_c6f15d6c","updated":"2014-08-22 23:16:25.000000000","message":"Done","commit_id":"7462e1f3bf07b40455dd9e304ef4add988a6b4cf"},{"author":{"_account_id":9234,"name":"Steve Heyman","email":"steve@heyman.com","username":"hockeynut"},"change_message_id":"2a18dbcbdab4a07e4b4124d7a4645d876260a95d","unresolved":false,"context_lines":[{"line_number":414,"context_line":"        :param offset: Offset containers to begin list"},{"line_number":415,"context_line":"        :returns: list of Container metadata objects"},{"line_number":416,"context_line":"        \"\"\""},{"line_number":417,"context_line":"        LOG.debug(\u0027Listing containers - offset {0} limit {1}\u0027.format(offset,"},{"line_number":418,"context_line":"                                                                     limit))"},{"line_number":419,"context_line":"        href \u003d \u0027{0}/{1}\u0027.format(self.api.base_url, self.entity)"},{"line_number":420,"context_line":"        params \u003d {\u0027limit\u0027: limit, \u0027offset\u0027: offset}"}],"source_content_type":"text/x-python","patch_set":4,"id":"1abeadc6_26ebf178","line":417,"updated":"2014-08-22 13:37:03.000000000","message":"add name to debug stmt perhaps?","commit_id":"7462e1f3bf07b40455dd9e304ef4add988a6b4cf"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"f788d586117dbe4c4512239ca6fc808badbd2ce5","unresolved":false,"context_lines":[{"line_number":414,"context_line":"        :param offset: Offset containers to begin list"},{"line_number":415,"context_line":"        :returns: list of Container metadata objects"},{"line_number":416,"context_line":"        \"\"\""},{"line_number":417,"context_line":"        LOG.debug(\u0027Listing containers - offset {0} limit {1}\u0027.format(offset,"},{"line_number":418,"context_line":"                                                                     limit))"},{"line_number":419,"context_line":"        href \u003d \u0027{0}/{1}\u0027.format(self.api.base_url, self.entity)"},{"line_number":420,"context_line":"        params \u003d {\u0027limit\u0027: limit, \u0027offset\u0027: offset}"}],"source_content_type":"text/x-python","patch_set":4,"id":"1abeadc6_83f10a6d","line":417,"in_reply_to":"1abeadc6_26ebf178","updated":"2014-08-22 23:16:25.000000000","message":"Done","commit_id":"7462e1f3bf07b40455dd9e304ef4add988a6b4cf"},{"author":{"_account_id":7789,"name":"John Wood","email":"john.wood@rackspace.com","username":"woodster"},"change_message_id":"9108027ce12c56a6e5ba267bc1097b34c2f1c766","unresolved":false,"context_lines":[{"line_number":163,"context_line":"            self._container_ref \u003d resp[\u0027container_ref\u0027]"},{"line_number":164,"context_line":"        return self.container_ref"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    def _get_named_secret(self, name):"},{"line_number":167,"context_line":"        for s in self.secrets:"},{"line_number":168,"context_line":"            if s.get(\u0027name\u0027) \u003d\u003d name.lower():"},{"line_number":169,"context_line":"                return s.get(\u0027secret\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"1abeadc6_a2c26084","line":166,"updated":"2014-08-25 03:24:24.000000000","message":"Is this method required? Since it is possible to get more than one secret with the same name, this should either return a list of secets with the same name, or else should be renamed to _get_first_named_secret() to make it unambiguous.","commit_id":"7a21a4076e6df57e4b3ba6f852de327fae441f8b"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"ed7094082c54466ee507bdea60ea307a25ceeec0","unresolved":false,"context_lines":[{"line_number":163,"context_line":"            self._container_ref \u003d resp[\u0027container_ref\u0027]"},{"line_number":164,"context_line":"        return self.container_ref"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    def _get_named_secret(self, name):"},{"line_number":167,"context_line":"        for s in self.secrets:"},{"line_number":168,"context_line":"            if s.get(\u0027name\u0027) \u003d\u003d name.lower():"},{"line_number":169,"context_line":"                return s.get(\u0027secret\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"1abeadc6_2603a474","line":166,"in_reply_to":"1abeadc6_a2c26084","updated":"2014-08-25 20:24:54.000000000","message":"It is needed to get secrets used by Typed Containers via their attributes. It\u0027s only used internally, so I\u0027m not sure about ambiguity, but I could change it. The big deal here is that I keep forgetting that you can have multiple secrets with the same name in a container -- won\u0027t THAT cause problems in general for Typed Containers? Like if a Certificate Container has two Certificates and two Private Keys, that would be problematic, because we couldn\u0027t immediately tell which was the correct cert to use or which private key belonged to which cert. I have a lot of questions around this.","commit_id":"7a21a4076e6df57e4b3ba6f852de327fae441f8b"},{"author":{"_account_id":9234,"name":"Steve Heyman","email":"steve@heyman.com","username":"hockeynut"},"change_message_id":"a541da0641b694f4ba1b8a6e00a3b5c1e20156d3","unresolved":false,"context_lines":[{"line_number":93,"context_line":"    @property"},{"line_number":94,"context_line":"    def secret_refs(self):"},{"line_number":95,"context_line":"        if self._secrets_cached:"},{"line_number":96,"context_line":"            self._secret_refs \u003d [{\u0027name\u0027: sec[0],"},{"line_number":97,"context_line":"                                  \u0027secret_ref\u0027: sec[1].secret_ref}"},{"line_number":98,"context_line":"                                 for sec in self._secrets_cached]"},{"line_number":99,"context_line":"        return self._secret_refs"}],"source_content_type":"text/x-python","patch_set":6,"id":"1abeadc6_a9611caa","line":96,"updated":"2014-08-26 17:53:43.000000000","message":"has sec been set yet?","commit_id":"27ca0de01e4f1cb637d052d8e8e136587ce04992"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"5ee0b3666916ac937d7df47a7946c0cd13d7a20f","unresolved":false,"context_lines":[{"line_number":93,"context_line":"    @property"},{"line_number":94,"context_line":"    def secret_refs(self):"},{"line_number":95,"context_line":"        if self._secrets_cached:"},{"line_number":96,"context_line":"            self._secret_refs \u003d [{\u0027name\u0027: sec[0],"},{"line_number":97,"context_line":"                                  \u0027secret_ref\u0027: sec[1].secret_ref}"},{"line_number":98,"context_line":"                                 for sec in self._secrets_cached]"},{"line_number":99,"context_line":"        return self._secret_refs"}],"source_content_type":"text/x-python","patch_set":6,"id":"1abeadc6_c7a9dcde","line":96,"in_reply_to":"1abeadc6_a9611caa","updated":"2014-08-26 20:55:25.000000000","message":"It\u0027s the list comprehension variable.","commit_id":"27ca0de01e4f1cb637d052d8e8e136587ce04992"},{"author":{"_account_id":9234,"name":"Steve Heyman","email":"steve@heyman.com","username":"hockeynut"},"change_message_id":"96928385a1d954c249066cd0dfec6300dda379a9","unresolved":false,"context_lines":[{"line_number":93,"context_line":"    @property"},{"line_number":94,"context_line":"    def secret_refs(self):"},{"line_number":95,"context_line":"        if self._secrets_cached:"},{"line_number":96,"context_line":"            self._secret_refs \u003d [{\u0027name\u0027: sec[0],"},{"line_number":97,"context_line":"                                  \u0027secret_ref\u0027: sec[1].secret_ref}"},{"line_number":98,"context_line":"                                 for sec in self._secrets_cached]"},{"line_number":99,"context_line":"        return self._secret_refs"}],"source_content_type":"text/x-python","patch_set":6,"id":"1abeadc6_47a4ecb8","line":96,"in_reply_to":"1abeadc6_c7a9dcde","updated":"2014-08-26 21:02:50.000000000","message":"(banging head on table) Thanks!","commit_id":"27ca0de01e4f1cb637d052d8e8e136587ce04992"},{"author":{"_account_id":9234,"name":"Steve Heyman","email":"steve@heyman.com","username":"hockeynut"},"change_message_id":"a541da0641b694f4ba1b8a6e00a3b5c1e20156d3","unresolved":false,"context_lines":[{"line_number":147,"context_line":"            \u0027name\u0027: self.name,"},{"line_number":148,"context_line":"            \u0027type\u0027: self.type,"},{"line_number":149,"context_line":"            \u0027secret_refs\u0027: [{"},{"line_number":150,"context_line":"                \u0027name\u0027: s[0],"},{"line_number":151,"context_line":"                \u0027secret_ref\u0027: s[1].secret_ref"},{"line_number":152,"context_line":"            } for s in self.secrets]"},{"line_number":153,"context_line":"        }"}],"source_content_type":"text/x-python","patch_set":6,"id":"1abeadc6_29e26c01","line":150,"updated":"2014-08-26 17:53:43.000000000","message":"at this point s is set to the last secret in self.secrets - is that what you want?","commit_id":"27ca0de01e4f1cb637d052d8e8e136587ce04992"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"bb0a154d45a3293f085415a741114fa87b76b41c","unresolved":false,"context_lines":[{"line_number":147,"context_line":"            \u0027name\u0027: self.name,"},{"line_number":148,"context_line":"            \u0027type\u0027: self.type,"},{"line_number":149,"context_line":"            \u0027secret_refs\u0027: [{"},{"line_number":150,"context_line":"                \u0027name\u0027: s[0],"},{"line_number":151,"context_line":"                \u0027secret_ref\u0027: s[1].secret_ref"},{"line_number":152,"context_line":"            } for s in self.secrets]"},{"line_number":153,"context_line":"        }"}],"source_content_type":"text/x-python","patch_set":6,"id":"1abeadc6_e76b3883","line":150,"in_reply_to":"1abeadc6_27e9b01a","updated":"2014-08-26 20:58:55.000000000","message":"Oh, no, this is fine. It\u0027s in a list comprehension -- I missed it when i looked this time too. :P","commit_id":"27ca0de01e4f1cb637d052d8e8e136587ce04992"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"5ee0b3666916ac937d7df47a7946c0cd13d7a20f","unresolved":false,"context_lines":[{"line_number":147,"context_line":"            \u0027name\u0027: self.name,"},{"line_number":148,"context_line":"            \u0027type\u0027: self.type,"},{"line_number":149,"context_line":"            \u0027secret_refs\u0027: [{"},{"line_number":150,"context_line":"                \u0027name\u0027: s[0],"},{"line_number":151,"context_line":"                \u0027secret_ref\u0027: s[1].secret_ref"},{"line_number":152,"context_line":"            } for s in self.secrets]"},{"line_number":153,"context_line":"        }"}],"source_content_type":"text/x-python","patch_set":6,"id":"1abeadc6_27e9b01a","line":150,"in_reply_to":"1abeadc6_29e26c01","updated":"2014-08-26 20:55:25.000000000","message":"Err, whoops, I think somewhere I messed this up. Revisiting, good catch. I know it was right in ONE of my previous patchsets. :P","commit_id":"27ca0de01e4f1cb637d052d8e8e136587ce04992"},{"author":{"_account_id":9234,"name":"Steve Heyman","email":"steve@heyman.com","username":"hockeynut"},"change_message_id":"96928385a1d954c249066cd0dfec6300dda379a9","unresolved":false,"context_lines":[{"line_number":147,"context_line":"            \u0027name\u0027: self.name,"},{"line_number":148,"context_line":"            \u0027type\u0027: self.type,"},{"line_number":149,"context_line":"            \u0027secret_refs\u0027: [{"},{"line_number":150,"context_line":"                \u0027name\u0027: s[0],"},{"line_number":151,"context_line":"                \u0027secret_ref\u0027: s[1].secret_ref"},{"line_number":152,"context_line":"            } for s in self.secrets]"},{"line_number":153,"context_line":"        }"}],"source_content_type":"text/x-python","patch_set":6,"id":"1abeadc6_c7c8fc77","line":150,"in_reply_to":"1abeadc6_e76b3883","updated":"2014-08-26 21:02:50.000000000","message":"I totally zoned out on the comprehension and just saw the usage of s.  thx for clarifying!","commit_id":"27ca0de01e4f1cb637d052d8e8e136587ce04992"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"febe0c96572e74928c7831ecc3105730f95d13c1","unresolved":false,"context_lines":[{"line_number":51,"context_line":"        Builds a container object from a dictionary."},{"line_number":52,"context_line":"        \"\"\""},{"line_number":53,"context_line":"        self._api \u003d api"},{"line_number":54,"context_line":"        self._secrets_cached \u003d list()"},{"line_number":55,"context_line":"        self._container_ref \u003d container_ref"},{"line_number":56,"context_line":"        self._name \u003d name"},{"line_number":57,"context_line":"        self._type \u003d type"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_d7e09398","line":54,"updated":"2014-08-27 10:17:06.000000000","message":"nit: _secrets_cached or _cached_secrets? O_o","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"8ad9dd677c5eb3262e269bf47252c276643a3f69","unresolved":false,"context_lines":[{"line_number":51,"context_line":"        Builds a container object from a dictionary."},{"line_number":52,"context_line":"        \"\"\""},{"line_number":53,"context_line":"        self._api \u003d api"},{"line_number":54,"context_line":"        self._secrets_cached \u003d list()"},{"line_number":55,"context_line":"        self._container_ref \u003d container_ref"},{"line_number":56,"context_line":"        self._name \u003d name"},{"line_number":57,"context_line":"        self._type \u003d type"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_d7e5dca4","line":54,"in_reply_to":"1abeadc6_64e7fd40","updated":"2014-08-27 22:52:50.000000000","message":"Done","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"f2b4dfc9e6cddd1e56c7e4b9c50268048d06454f","unresolved":false,"context_lines":[{"line_number":51,"context_line":"        Builds a container object from a dictionary."},{"line_number":52,"context_line":"        \"\"\""},{"line_number":53,"context_line":"        self._api \u003d api"},{"line_number":54,"context_line":"        self._secrets_cached \u003d list()"},{"line_number":55,"context_line":"        self._container_ref \u003d container_ref"},{"line_number":56,"context_line":"        self._name \u003d name"},{"line_number":57,"context_line":"        self._type \u003d type"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_64e7fd40","line":54,"in_reply_to":"1abeadc6_d7e09398","updated":"2014-08-27 16:21:38.000000000","message":"I could swap it, I put the more important part first, with the modifier second, because that\u0027s how I was thinking about it. It\u0027s probably just a personal preference thing?","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"febe0c96572e74928c7831ecc3105730f95d13c1","unresolved":false,"context_lines":[{"line_number":59,"context_line":"        self._consumers \u003d consumers"},{"line_number":60,"context_line":"        if container_ref:"},{"line_number":61,"context_line":"            self._status \u003d status"},{"line_number":62,"context_line":"            self._created \u003d parse_isotime(created) if created else None"},{"line_number":63,"context_line":"            self._updated \u003d parse_isotime(updated) if updated else None"},{"line_number":64,"context_line":"        else:"},{"line_number":65,"context_line":"            self._status \u003d None"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_77541f54","line":62,"updated":"2014-08-27 10:17:06.000000000","message":"please expand this to its canonical form:\n\nif created:\n    self._created \u003d parse_isotime(created)\nelse:\n    self._created \u003d None\n\nThat way, it will show explicitly in the coverage if this is properly tested","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"f2b4dfc9e6cddd1e56c7e4b9c50268048d06454f","unresolved":false,"context_lines":[{"line_number":59,"context_line":"        self._consumers \u003d consumers"},{"line_number":60,"context_line":"        if container_ref:"},{"line_number":61,"context_line":"            self._status \u003d status"},{"line_number":62,"context_line":"            self._created \u003d parse_isotime(created) if created else None"},{"line_number":63,"context_line":"            self._updated \u003d parse_isotime(updated) if updated else None"},{"line_number":64,"context_line":"        else:"},{"line_number":65,"context_line":"            self._status \u003d None"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_04456916","line":62,"in_reply_to":"1abeadc6_77541f54","updated":"2014-08-27 16:21:38.000000000","message":"I\u0027ve switched it back and forth several times now -- people keep telling me to switch it one way or the other. I\u0027m going to leave it for now until I get everyone to agree here in writing. :P","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"febe0c96572e74928c7831ecc3105730f95d13c1","unresolved":false,"context_lines":[{"line_number":60,"context_line":"        if container_ref:"},{"line_number":61,"context_line":"            self._status \u003d status"},{"line_number":62,"context_line":"            self._created \u003d parse_isotime(created) if created else None"},{"line_number":63,"context_line":"            self._updated \u003d parse_isotime(updated) if updated else None"},{"line_number":64,"context_line":"        else:"},{"line_number":65,"context_line":"            self._status \u003d None"},{"line_number":66,"context_line":"            self._created \u003d None"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_b74eb7bf","line":63,"updated":"2014-08-27 10:17:06.000000000","message":"same here.","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"f2b4dfc9e6cddd1e56c7e4b9c50268048d06454f","unresolved":false,"context_lines":[{"line_number":60,"context_line":"        if container_ref:"},{"line_number":61,"context_line":"            self._status \u003d status"},{"line_number":62,"context_line":"            self._created \u003d parse_isotime(created) if created else None"},{"line_number":63,"context_line":"            self._updated \u003d parse_isotime(updated) if updated else None"},{"line_number":64,"context_line":"        else:"},{"line_number":65,"context_line":"            self._status \u003d None"},{"line_number":66,"context_line":"            self._created \u003d None"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_64553dc5","line":63,"in_reply_to":"1abeadc6_b74eb7bf","updated":"2014-08-27 16:21:38.000000000","message":"Same.","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"2dfe95b0df62bb1fc9e5f63a47f5d586dcd0c090","unresolved":false,"context_lines":[{"line_number":133,"context_line":"    @immutable_after_save"},{"line_number":134,"context_line":"    def add(self, name, sec):"},{"line_number":135,"context_line":"        if not isinstance(sec, secrets.Secret):"},{"line_number":136,"context_line":"            raise ValueError(\"Must provide a valid Secret object\")"},{"line_number":137,"context_line":"        self._secrets_cached.append({\u0027name\u0027: name.lower(), \u0027secret\u0027: sec})"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"    @immutable_after_save"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_0d03dc0d","line":136,"updated":"2014-08-27 10:25:32.000000000","message":"By the way, this is untested.","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"f2b4dfc9e6cddd1e56c7e4b9c50268048d06454f","unresolved":false,"context_lines":[{"line_number":133,"context_line":"    @immutable_after_save"},{"line_number":134,"context_line":"    def add(self, name, sec):"},{"line_number":135,"context_line":"        if not isinstance(sec, secrets.Secret):"},{"line_number":136,"context_line":"            raise ValueError(\"Must provide a valid Secret object\")"},{"line_number":137,"context_line":"        self._secrets_cached.append({\u0027name\u0027: name.lower(), \u0027secret\u0027: sec})"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"    @immutable_after_save"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_446da198","line":136,"in_reply_to":"1abeadc6_0d03dc0d","updated":"2014-08-27 16:21:38.000000000","message":"True -- I will add a test for trying to add something that isn\u0027t a Secret.","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"8ad9dd677c5eb3262e269bf47252c276643a3f69","unresolved":false,"context_lines":[{"line_number":133,"context_line":"    @immutable_after_save"},{"line_number":134,"context_line":"    def add(self, name, sec):"},{"line_number":135,"context_line":"        if not isinstance(sec, secrets.Secret):"},{"line_number":136,"context_line":"            raise ValueError(\"Must provide a valid Secret object\")"},{"line_number":137,"context_line":"        self._secrets_cached.append({\u0027name\u0027: name.lower(), \u0027secret\u0027: sec})"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"    @immutable_after_save"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_e53e9d8a","line":136,"in_reply_to":"1abeadc6_446da198","updated":"2014-08-27 22:52:50.000000000","message":"Done","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"febe0c96572e74928c7831ecc3105730f95d13c1","unresolved":false,"context_lines":[{"line_number":137,"context_line":"        self._secrets_cached.append({\u0027name\u0027: name.lower(), \u0027secret\u0027: sec})"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"    @immutable_after_save"},{"line_number":140,"context_line":"    def save(self):"},{"line_number":141,"context_line":"        # Save all secrets if they are not yet saved"},{"line_number":142,"context_line":"        LOG.debug(\"Storing secrets: {0}\".format(self.secrets))"},{"line_number":143,"context_line":"        secret_refs \u003d []"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_72f98dc7","line":140,"updated":"2014-08-27 10:17:06.000000000","message":"instead of having comments to describe what\u0027s going on in the function, why not partition it into separate functions so it\u0027s self-descriptive?","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"8ad9dd677c5eb3262e269bf47252c276643a3f69","unresolved":false,"context_lines":[{"line_number":137,"context_line":"        self._secrets_cached.append({\u0027name\u0027: name.lower(), \u0027secret\u0027: sec})"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"    @immutable_after_save"},{"line_number":140,"context_line":"    def save(self):"},{"line_number":141,"context_line":"        # Save all secrets if they are not yet saved"},{"line_number":142,"context_line":"        LOG.debug(\"Storing secrets: {0}\".format(self.secrets))"},{"line_number":143,"context_line":"        secret_refs \u003d []"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_05447919","line":140,"in_reply_to":"1abeadc6_72f98dc7","updated":"2014-08-27 22:52:50.000000000","message":"Done","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"febe0c96572e74928c7831ecc3105730f95d13c1","unresolved":false,"context_lines":[{"line_number":143,"context_line":"        secret_refs \u003d []"},{"line_number":144,"context_line":"        for s in self.secrets:"},{"line_number":145,"context_line":"            sec \u003d s.get(\u0027secret\u0027)"},{"line_number":146,"context_line":"            if sec and not sec.secret_ref:"},{"line_number":147,"context_line":"                sec.store()"},{"line_number":148,"context_line":"            secret_refs.append({\u0027name\u0027: s.get(\u0027name\u0027),"},{"line_number":149,"context_line":"                                \u0027secret_ref\u0027: sec.secret_ref})"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_920e2931","line":146,"updated":"2014-08-27 10:17:06.000000000","message":"What about adding a function to the secrets to know if they need to be stored?\nAnd, what if a secret already has the secret_ref? wouldn\u0027t this be undesired behaviour? at least I would expect a debug message, but I would also like to discuss if even an exception needs to be raised.","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"f2b4dfc9e6cddd1e56c7e4b9c50268048d06454f","unresolved":false,"context_lines":[{"line_number":143,"context_line":"        secret_refs \u003d []"},{"line_number":144,"context_line":"        for s in self.secrets:"},{"line_number":145,"context_line":"            sec \u003d s.get(\u0027secret\u0027)"},{"line_number":146,"context_line":"            if sec and not sec.secret_ref:"},{"line_number":147,"context_line":"                sec.store()"},{"line_number":148,"context_line":"            secret_refs.append({\u0027name\u0027: s.get(\u0027name\u0027),"},{"line_number":149,"context_line":"                                \u0027secret_ref\u0027: sec.secret_ref})"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_e40f8ddf","line":146,"in_reply_to":"1abeadc6_920e2931","updated":"2014-08-27 16:21:38.000000000","message":"The presence of a secret_ref is enough to know if it\u0027s stored or not. If it has one, it\u0027s fine, if it doesn\u0027t, it gets stored here. Still looks to me like this is working as designed.","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"2dfe95b0df62bb1fc9e5f63a47f5d586dcd0c090","unresolved":false,"context_lines":[{"line_number":144,"context_line":"        for s in self.secrets:"},{"line_number":145,"context_line":"            sec \u003d s.get(\u0027secret\u0027)"},{"line_number":146,"context_line":"            if sec and not sec.secret_ref:"},{"line_number":147,"context_line":"                sec.store()"},{"line_number":148,"context_line":"            secret_refs.append({\u0027name\u0027: s.get(\u0027name\u0027),"},{"line_number":149,"context_line":"                                \u0027secret_ref\u0027: sec.secret_ref})"},{"line_number":150,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_2d0a5821","line":147,"updated":"2014-08-27 10:25:32.000000000","message":"Also, this is untested.","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"f2b4dfc9e6cddd1e56c7e4b9c50268048d06454f","unresolved":false,"context_lines":[{"line_number":144,"context_line":"        for s in self.secrets:"},{"line_number":145,"context_line":"            sec \u003d s.get(\u0027secret\u0027)"},{"line_number":146,"context_line":"            if sec and not sec.secret_ref:"},{"line_number":147,"context_line":"                sec.store()"},{"line_number":148,"context_line":"            secret_refs.append({\u0027name\u0027: s.get(\u0027name\u0027),"},{"line_number":149,"context_line":"                                \u0027secret_ref\u0027: sec.secret_ref})"},{"line_number":150,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_e426ad67","line":147,"in_reply_to":"1abeadc6_2d0a5821","updated":"2014-08-27 16:21:38.000000000","message":"Yes, true. I\u0027ll add a test for this.","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"febe0c96572e74928c7831ecc3105730f95d13c1","unresolved":false,"context_lines":[{"line_number":154,"context_line":"            \u0027type\u0027: self.type,"},{"line_number":155,"context_line":"            \u0027secret_refs\u0027: secret_refs"},{"line_number":156,"context_line":"        }"},{"line_number":157,"context_line":"        base.remove_empty_keys(container_dict)"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"        LOG.debug(\"Request body: {0}\".format(container_dict))"},{"line_number":160,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_3259d5fe","line":157,"updated":"2014-08-27 10:17:06.000000000","message":"I can live with the way this is at the moment. But in the end I would prefer this to look like the following:\n\ncontainer_dict \u003d base.remove_empty_keys({\u003c...stuff...\u003e})\n\nof course, with proper indentation and so on.","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"f2b4dfc9e6cddd1e56c7e4b9c50268048d06454f","unresolved":false,"context_lines":[{"line_number":154,"context_line":"            \u0027type\u0027: self.type,"},{"line_number":155,"context_line":"            \u0027secret_refs\u0027: secret_refs"},{"line_number":156,"context_line":"        }"},{"line_number":157,"context_line":"        base.remove_empty_keys(container_dict)"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"        LOG.debug(\"Request body: {0}\".format(container_dict))"},{"line_number":160,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_c4a451bb","line":157,"in_reply_to":"1abeadc6_3259d5fe","updated":"2014-08-27 16:21:38.000000000","message":"Yeah, I feel like a broken record, but \"I did it this way because this is how it was done in the past\", which is because I\u0027m a stickler for consistency (and since I don\u0027t specifically disagree with how it was done, I didn\u0027t want to mess with it). If this *is* bad design, now would be the time to change it (including in the CR above this one). Can anyone else comment?","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"8ad9dd677c5eb3262e269bf47252c276643a3f69","unresolved":false,"context_lines":[{"line_number":154,"context_line":"            \u0027type\u0027: self.type,"},{"line_number":155,"context_line":"            \u0027secret_refs\u0027: secret_refs"},{"line_number":156,"context_line":"        }"},{"line_number":157,"context_line":"        base.remove_empty_keys(container_dict)"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"        LOG.debug(\"Request body: {0}\".format(container_dict))"},{"line_number":160,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_0c6e6b2f","line":157,"in_reply_to":"1abeadc6_c4a451bb","updated":"2014-08-27 22:52:50.000000000","message":"Done","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"febe0c96572e74928c7831ecc3105730f95d13c1","unresolved":false,"context_lines":[{"line_number":161,"context_line":"        # Save, store container_ref and return"},{"line_number":162,"context_line":"        resp \u003d self._api.post(self.entity, container_dict)"},{"line_number":163,"context_line":"        if resp:"},{"line_number":164,"context_line":"            self._container_ref \u003d resp[\u0027container_ref\u0027]"},{"line_number":165,"context_line":"        return self.container_ref"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"    def _get_named_secret(self, name):"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_1230599d","line":164,"updated":"2014-08-27 10:17:06.000000000","message":"what if there is no \"resp\"? which I assume is response (I prefer complete words)","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"f2b4dfc9e6cddd1e56c7e4b9c50268048d06454f","unresolved":false,"context_lines":[{"line_number":161,"context_line":"        # Save, store container_ref and return"},{"line_number":162,"context_line":"        resp \u003d self._api.post(self.entity, container_dict)"},{"line_number":163,"context_line":"        if resp:"},{"line_number":164,"context_line":"            self._container_ref \u003d resp[\u0027container_ref\u0027]"},{"line_number":165,"context_line":"        return self.container_ref"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"    def _get_named_secret(self, name):"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_c4e0d1ce","line":164,"in_reply_to":"1abeadc6_1230599d","updated":"2014-08-27 16:21:38.000000000","message":"Again, resp was consistent with the rest of the code previously, I could expand it out if that\u0027s really preferred. If there is no response, it fails, and the Exception will bubble up automatically (which is what is intended), showing the error received from the server. \n\n... Right now it doesn\u0027t show the correct Exception, but that is another bug. Keystone wrapper tries to mangle the Exception to display it but the Exception is not in Keystone\u0027s format, it\u0027s in Barbican\u0027s format, so the resulting Exception the user sees is incomprehensible and useless. This is for another CR though.","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"2dfe95b0df62bb1fc9e5f63a47f5d586dcd0c090","unresolved":false,"context_lines":[{"line_number":161,"context_line":"        # Save, store container_ref and return"},{"line_number":162,"context_line":"        resp \u003d self._api.post(self.entity, container_dict)"},{"line_number":163,"context_line":"        if resp:"},{"line_number":164,"context_line":"            self._container_ref \u003d resp[\u0027container_ref\u0027]"},{"line_number":165,"context_line":"        return self.container_ref"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"    def _get_named_secret(self, name):"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_2d21789f","line":164,"in_reply_to":"1abeadc6_1230599d","updated":"2014-08-27 10:25:32.000000000","message":"Also, it is not tested if \u0027resp\u0027 is falsey","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"2dfe95b0df62bb1fc9e5f63a47f5d586dcd0c090","unresolved":false,"context_lines":[{"line_number":164,"context_line":"            self._container_ref \u003d resp[\u0027container_ref\u0027]"},{"line_number":165,"context_line":"        return self.container_ref"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"    def _get_named_secret(self, name):"},{"line_number":168,"context_line":"        for s in self.secrets:"},{"line_number":169,"context_line":"            if s.get(\u0027name\u0027) \u003d\u003d name.lower():"},{"line_number":170,"context_line":"                return s.get(\u0027secret\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_8d352cdd","line":167,"updated":"2014-08-27 10:25:32.000000000","message":"All this function seems to be untested for some reason O_o","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"f2b4dfc9e6cddd1e56c7e4b9c50268048d06454f","unresolved":false,"context_lines":[{"line_number":164,"context_line":"            self._container_ref \u003d resp[\u0027container_ref\u0027]"},{"line_number":165,"context_line":"        return self.container_ref"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"    def _get_named_secret(self, name):"},{"line_number":168,"context_line":"        for s in self.secrets:"},{"line_number":169,"context_line":"            if s.get(\u0027name\u0027) \u003d\u003d name.lower():"},{"line_number":170,"context_line":"                return s.get(\u0027secret\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_c42e11fa","line":167,"in_reply_to":"1abeadc6_8d352cdd","updated":"2014-08-27 16:21:38.000000000","message":"This function is tested per the RSA/Container types working properly (if it doesn\u0027t work, they don\u0027t work). Or, that was the plan at least, I will double-check to make sure they\u0027re doing the appropriate testing.","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"8ad9dd677c5eb3262e269bf47252c276643a3f69","unresolved":false,"context_lines":[{"line_number":164,"context_line":"            self._container_ref \u003d resp[\u0027container_ref\u0027]"},{"line_number":165,"context_line":"        return self.container_ref"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"    def _get_named_secret(self, name):"},{"line_number":168,"context_line":"        for s in self.secrets:"},{"line_number":169,"context_line":"            if s.get(\u0027name\u0027) \u003d\u003d name.lower():"},{"line_number":170,"context_line":"                return s.get(\u0027secret\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_c56441bb","line":167,"in_reply_to":"1abeadc6_c42e11fa","updated":"2014-08-27 22:52:50.000000000","message":"Done","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"febe0c96572e74928c7831ecc3105730f95d13c1","unresolved":false,"context_lines":[{"line_number":170,"context_line":"                return s.get(\u0027secret\u0027)"},{"line_number":171,"context_line":"        return None"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"    def __str__(self):"},{"line_number":174,"context_line":"        sec \u003d [\u0027\"{0}\":\\n{1}\u0027.format(s.get(\u0027name\u0027),"},{"line_number":175,"context_line":"                                    base.indent_object_string(s.get(\u0027secret\u0027),"},{"line_number":176,"context_line":"                                                              4))"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_f7958fe4","line":173,"updated":"2014-08-27 10:17:06.000000000","message":"all this __str__ business seems hacky to me. Like I said in previous comments, I would prefer this be left to cliff to handle.","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"f2b4dfc9e6cddd1e56c7e4b9c50268048d06454f","unresolved":false,"context_lines":[{"line_number":170,"context_line":"                return s.get(\u0027secret\u0027)"},{"line_number":171,"context_line":"        return None"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"    def __str__(self):"},{"line_number":174,"context_line":"        sec \u003d [\u0027\"{0}\":\\n{1}\u0027.format(s.get(\u0027name\u0027),"},{"line_number":175,"context_line":"                                    base.indent_object_string(s.get(\u0027secret\u0027),"},{"line_number":176,"context_line":"                                                              4))"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_841b39c9","line":173,"in_reply_to":"1abeadc6_f7958fe4","updated":"2014-08-27 16:21:38.000000000","message":"Alright, I have no idea how cliff works (when I started on this change, we weren\u0027t even using it!) but I will do some research.","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"febe0c96572e74928c7831ecc3105730f95d13c1","unresolved":false,"context_lines":[{"line_number":234,"context_line":"    def __repr__(self):"},{"line_number":235,"context_line":"        return \u0027RSAContainer(name\u003d\"{0}\")\u0027.format(self.name)"},{"line_number":236,"context_line":""},{"line_number":237,"context_line":"    def __str__(self):"},{"line_number":238,"context_line":"        return (\"RSAContainer:\\n\""},{"line_number":239,"context_line":"                \"    href: {0}\\n\""},{"line_number":240,"context_line":"                \"    name: {1}\\n\""}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_92e2a9ff","line":237,"updated":"2014-08-27 10:17:06.000000000","message":"same comment as above","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"febe0c96572e74928c7831ecc3105730f95d13c1","unresolved":false,"context_lines":[{"line_number":305,"context_line":"    def __repr__(self):"},{"line_number":306,"context_line":"        return \u0027CertificateContainer(name\u003d\"{0}\")\u0027.format(self.name)"},{"line_number":307,"context_line":""},{"line_number":308,"context_line":"    def __str__(self):"},{"line_number":309,"context_line":"        return (\"CertificateContainer:\\n\""},{"line_number":310,"context_line":"                \"    href: {0}\\n\""},{"line_number":311,"context_line":"                \"    name: {1}\\n\""}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_d2ec21f6","line":308,"updated":"2014-08-27 10:17:06.000000000","message":"same here.","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"febe0c96572e74928c7831ecc3105730f95d13c1","unresolved":false,"context_lines":[{"line_number":344,"context_line":"                  secret_refs\u003dNone):"},{"line_number":345,"context_line":"        LOG.debug(\u0027Getting container - Container href: {0}\u0027"},{"line_number":346,"context_line":"                  .format(container_ref))"},{"line_number":347,"context_line":"        if container_ref:"},{"line_number":348,"context_line":"            try:"},{"line_number":349,"context_line":"                url \u003d six.moves.urllib.parse.urlparse(container_ref)"},{"line_number":350,"context_line":"                parts \u003d url.path.rstrip(\u0027/\u0027).split(\u0027/\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_52af3194","line":347,"updated":"2014-08-27 10:17:06.000000000","message":"could you separate the contents of this if to a separate function?\n\nFrom what I understand, this fetches the container belonging to the href.\nAnd for this, first the url is validated, then the actual container is fetched, then you validate the container, seems like the correct approach, but I would like to have these actions more explicitly described in the code. separate functions maybe?","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"8ad9dd677c5eb3262e269bf47252c276643a3f69","unresolved":false,"context_lines":[{"line_number":344,"context_line":"                  secret_refs\u003dNone):"},{"line_number":345,"context_line":"        LOG.debug(\u0027Getting container - Container href: {0}\u0027"},{"line_number":346,"context_line":"                  .format(container_ref))"},{"line_number":347,"context_line":"        if container_ref:"},{"line_number":348,"context_line":"            try:"},{"line_number":349,"context_line":"                url \u003d six.moves.urllib.parse.urlparse(container_ref)"},{"line_number":350,"context_line":"                parts \u003d url.path.rstrip(\u0027/\u0027).split(\u0027/\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_ac66574f","line":347,"in_reply_to":"1abeadc6_24db45ee","updated":"2014-08-27 22:52:50.000000000","message":"Done","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"f2b4dfc9e6cddd1e56c7e4b9c50268048d06454f","unresolved":false,"context_lines":[{"line_number":344,"context_line":"                  secret_refs\u003dNone):"},{"line_number":345,"context_line":"        LOG.debug(\u0027Getting container - Container href: {0}\u0027"},{"line_number":346,"context_line":"                  .format(container_ref))"},{"line_number":347,"context_line":"        if container_ref:"},{"line_number":348,"context_line":"            try:"},{"line_number":349,"context_line":"                url \u003d six.moves.urllib.parse.urlparse(container_ref)"},{"line_number":350,"context_line":"                parts \u003d url.path.rstrip(\u0027/\u0027).split(\u0027/\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_24db45ee","line":347,"in_reply_to":"1abeadc6_52af3194","updated":"2014-08-27 16:21:38.000000000","message":"This could probably actually find its way to base.py, since the same thing is done for Secrets and Orders too.","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"febe0c96572e74928c7831ecc3105730f95d13c1","unresolved":false,"context_lines":[{"line_number":348,"context_line":"            try:"},{"line_number":349,"context_line":"                url \u003d six.moves.urllib.parse.urlparse(container_ref)"},{"line_number":350,"context_line":"                parts \u003d url.path.rstrip(\u0027/\u0027).split(\u0027/\u0027)"},{"line_number":351,"context_line":"                uuid.UUID(parts[-1])"},{"line_number":352,"context_line":"            except:"},{"line_number":353,"context_line":"                raise ValueError(\u0027Container incorrectly specified.\u0027)"},{"line_number":354,"context_line":"            resp \u003d self.api.get(container_ref)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_52865114","line":351,"updated":"2014-08-27 10:17:06.000000000","message":"a bit hard to follow what\u0027s going on inside this \"try\", can you be more descriptive? Maintainable code should be as obvious and self-descriptive as possible ;)","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"8ad9dd677c5eb3262e269bf47252c276643a3f69","unresolved":false,"context_lines":[{"line_number":348,"context_line":"            try:"},{"line_number":349,"context_line":"                url \u003d six.moves.urllib.parse.urlparse(container_ref)"},{"line_number":350,"context_line":"                parts \u003d url.path.rstrip(\u0027/\u0027).split(\u0027/\u0027)"},{"line_number":351,"context_line":"                uuid.UUID(parts[-1])"},{"line_number":352,"context_line":"            except:"},{"line_number":353,"context_line":"                raise ValueError(\u0027Container incorrectly specified.\u0027)"},{"line_number":354,"context_line":"            resp \u003d self.api.get(container_ref)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_cc571359","line":351,"in_reply_to":"1abeadc6_04ec898e","updated":"2014-08-27 22:52:50.000000000","message":"Done","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"f2b4dfc9e6cddd1e56c7e4b9c50268048d06454f","unresolved":false,"context_lines":[{"line_number":348,"context_line":"            try:"},{"line_number":349,"context_line":"                url \u003d six.moves.urllib.parse.urlparse(container_ref)"},{"line_number":350,"context_line":"                parts \u003d url.path.rstrip(\u0027/\u0027).split(\u0027/\u0027)"},{"line_number":351,"context_line":"                uuid.UUID(parts[-1])"},{"line_number":352,"context_line":"            except:"},{"line_number":353,"context_line":"                raise ValueError(\u0027Container incorrectly specified.\u0027)"},{"line_number":354,"context_line":"            resp \u003d self.api.get(container_ref)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_04ec898e","line":351,"in_reply_to":"1abeadc6_52865114","updated":"2014-08-27 16:21:38.000000000","message":"*Again*, this is mostly the same code maintained from the old versions of these classes. I suppose I really should have just written everything from scratch, since apparently all the stuff I did keep is bad. :P\n\nI\u0027ll move this whole thing into its own utility function, and add some comments to improve readability.","commit_id":"8710079ccc1af46e2c8dca3003710c2876adae7b"},{"author":{"_account_id":7262,"name":"John Vrbanac","email":"john.vrbanac@linux.com","username":"john.vrbanac"},"change_message_id":"b7f2835afaba7cdecfd6f168941090b1a95782ac","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":"def immutable_after_save(func):"},{"line_number":27,"context_line":"    @functools.wraps(func)"},{"line_number":28,"context_line":"    def wrapper(self, value1\u003dNone, value2\u003dNone):"},{"line_number":29,"context_line":"        if self._container_ref:"},{"line_number":30,"context_line":"            raise base.ImmutableException()"},{"line_number":31,"context_line":"        if value2:"}],"source_content_type":"text/x-python","patch_set":10,"id":"1abeadc6_516b8f1d","line":28,"updated":"2014-08-28 02:46:22.000000000","message":"what is value1 and value2?\nIf they\u0027re just generic values would it be better to take kwargs and then pass the kwargs through to the func(...)?","commit_id":"b5186e575cca1b5a7d749bf67bed484c6bffec40"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"a6c69dfa187d84c7b5a8fca1c2c35feea5a0d535","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":"def immutable_after_save(func):"},{"line_number":27,"context_line":"    @functools.wraps(func)"},{"line_number":28,"context_line":"    def wrapper(self, value1\u003dNone, value2\u003dNone):"},{"line_number":29,"context_line":"        if self._container_ref:"},{"line_number":30,"context_line":"            raise base.ImmutableException()"},{"line_number":31,"context_line":"        if value2:"}],"source_content_type":"text/x-python","patch_set":10,"id":"1abeadc6_b5712e0e","line":28,"in_reply_to":"1abeadc6_516b8f1d","updated":"2014-08-28 03:07:41.000000000","message":"They\u0027re not ACTUALLY kwargs, though they are just *args, so maybe that will work actually. I\u0027ll give it a shot. :)","commit_id":"b5186e575cca1b5a7d749bf67bed484c6bffec40"},{"author":{"_account_id":7262,"name":"John Vrbanac","email":"john.vrbanac@linux.com","username":"john.vrbanac"},"change_message_id":"b7f2835afaba7cdecfd6f168941090b1a95782ac","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        self._type \u003d type"},{"line_number":56,"context_line":"        self._secret_refs \u003d secret_refs"},{"line_number":57,"context_line":"        self._consumers \u003d consumers"},{"line_number":58,"context_line":"        if container_ref:"},{"line_number":59,"context_line":"            self._status \u003d status"},{"line_number":60,"context_line":"            self._created \u003d parse_isotime(created) if created else None"},{"line_number":61,"context_line":"            self._updated \u003d parse_isotime(updated) if updated else None"}],"source_content_type":"text/x-python","patch_set":10,"id":"1abeadc6_91dfe7d5","line":58,"updated":"2014-08-28 02:46:22.000000000","message":"Does it matter if container_ref was defined? if status wasn\u0027t passed through it\u0027s going to be none anyhow. likewise with created and updated. I\u0027m just wondering if this conditional is needed at all.","commit_id":"b5186e575cca1b5a7d749bf67bed484c6bffec40"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"a6c69dfa187d84c7b5a8fca1c2c35feea5a0d535","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        self._type \u003d type"},{"line_number":56,"context_line":"        self._secret_refs \u003d secret_refs"},{"line_number":57,"context_line":"        self._consumers \u003d consumers"},{"line_number":58,"context_line":"        if container_ref:"},{"line_number":59,"context_line":"            self._status \u003d status"},{"line_number":60,"context_line":"            self._created \u003d parse_isotime(created) if created else None"},{"line_number":61,"context_line":"            self._updated \u003d parse_isotime(updated) if updated else None"}],"source_content_type":"text/x-python","patch_set":10,"id":"1abeadc6_b5484eb4","line":58,"in_reply_to":"1abeadc6_91dfe7d5","updated":"2014-08-28 03:07:41.000000000","message":"I suppose now that I moved the filtering of user-input args up to the factory method, it is probably not necessary. When I was just passing kwargs through, it was necessary to prevent users from setting these. I can probably safely remove it.","commit_id":"b5186e575cca1b5a7d749bf67bed484c6bffec40"},{"author":{"_account_id":7262,"name":"John Vrbanac","email":"john.vrbanac@linux.com","username":"john.vrbanac"},"change_message_id":"b7f2835afaba7cdecfd6f168941090b1a95782ac","unresolved":false,"context_lines":[{"line_number":174,"context_line":"        sec \u003d [\u0027\"{0}\":\\n{1}\u0027.format(s.get(\u0027name\u0027),"},{"line_number":175,"context_line":"                                    base.indent_object_string(s.get(\u0027secret\u0027),"},{"line_number":176,"context_line":"                                                              4))"},{"line_number":177,"context_line":"               for s in self.secrets]"},{"line_number":178,"context_line":"        return (\"Container:\\n\""},{"line_number":179,"context_line":"                \"   href: {0}\\n\""},{"line_number":180,"context_line":"                \"   name: {1}\\n\""}],"source_content_type":"text/x-python","patch_set":10,"id":"1abeadc6_357fde67","line":177,"updated":"2014-08-28 02:46:22.000000000","message":"Yikes! Suggestion:\n\n    def __str__(self):\n        def format_secret(name, secret):\n            return \u0027\"{name}\":\\n{secret}\u0027.format(\n                name\u003dname,\n                secret\u003dbase.indent_object_string(secret, 4))\n\n        sec \u003d [format_secret(s.get(\u0027name\u0027), s.get(\u0027secret\u0027))\n               for s in self.secrets]\n\n        return (\"Container:\\n\"\n                \"   href: {href}\\n\"\n                \"   name: {name}\\n\"\n                \"   created: {created}\\n\"\n                \"   status: {status}\\n\"\n                \"   type: {container_type}\\n\"\n                \"   secrets:\\n\"\n                \"{secrets}\\n\"\n                \"   consumers: {consumers}\\n\"\n                .format(\n                     href\u003dself.container_ref,\n                     name\u003dself.name,\n                     created\u003dself.created,\n                     status\u003dself.status,\n                     container_type\u003dself.type,\n                     secrets\u003dbase.indent_object_string(\u0027\\n\u0027.join(sec)),\n                     consumers\u003dself.consumers)\n                )","commit_id":"b5186e575cca1b5a7d749bf67bed484c6bffec40"},{"author":{"_account_id":7262,"name":"John Vrbanac","email":"john.vrbanac@linux.com","username":"john.vrbanac"},"change_message_id":"b7f2835afaba7cdecfd6f168941090b1a95782ac","unresolved":false,"context_lines":[{"line_number":354,"context_line":"        :returns: Container object (possibly of a specific type)"},{"line_number":355,"context_line":"        \"\"\""},{"line_number":356,"context_line":"        LOG.debug(\u0027Getting container - Container href: {0}\u0027"},{"line_number":357,"context_line":"                  .format(container_ref))"},{"line_number":358,"context_line":"        if container_ref:"},{"line_number":359,"context_line":"            base.validate_ref(container_ref, \u0027Container\u0027)"},{"line_number":360,"context_line":"            response \u003d self.api.get(container_ref)"}],"source_content_type":"text/x-python","patch_set":10,"id":"1abeadc6_1524a25e","line":357,"updated":"2014-08-28 02:46:22.000000000","message":"According to the comment if a container_ref isn\u0027t specified then it\u0027ll create a new one. If that is the case, then this debug line is premature. As it\u0027ll be saying that it\u0027s getting the container href: None.","commit_id":"b5186e575cca1b5a7d749bf67bed484c6bffec40"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"a6c69dfa187d84c7b5a8fca1c2c35feea5a0d535","unresolved":false,"context_lines":[{"line_number":354,"context_line":"        :returns: Container object (possibly of a specific type)"},{"line_number":355,"context_line":"        \"\"\""},{"line_number":356,"context_line":"        LOG.debug(\u0027Getting container - Container href: {0}\u0027"},{"line_number":357,"context_line":"                  .format(container_ref))"},{"line_number":358,"context_line":"        if container_ref:"},{"line_number":359,"context_line":"            base.validate_ref(container_ref, \u0027Container\u0027)"},{"line_number":360,"context_line":"            response \u003d self.api.get(container_ref)"}],"source_content_type":"text/x-python","patch_set":10,"id":"1abeadc6_35a27e4b","line":357,"in_reply_to":"1abeadc6_1524a25e","updated":"2014-08-28 03:07:41.000000000","message":"Err, whoops yep that\u0027s in the wrong spot. I remember a comment about that earlier I think, must have just forgotten to fix it.","commit_id":"b5186e575cca1b5a7d749bf67bed484c6bffec40"},{"author":{"_account_id":7262,"name":"John Vrbanac","email":"john.vrbanac@linux.com","username":"john.vrbanac"},"change_message_id":"b7f2835afaba7cdecfd6f168941090b1a95782ac","unresolved":false,"context_lines":[{"line_number":373,"context_line":""},{"line_number":374,"context_line":"    def RSAContainer(self, container_ref\u003dNone, name\u003dNone):"},{"line_number":375,"context_line":"        if container_ref:"},{"line_number":376,"context_line":"            return self.Container(container_ref\u003dcontainer_ref, name\u003dname)"},{"line_number":377,"context_line":"        return RSAContainer(api\u003dself.api, type\u003d\u0027rsa\u0027, name\u003dname)"},{"line_number":378,"context_line":""},{"line_number":379,"context_line":"    def CertificateContainer(self, container_ref\u003dNone, name\u003dNone):"}],"source_content_type":"text/x-python","patch_set":10,"id":"1abeadc6_b5fdaeb3","line":376,"updated":"2014-08-28 02:46:22.000000000","message":"Does this mean that if you passed in a container_ref for a non-rsa container into RSAContainer, you could in theory get an non-rsa container return type?","commit_id":"b5186e575cca1b5a7d749bf67bed484c6bffec40"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"a6c69dfa187d84c7b5a8fca1c2c35feea5a0d535","unresolved":false,"context_lines":[{"line_number":373,"context_line":""},{"line_number":374,"context_line":"    def RSAContainer(self, container_ref\u003dNone, name\u003dNone):"},{"line_number":375,"context_line":"        if container_ref:"},{"line_number":376,"context_line":"            return self.Container(container_ref\u003dcontainer_ref, name\u003dname)"},{"line_number":377,"context_line":"        return RSAContainer(api\u003dself.api, type\u003d\u0027rsa\u0027, name\u003dname)"},{"line_number":378,"context_line":""},{"line_number":379,"context_line":"    def CertificateContainer(self, container_ref\u003dNone, name\u003dNone):"}],"source_content_type":"text/x-python","patch_set":10,"id":"1abeadc6_95a7d24f","line":376,"in_reply_to":"1abeadc6_b5fdaeb3","updated":"2014-08-28 03:07:41.000000000","message":"Technically yes, but I don\u0027t think that\u0027s necessarily a bad \"feature\". I could MAYBE see some confusion from a user who tries this and ends up with a different object type (I would definitely WTF myself), but the alternative is passing the type through and raising a TypeException or something in Container() if the fetched data isn\u0027t of the passed type. Do you think that\u0027s a better approach?","commit_id":"b5186e575cca1b5a7d749bf67bed484c6bffec40"},{"author":{"_account_id":7262,"name":"John Vrbanac","email":"john.vrbanac@linux.com","username":"john.vrbanac"},"change_message_id":"b7f2835afaba7cdecfd6f168941090b1a95782ac","unresolved":false,"context_lines":[{"line_number":431,"context_line":"                                          container_ref.split(\u0027/\u0027)[-1])"},{"line_number":432,"context_line":"        consumer_dict \u003d dict()"},{"line_number":433,"context_line":"        consumer_dict[\u0027name\u0027] \u003d name"},{"line_number":434,"context_line":"        consumer_dict[\u0027URL\u0027] \u003d URL"},{"line_number":435,"context_line":""},{"line_number":436,"context_line":"        response \u003d self.api.post(href, consumer_dict)"},{"line_number":437,"context_line":"        return self._container_map[response.get(\u0027type\u0027)](api\u003dself.api,"}],"source_content_type":"text/x-python","patch_set":10,"id":"1abeadc6_35b7def6","line":434,"updated":"2014-08-28 02:46:22.000000000","message":"Perhaps?:\n\n    consumer_dict \u003d {\n         \u0027name\u0027: name,\n         \u0027URL\u0027: URL\n    }","commit_id":"b5186e575cca1b5a7d749bf67bed484c6bffec40"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"a6c69dfa187d84c7b5a8fca1c2c35feea5a0d535","unresolved":false,"context_lines":[{"line_number":431,"context_line":"                                          container_ref.split(\u0027/\u0027)[-1])"},{"line_number":432,"context_line":"        consumer_dict \u003d dict()"},{"line_number":433,"context_line":"        consumer_dict[\u0027name\u0027] \u003d name"},{"line_number":434,"context_line":"        consumer_dict[\u0027URL\u0027] \u003d URL"},{"line_number":435,"context_line":""},{"line_number":436,"context_line":"        response \u003d self.api.post(href, consumer_dict)"},{"line_number":437,"context_line":"        return self._container_map[response.get(\u0027type\u0027)](api\u003dself.api,"}],"source_content_type":"text/x-python","patch_set":10,"id":"1abeadc6_d564ea23","line":434,"in_reply_to":"1abeadc6_35b7def6","updated":"2014-08-28 03:07:41.000000000","message":"Right. Derp.","commit_id":"b5186e575cca1b5a7d749bf67bed484c6bffec40"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"608b5fe7faec40682823bb27f0934416cb8e61a5","unresolved":false,"context_lines":[{"line_number":161,"context_line":"                return s.get(\u0027secret\u0027)"},{"line_number":162,"context_line":"        return None"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    def __str__(self):"},{"line_number":165,"context_line":"        sec \u003d [\u0027\"{0}\":\\n{1}\u0027.format(s.get(\u0027name\u0027),"},{"line_number":166,"context_line":"                                    base.indent_object_string(s.get(\u0027secret\u0027),"},{"line_number":167,"context_line":"                                                              4))"}],"source_content_type":"text/x-python","patch_set":12,"id":"1abeadc6_2faea798","line":164,"updated":"2014-08-28 07:20:27.000000000","message":"If you are now using _get_formatted_entity to display the Containers, what\u0027s the need now for this __str__ function? Seems to me that is not being used anymore, thus also getting rid of the need for the \"indent_object_string\" function also. Or, am I missing something?","commit_id":"de2a77feea1d9ea94450b4a657d232b9eea61492"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"0aa6f44349df997dde4aad0a6171cfdd40103835","unresolved":false,"context_lines":[{"line_number":161,"context_line":"                return s.get(\u0027secret\u0027)"},{"line_number":162,"context_line":"        return None"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    def __str__(self):"},{"line_number":165,"context_line":"        sec \u003d [\u0027\"{0}\":\\n{1}\u0027.format(s.get(\u0027name\u0027),"},{"line_number":166,"context_line":"                                    base.indent_object_string(s.get(\u0027secret\u0027),"},{"line_number":167,"context_line":"                                                              4))"}],"source_content_type":"text/x-python","patch_set":12,"id":"1abeadc6_25e227a0","line":164,"in_reply_to":"1abeadc6_1a903042","updated":"2014-08-29 00:02:03.000000000","message":"Here is a draft of what this would look like:\n\nhttps://gist.github.com/rm-you/7130dbdc858569657423\n\nWhat do you think? It simplifies things a lot, and the cool side-effect is that RSA/Certificate Containers don\u0027t even need to override the __str__ method, since they are based on different Formatters and it uses the one from the subclass (so long as you order the inheritance correctly)!\n\nThe only downside is that it looks a little icky in the barbican_cli methods, which end up not inheriting from the Formatters themselves, and using:\n\nreturn entity._get_formatted_entity(entity)\n\ninstead of:\n\nreturn self._get_formatted_entity(entity)\n\nwhich could be a little bit odd, but I think works fine.\n\nAll of this also rides on prettytable formatted __str__ being acceptable, since when you do the same to Secrets.__str__(), the nesting gets a little funky inside the Container.__str__(). :(","commit_id":"de2a77feea1d9ea94450b4a657d232b9eea61492"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"1bb7bcfce2cd61a551dd12af12954f2c56435286","unresolved":false,"context_lines":[{"line_number":161,"context_line":"                return s.get(\u0027secret\u0027)"},{"line_number":162,"context_line":"        return None"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    def __str__(self):"},{"line_number":165,"context_line":"        sec \u003d [\u0027\"{0}\":\\n{1}\u0027.format(s.get(\u0027name\u0027),"},{"line_number":166,"context_line":"                                    base.indent_object_string(s.get(\u0027secret\u0027),"},{"line_number":167,"context_line":"                                                              4))"}],"source_content_type":"text/x-python","patch_set":12,"id":"1abeadc6_1a903042","line":164,"in_reply_to":"1abeadc6_2faea798","updated":"2014-08-28 17:51:11.000000000","message":"It would be for being using python-barbicanclient as a python API for their own code, so they could have decent printouts of things. I don\u0027t know if we could use cliff for that as well? I guess maybe the cliff formatting functions are fine to use even if it is for use outside of CLI work?\n\nIf cliff formatters work here too, I will probably just replace them with that in all of these classes and call it good. If not, is this actually a blocker? The exact same code is used in my other CR in Secrets and Orders, but you\u0027ve only ever commented on it here (that is not an invitation to go -1 that CR too :P).","commit_id":"de2a77feea1d9ea94450b4a657d232b9eea61492"},{"author":{"_account_id":9234,"name":"Steve Heyman","email":"steve@heyman.com","username":"hockeynut"},"change_message_id":"45cf2e895087f49983fd58090573be6ffb04740b","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        Builds a container object from a dictionary."},{"line_number":46,"context_line":"        \"\"\""},{"line_number":47,"context_line":"        self._api \u003d api"},{"line_number":48,"context_line":"        self._cached_secrets \u003d list()"},{"line_number":49,"context_line":"        self._container_ref \u003d container_ref"},{"line_number":50,"context_line":"        self._name \u003d name"},{"line_number":51,"context_line":"        self._type \u003d type"}],"source_content_type":"text/x-python","patch_set":13,"id":"fa98f980_fa1052aa","line":48,"updated":"2014-09-08 23:51:45.000000000","message":"can you move this to after the setting of the instance variables (after line 56)?","commit_id":"73f071351860ee9a0cc6c7e9b0431f4f7effb54d"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"99fb4944e732ec69a39350f76729b2c64140e41c","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        Builds a container object from a dictionary."},{"line_number":46,"context_line":"        \"\"\""},{"line_number":47,"context_line":"        self._api \u003d api"},{"line_number":48,"context_line":"        self._cached_secrets \u003d list()"},{"line_number":49,"context_line":"        self._container_ref \u003d container_ref"},{"line_number":50,"context_line":"        self._name \u003d name"},{"line_number":51,"context_line":"        self._type \u003d type"}],"source_content_type":"text/x-python","patch_set":13,"id":"fa98f980_92628dd6","line":48,"in_reply_to":"fa98f980_fa1052aa","updated":"2014-09-10 15:21:38.000000000","message":"Sure, doesn\u0027t matter a ton to me where it goes.","commit_id":"73f071351860ee9a0cc6c7e9b0431f4f7effb54d"},{"author":{"_account_id":9234,"name":"Steve Heyman","email":"steve@heyman.com","username":"hockeynut"},"change_message_id":"45cf2e895087f49983fd58090573be6ffb04740b","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        \"\"\""},{"line_number":47,"context_line":"        self._api \u003d api"},{"line_number":48,"context_line":"        self._cached_secrets \u003d list()"},{"line_number":49,"context_line":"        self._container_ref \u003d container_ref"},{"line_number":50,"context_line":"        self._name \u003d name"},{"line_number":51,"context_line":"        self._type \u003d type"},{"line_number":52,"context_line":"        self._secret_refs \u003d secret_refs"}],"source_content_type":"text/x-python","patch_set":13,"id":"fa98f980_7a4542b2","line":49,"updated":"2014-09-08 23:51:45.000000000","message":"can you move container ref down to the end to match the order in the method signature?","commit_id":"73f071351860ee9a0cc6c7e9b0431f4f7effb54d"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"99fb4944e732ec69a39350f76729b2c64140e41c","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        \"\"\""},{"line_number":47,"context_line":"        self._api \u003d api"},{"line_number":48,"context_line":"        self._cached_secrets \u003d list()"},{"line_number":49,"context_line":"        self._container_ref \u003d container_ref"},{"line_number":50,"context_line":"        self._name \u003d name"},{"line_number":51,"context_line":"        self._type \u003d type"},{"line_number":52,"context_line":"        self._secret_refs \u003d secret_refs"}],"source_content_type":"text/x-python","patch_set":13,"id":"fa98f980_526825ba","line":49,"in_reply_to":"fa98f980_7a4542b2","updated":"2014-09-10 15:21:38.000000000","message":"Hmm, I think possibly I need to actually change the order of the args in the method signature. Either way, I\u0027ll get it to match order.","commit_id":"73f071351860ee9a0cc6c7e9b0431f4f7effb54d"},{"author":{"_account_id":9234,"name":"Steve Heyman","email":"steve@heyman.com","username":"hockeynut"},"change_message_id":"45cf2e895087f49983fd58090573be6ffb04740b","unresolved":false,"context_lines":[{"line_number":355,"context_line":"                                \u0027type \"{1}\".\u0027.format(resp_type, type))"},{"line_number":356,"context_line":"            container_type \u003d self._container_map.get(resp_type)"},{"line_number":357,"context_line":"            if not container_type:"},{"line_number":358,"context_line":"                return TypeError(\u0027Unknown container type \"{0}.\"\u0027"},{"line_number":359,"context_line":"                                 .format(resp_type))"},{"line_number":360,"context_line":"            return container_type(api\u003dself.api, **response)"},{"line_number":361,"context_line":"        if not type:"}],"source_content_type":"text/x-python","patch_set":13,"id":"fa98f980_6b764fda","line":358,"updated":"2014-09-08 23:51:45.000000000","message":"should this be raise?","commit_id":"73f071351860ee9a0cc6c7e9b0431f4f7effb54d"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"99fb4944e732ec69a39350f76729b2c64140e41c","unresolved":false,"context_lines":[{"line_number":355,"context_line":"                                \u0027type \"{1}\".\u0027.format(resp_type, type))"},{"line_number":356,"context_line":"            container_type \u003d self._container_map.get(resp_type)"},{"line_number":357,"context_line":"            if not container_type:"},{"line_number":358,"context_line":"                return TypeError(\u0027Unknown container type \"{0}.\"\u0027"},{"line_number":359,"context_line":"                                 .format(resp_type))"},{"line_number":360,"context_line":"            return container_type(api\u003dself.api, **response)"},{"line_number":361,"context_line":"        if not type:"}],"source_content_type":"text/x-python","patch_set":13,"id":"fa98f980_b2b4f135","line":358,"in_reply_to":"fa98f980_23b439d0","updated":"2014-09-10 15:21:38.000000000","message":"Derp.","commit_id":"73f071351860ee9a0cc6c7e9b0431f4f7effb54d"},{"author":{"_account_id":7789,"name":"John Wood","email":"john.wood@rackspace.com","username":"woodster"},"change_message_id":"82ccf28e5f9687347a1474a7d5bc2b2840d6d93f","unresolved":false,"context_lines":[{"line_number":355,"context_line":"                                \u0027type \"{1}\".\u0027.format(resp_type, type))"},{"line_number":356,"context_line":"            container_type \u003d self._container_map.get(resp_type)"},{"line_number":357,"context_line":"            if not container_type:"},{"line_number":358,"context_line":"                return TypeError(\u0027Unknown container type \"{0}.\"\u0027"},{"line_number":359,"context_line":"                                 .format(resp_type))"},{"line_number":360,"context_line":"            return container_type(api\u003dself.api, **response)"},{"line_number":361,"context_line":"        if not type:"}],"source_content_type":"text/x-python","patch_set":13,"id":"fa98f980_23b439d0","line":358,"in_reply_to":"fa98f980_6b764fda","updated":"2014-09-10 13:13:01.000000000","message":"Indeed!","commit_id":"73f071351860ee9a0cc6c7e9b0431f4f7effb54d"},{"author":{"_account_id":9234,"name":"Steve Heyman","email":"steve@heyman.com","username":"hockeynut"},"change_message_id":"45cf2e895087f49983fd58090573be6ffb04740b","unresolved":false,"context_lines":[{"line_number":387,"context_line":"        :param container_ref: The href for the container"},{"line_number":388,"context_line":"        \"\"\""},{"line_number":389,"context_line":"        if not container_ref:"},{"line_number":390,"context_line":"            raise ValueError(\u0027container_ref is required.\u0027)"},{"line_number":391,"context_line":"        self.api.delete(container_ref)"},{"line_number":392,"context_line":""},{"line_number":393,"context_line":"    def list(self, limit\u003d10, offset\u003d0, name\u003dNone, type\u003dNone):"}],"source_content_type":"text/x-python","patch_set":13,"id":"fa98f980_ab059715","line":390,"updated":"2014-09-08 23:51:45.000000000","message":"The parameter name to the client is URI - might be confusing if we are calling it container_ref here?\n\nSee barbicanclient/barbican_cli/containers.py line 54","commit_id":"73f071351860ee9a0cc6c7e9b0431f4f7effb54d"},{"author":{"_account_id":7789,"name":"John Wood","email":"john.wood@rackspace.com","username":"woodster"},"change_message_id":"82ccf28e5f9687347a1474a7d5bc2b2840d6d93f","unresolved":false,"context_lines":[{"line_number":387,"context_line":"        :param container_ref: The href for the container"},{"line_number":388,"context_line":"        \"\"\""},{"line_number":389,"context_line":"        if not container_ref:"},{"line_number":390,"context_line":"            raise ValueError(\u0027container_ref is required.\u0027)"},{"line_number":391,"context_line":"        self.api.delete(container_ref)"},{"line_number":392,"context_line":""},{"line_number":393,"context_line":"    def list(self, limit\u003d10, offset\u003d0, name\u003dNone, type\u003dNone):"}],"source_content_type":"text/x-python","patch_set":13,"id":"fa98f980_83ade58a","line":390,"in_reply_to":"fa98f980_ab059715","updated":"2014-09-10 13:13:01.000000000","message":"Steve, in both the client and API code bases we have been using \u0027xxxx_ref\u0027 to refer to the HATEOS reference to resources. For better or worse that is our de facto standard right now.","commit_id":"73f071351860ee9a0cc6c7e9b0431f4f7effb54d"},{"author":{"_account_id":7973,"name":"Douglas Mendizábal","email":"dmendiza@redhat.com","username":"dougmendizabal"},"change_message_id":"6f7e1755001d76f70c2efecc647fe80b2e0efb7e","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        return self._name"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    @property"},{"line_number":67,"context_line":"    def type(self):"},{"line_number":68,"context_line":"        return self._type"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":14,"id":"fa98f980_fe7d35b3","line":67,"updated":"2014-09-11 21:28:18.000000000","message":"I don\u0027t think we should expose the type of the container as a property.  I would prefer that the type be internal to the container objects, and that the value of this is implied by using the different Classes.\n\nThat means that a \"generic\" type would translate into a Container object in the client.  An \"rsa\" type would translate into an RSAContainer object, etc.\n\nI don\u0027t want consumers of this library to have to know what the valid strings for the different types are.  I think users would be better served by leveraging the python type system.","commit_id":"2da3c3d3828262c875bc45e1ab937c3691bab038"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"76e3b66763db171848dd33d67a75562077bb45d7","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        return self._name"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    @property"},{"line_number":67,"context_line":"    def type(self):"},{"line_number":68,"context_line":"        return self._type"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":14,"id":"fa98f980_52d1d055","line":67,"in_reply_to":"fa98f980_fe7d35b3","updated":"2014-09-11 22:54:36.000000000","message":"I am removing this at your request, but I would point out that:\n\nA) These are quite plainly expressed in the docs.\n\nB) Anyone using the actual CLI portion will need to know the correct string to pass to \"--type\".","commit_id":"2da3c3d3828262c875bc45e1ab937c3691bab038"},{"author":{"_account_id":7973,"name":"Douglas Mendizábal","email":"dmendiza@redhat.com","username":"dougmendizabal"},"change_message_id":"6f7e1755001d76f70c2efecc647fe80b2e0efb7e","unresolved":false,"context_lines":[{"line_number":331,"context_line":"    def __init__(self, api):"},{"line_number":332,"context_line":"        super(ContainerManager, self).__init__(api, \u0027containers\u0027)"},{"line_number":333,"context_line":""},{"line_number":334,"context_line":"    def Container(self, container_ref\u003dNone, name\u003dNone, type\u003dNone,"},{"line_number":335,"context_line":"                  secret_refs\u003dNone):"},{"line_number":336,"context_line":"        \"\"\""},{"line_number":337,"context_line":"        Factory method that either retrieves a Container from Barbican if"}],"source_content_type":"text/x-python","patch_set":14,"id":"fa98f980_de6a3119","line":334,"updated":"2014-09-11 21:28:18.000000000","message":"While this is a super clever way of pretending to instantiate a class off of the ContainerManager object, I have an issue wit the way that type mismatches are handled.  Specifically, it bothers me that something that looks like a constructor is returning a different object type than the class that it pretends to be.\n\nIn general, when I instantiate SomeClass(), I expect the object that is returned to be of the type SomeClass.  This is, by definition, the way Python works.  This method however, gives the appearance of being a Class, but it does not behave like one, and I think this may cause problems in the future.  Consider this code:\n\n\n    type(client.containers.Container(container_ref\u003d\"href_to_generic_container\"))\n    # returns Container class object\n    \n    type(client.containers.Container(container_ref\u003d\"href_to_rsa_container\"))\n    # returns RSAContainer class object\n\nThe first type call matches my expectations.  If I don\u0027t know any better, I would assume that Container is a class, and that I\u0027m instantiating it by passing the href to the constructor.\n\nThe second type call is weird to me, because it looks like I\u0027m instantiating a Container, but the object is actually of a different class.  The fact that the call to the same \"constructor\" returns different types of objects smells like bad code to me.  This would never happen when instantiating a real Class, so I think this is unexpected behavior, and has the potential to be painful in the future.\n\nI understand that this is a convenience for when the user does not know in advance what the type of the container is, and just has a URI.  I think that the correct way of handling this would be with a proper factory method, not one that pretends to be a Class object.\n\nI realize, we originally wanted to move away from get() methods in the EntityManagers, and that made sense for a simple entity like Secret.  But now that we\u0027re introducing entity heirarchies, I think we won\u0027t be able to do it correctly without a get() factory method.","commit_id":"2da3c3d3828262c875bc45e1ab937c3691bab038"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"76e3b66763db171848dd33d67a75562077bb45d7","unresolved":false,"context_lines":[{"line_number":331,"context_line":"    def __init__(self, api):"},{"line_number":332,"context_line":"        super(ContainerManager, self).__init__(api, \u0027containers\u0027)"},{"line_number":333,"context_line":""},{"line_number":334,"context_line":"    def Container(self, container_ref\u003dNone, name\u003dNone, type\u003dNone,"},{"line_number":335,"context_line":"                  secret_refs\u003dNone):"},{"line_number":336,"context_line":"        \"\"\""},{"line_number":337,"context_line":"        Factory method that either retrieves a Container from Barbican if"}],"source_content_type":"text/x-python","patch_set":14,"id":"fa98f980_121748ef","line":334,"in_reply_to":"fa98f980_de6a3119","updated":"2014-09-11 22:54:36.000000000","message":"I believe that OO entity hierarchies innately will never play well with type(). Using type() at all is a code smell to me. The more correct approach would probably be to use instanceof() here, if you actually wanted to check the type, and instanceof() would always return True for what you are expecting. I am strongly in favor of moving forward with this pattern.","commit_id":"2da3c3d3828262c875bc45e1ab937c3691bab038"},{"author":{"_account_id":7973,"name":"Douglas Mendizábal","email":"dmendiza@redhat.com","username":"dougmendizabal"},"change_message_id":"e6f73346c1193c753ed2c1547fdda14201a694b2","unresolved":false,"context_lines":[{"line_number":330,"context_line":"    def __init__(self, api):"},{"line_number":331,"context_line":"        super(ContainerManager, self).__init__(api, \u0027containers\u0027)"},{"line_number":332,"context_line":""},{"line_number":333,"context_line":"    def Container(self, container_ref\u003dNone, name\u003dNone, secret_refs\u003dNone,"},{"line_number":334,"context_line":"                  expected_type\u003dNone):"},{"line_number":335,"context_line":"        \"\"\""},{"line_number":336,"context_line":"        Factory method that either retrieves a Container from Barbican if"}],"source_content_type":"text/x-python","patch_set":15,"id":"fa98f980_07233d05","line":333,"updated":"2014-09-15 18:29:32.000000000","message":"Please see my comments in patch set 14 for the main reason I do not like this approach.\n\nI should also add that this is a pep-8 violation as well.  Methods should use all lowercase.\n\nhttp://legacy.python.org/dev/peps/pep-0008/#method-names-and-instance-variables","commit_id":"82f777ecbf0874cb5fc83c0c85f51e21fb10d594"},{"author":{"_account_id":9234,"name":"Steve Heyman","email":"steve@heyman.com","username":"hockeynut"},"change_message_id":"c21f1d1f71c8c95d1b187c568d6ece90f92de9fd","unresolved":false,"context_lines":[{"line_number":331,"context_line":"        super(ContainerManager, self).__init__(api, \u0027containers\u0027)"},{"line_number":332,"context_line":""},{"line_number":333,"context_line":"    def Container(self, container_ref\u003dNone, name\u003dNone, secret_refs\u003dNone,"},{"line_number":334,"context_line":"                  expected_type\u003dNone):"},{"line_number":335,"context_line":"        \"\"\""},{"line_number":336,"context_line":"        Factory method that either retrieves a Container from Barbican if"},{"line_number":337,"context_line":"        given a container_ref, or creates a new Container if not, and returns"}],"source_content_type":"text/x-python","patch_set":15,"id":"fa98f980_a3e6c2ae","line":334,"updated":"2014-09-16 19:24:55.000000000","message":"I think there are 2 issues\n\n1) naming.  The naming of this factory method sure looks like a constructor which leads to the confusion that Douglas mentioned.\n\n2) function.  Creating a new container based on the input (href, type) sure feels factory-ish to me.  \n\nSo, I think I\u0027m in the camp of making this a real factory method.","commit_id":"82f777ecbf0874cb5fc83c0c85f51e21fb10d594"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"dc337a4e7eb131ace4292d38cdc5f0a06c2f1175","unresolved":false,"context_lines":[{"line_number":331,"context_line":"        super(ContainerManager, self).__init__(api, \u0027containers\u0027)"},{"line_number":332,"context_line":""},{"line_number":333,"context_line":"    def Container(self, container_ref\u003dNone, name\u003dNone, secret_refs\u003dNone,"},{"line_number":334,"context_line":"                  expected_type\u003dNone):"},{"line_number":335,"context_line":"        \"\"\""},{"line_number":336,"context_line":"        Factory method that either retrieves a Container from Barbican if"},{"line_number":337,"context_line":"        given a container_ref, or creates a new Container if not, and returns"}],"source_content_type":"text/x-python","patch_set":15,"id":"fa98f980_e4e517dd","line":334,"in_reply_to":"fa98f980_a3e6c2ae","updated":"2014-09-17 16:15:37.000000000","message":"1) It shouldn\u0027t lead to confusion -- it only has here because you are looking so far into it and trying to disassociate it from the underlying class definition. If you were to look at it from the perspective of someone actually using this, it wouldn\u0027t be confusing at all -- especially in the newest patch I proposed, it can no longer return a different type, so it would be completely indistinguishable to a user from instantiating the class directly. They\u0027d never have time to be confused because it would *just work*.\n\n2) Yes, it is supposed to be a factory -- the only reason this is necessary is that there is no other way to pass the instantiated API class through from the manager to a subclass transparently. The other option, I suppose, would be forcing the user to instantiate the class directly and have them always pass the manager as the first object -- definitely doable, but not as straightforward to use. If you actually try *using* this instead of dissecting it here, you will see what I mean.\n\nBottom line, I believe any major changes to this would make the client library more difficult to use in practice.","commit_id":"82f777ecbf0874cb5fc83c0c85f51e21fb10d594"},{"author":{"_account_id":7973,"name":"Douglas Mendizábal","email":"dmendiza@redhat.com","username":"dougmendizabal"},"change_message_id":"e6f73346c1193c753ed2c1547fdda14201a694b2","unresolved":false,"context_lines":[{"line_number":360,"context_line":"            return container_type(api\u003dself.api, **response)"},{"line_number":361,"context_line":"        return Container(api\u003dself.api, name\u003dname, secret_refs\u003dsecret_refs)"},{"line_number":362,"context_line":""},{"line_number":363,"context_line":"    def RSAContainer(self, container_ref\u003dNone, name\u003dNone):"},{"line_number":364,"context_line":"        if container_ref:"},{"line_number":365,"context_line":"            return self.Container(container_ref\u003dcontainer_ref, name\u003dname,"},{"line_number":366,"context_line":"                                  expected_type\u003dRSAContainer)"}],"source_content_type":"text/x-python","patch_set":15,"id":"fa98f980_4719c5cf","line":363,"updated":"2014-09-15 18:29:32.000000000","message":"Method name is a pep-8 violation.","commit_id":"82f777ecbf0874cb5fc83c0c85f51e21fb10d594"},{"author":{"_account_id":7973,"name":"Douglas Mendizábal","email":"dmendiza@redhat.com","username":"dougmendizabal"},"change_message_id":"e6f73346c1193c753ed2c1547fdda14201a694b2","unresolved":false,"context_lines":[{"line_number":366,"context_line":"                                  expected_type\u003dRSAContainer)"},{"line_number":367,"context_line":"        return RSAContainer(api\u003dself.api, name\u003dname)"},{"line_number":368,"context_line":""},{"line_number":369,"context_line":"    def CertificateContainer(self, container_ref\u003dNone, name\u003dNone):"},{"line_number":370,"context_line":"        if container_ref:"},{"line_number":371,"context_line":"            return self.Container(container_ref\u003dcontainer_ref, name\u003dname,"},{"line_number":372,"context_line":"                                  expected_type\u003dCertificateContainer)"}],"source_content_type":"text/x-python","patch_set":15,"id":"fa98f980_4770e507","line":369,"updated":"2014-09-15 18:29:32.000000000","message":"Method name is a pep-8 violation.","commit_id":"82f777ecbf0874cb5fc83c0c85f51e21fb10d594"},{"author":{"_account_id":7262,"name":"John Vrbanac","email":"john.vrbanac@linux.com","username":"john.vrbanac"},"change_message_id":"8de79aceb1924ea70abdd3a99ba6c4b2af9fba04","unresolved":false,"context_lines":[{"line_number":381,"context_line":"                            .format(resp_type))"},{"line_number":382,"context_line":"        return container_type(api\u003dself.api, **response)"},{"line_number":383,"context_line":""},{"line_number":384,"context_line":"    def Container(self, container_ref\u003dNone, name\u003dNone, secret_refs\u003dNone):"},{"line_number":385,"context_line":"        \"\"\""},{"line_number":386,"context_line":"        Container factory method"},{"line_number":387,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"fa98f980_9d92f649","line":384,"updated":"2014-09-17 02:44:11.000000000","message":"I\u0027m not sure how I missed this on my prior review, but I am not a fan of the CamelCaps for method names in Python. Not only is it not Pythonic, but it goes against the naming conventions across the majority of Python projects. I am surprised that this wasn\u0027t caught by flake8. Anyhow, this should be changed to match Python and OpenStack naming standards.","commit_id":"942773ca22ae09de755dd671d443861b14c46870"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"bafd450a4edee06bfa5b8c1442aa5b6530224c1e","unresolved":false,"context_lines":[{"line_number":381,"context_line":"                            .format(resp_type))"},{"line_number":382,"context_line":"        return container_type(api\u003dself.api, **response)"},{"line_number":383,"context_line":""},{"line_number":384,"context_line":"    def Container(self, container_ref\u003dNone, name\u003dNone, secret_refs\u003dNone):"},{"line_number":385,"context_line":"        \"\"\""},{"line_number":386,"context_line":"        Container factory method"},{"line_number":387,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"fa98f980_82e5180c","line":384,"in_reply_to":"fa98f980_042a1b2c","updated":"2014-09-17 19:25:33.000000000","message":"I would actually compare this to the way generators are created in Python -- consider the following statements:\n\nmy_list \u003d [ i for i in range(1,10) ]\n\nmy_dict \u003d { i: 1 for i in range(1,10) }\n\nmy_tuple \u003d ( i for i in range(1,10) )\n\nGiven the way my_list and my_dict are created using comprehensions, one could infer that you could create a tuple using the same method. Of course, you would be wrong -- in reality, what the third statement creates is a generator object, not a tuple! That said, you\u0027d be hard pressed to actually notice the difference without directly inspecting the result, and I don\u0027t think anyone would argue that the generator is worse than the expected tuple. For most uses, the coder writing that line would never even realize the difference (as I did not for quite some time, until it was explicitly pointed out to me).\n\nThis is, in my opinion, one of the most elegant things that this language allows us to do -- silently and transparently improve usability and performance in the background, while letting the user continue using the syntax they\u0027re familiar with.","commit_id":"942773ca22ae09de755dd671d443861b14c46870"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"3e4138f46a55a8db9baf05473f6d41b98f9f4faf","unresolved":false,"context_lines":[{"line_number":381,"context_line":"                            .format(resp_type))"},{"line_number":382,"context_line":"        return container_type(api\u003dself.api, **response)"},{"line_number":383,"context_line":""},{"line_number":384,"context_line":"    def Container(self, container_ref\u003dNone, name\u003dNone, secret_refs\u003dNone):"},{"line_number":385,"context_line":"        \"\"\""},{"line_number":386,"context_line":"        Container factory method"},{"line_number":387,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"fa98f980_042a1b2c","line":384,"in_reply_to":"fa98f980_9d92f649","updated":"2014-09-17 16:25:12.000000000","message":"It is not \"CamelCaps\" on accident. It is specifically uppercase to masquerade as a Class. Something very similar is done by SQLAlchemy as well, though it is admittedly slightly different (and I would argue less straightforward): https://github.com/zzzeek/sqlalchemy/blob/master/lib/sqlalchemy/orm/session.py#L2345\n\nIn my opinion, changing this to lowercase would be *more* confusing than leaving it uppercase to masquerade as a Class. Anyone just *using* the client library should never even notice the difference. In our discussions of this over the past few days, I was unable to find a single use case where the result of running this function could be distinguished by a user from a standard class instantiation. If you can think any use case where this breaks, I would be more than happy to fix it or cede my argument if it is unfixable.","commit_id":"942773ca22ae09de755dd671d443861b14c46870"},{"author":{"_account_id":7262,"name":"John Vrbanac","email":"john.vrbanac@linux.com","username":"john.vrbanac"},"change_message_id":"8de79aceb1924ea70abdd3a99ba6c4b2af9fba04","unresolved":false,"context_lines":[{"line_number":383,"context_line":""},{"line_number":384,"context_line":"    def Container(self, container_ref\u003dNone, name\u003dNone, secret_refs\u003dNone):"},{"line_number":385,"context_line":"        \"\"\""},{"line_number":386,"context_line":"        Container factory method"},{"line_number":387,"context_line":""},{"line_number":388,"context_line":"        Either retrieves a Container from Barbican if given a container_ref,"},{"line_number":389,"context_line":"        or creates a new Container if not."}],"source_content_type":"text/x-python","patch_set":16,"id":"fa98f980_fde4e20f","line":386,"updated":"2014-09-17 02:44:11.000000000","message":"So, I\u0027m kind of confused by whats going on here... Maybe the comment is throwing me off here, but this isn\u0027t a factory method pattern, as that would imply that instantiation is deferred to concrete subclasses that implement a specific creational contract; which is not the case here. I think I get what you\u0027re trying to accomplish, but I think the way it\u0027s done here causes more confusion that it helps. If you\u0027re trying to create some sort of factory then it should comply with some form that represents more of an industry standard OO factory pattern; in a pythonic way of course.","commit_id":"942773ca22ae09de755dd671d443861b14c46870"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"27bdab08a01fb59a7dc78c9eb3eb776ecacf474c","unresolved":false,"context_lines":[{"line_number":383,"context_line":""},{"line_number":384,"context_line":"    def Container(self, container_ref\u003dNone, name\u003dNone, secret_refs\u003dNone):"},{"line_number":385,"context_line":"        \"\"\""},{"line_number":386,"context_line":"        Container factory method"},{"line_number":387,"context_line":""},{"line_number":388,"context_line":"        Either retrieves a Container from Barbican if given a container_ref,"},{"line_number":389,"context_line":"        or creates a new Container if not."}],"source_content_type":"text/x-python","patch_set":16,"id":"fa98f980_babfaa5f","line":386,"in_reply_to":"fa98f980_241e3f0e","updated":"2014-09-17 17:32:42.000000000","message":"The main things of importance here are:\n\nA) It will either create a new object, *or* retrieve an existing one.\n\nB) It passes through the \"api\" client object transparently from the Manager to the real Class.","commit_id":"942773ca22ae09de755dd671d443861b14c46870"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"3e4138f46a55a8db9baf05473f6d41b98f9f4faf","unresolved":false,"context_lines":[{"line_number":383,"context_line":""},{"line_number":384,"context_line":"    def Container(self, container_ref\u003dNone, name\u003dNone, secret_refs\u003dNone):"},{"line_number":385,"context_line":"        \"\"\""},{"line_number":386,"context_line":"        Container factory method"},{"line_number":387,"context_line":""},{"line_number":388,"context_line":"        Either retrieves a Container from Barbican if given a container_ref,"},{"line_number":389,"context_line":"        or creates a new Container if not."}],"source_content_type":"text/x-python","patch_set":16,"id":"fa98f980_241e3f0e","line":386,"in_reply_to":"fa98f980_fde4e20f","updated":"2014-09-17 16:25:12.000000000","message":"In its original incarnation, this perfectly followed the \"factory method pattern\". Now it doesn\u0027t strictly follow the \"pattern\" because it no longer makes use of inheritance, but it is still a \"factory method\" per the definition of a \"factory method\".\n\nFrom Wikipedia on Factory Method Pattern:\n\n\"The factory method pattern should not be confused with the more general notion of factories and factory methods. The factory method pattern is the best-known use of factories and factory methods, but not all uses of factory methods are examples of the factory method pattern – only when inheritance is involved (a class implementing an interface, or derived class, implements a factory method) is it an example of the factory method pattern. More basic uses of factories are not examples of the factory method pattern, and may instead be referred to as the factory pattern or a simple factory\"\n\nhttp://en.wikipedia.org/wiki/Factory_method_pattern\n\nhttp://en.wikipedia.org/wiki/Factory_(object-oriented_programming)","commit_id":"942773ca22ae09de755dd671d443861b14c46870"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"ea9b0264134cbdcc5d6f2892a728137d16b04590","unresolved":false,"context_lines":[{"line_number":488,"context_line":"        params \u003d {\u0027limit\u0027: limit, \u0027offset\u0027: offset}"},{"line_number":489,"context_line":"        if name:"},{"line_number":490,"context_line":"            params[\u0027name\u0027] \u003d name"},{"line_number":491,"context_line":"        if name:"},{"line_number":492,"context_line":"            params[\u0027type\u0027] \u003d type"},{"line_number":493,"context_line":""},{"line_number":494,"context_line":"        response \u003d self.api.get(href, params)"}],"source_content_type":"text/x-python","patch_set":16,"id":"fa98f980_8587e2b5","line":491,"updated":"2014-09-17 20:27:20.000000000","message":"Whoops, just noticed this copy/paste fail... T_T","commit_id":"942773ca22ae09de755dd671d443861b14c46870"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"5aec8c932abf32a30cd0fbd5a2fbd1a4a39bf619","unresolved":false,"context_lines":[{"line_number":372,"context_line":"                            .format(resp_type))"},{"line_number":373,"context_line":"        return container_type(api\u003dself.api, **response)"},{"line_number":374,"context_line":""},{"line_number":375,"context_line":"    def container(self, container_ref\u003dNone, name\u003dNone, secret_refs\u003dNone):"},{"line_number":376,"context_line":"        \"\"\""},{"line_number":377,"context_line":"        Container factory method"},{"line_number":378,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"fa98f980_59a077a5","line":375,"updated":"2014-09-18 12:29:18.000000000","message":"I followed briefly the debate regarding having capitalized functions. And I actually agree in the fact that python functions should not be capitalized. Yet, now that this function was left this way, I feel that if I would read this as a new-commer, it would be quite confusing to read a function called \"container\". Since it doesn\u0027t really tell what this actually does.","commit_id":"04fb5880ceea29109c697ebf35267e7d67211847"},{"author":{"_account_id":7789,"name":"John Wood","email":"john.wood@rackspace.com","username":"woodster"},"change_message_id":"7c542e5347950578e859dcda43acd06e6ed6b203","unresolved":false,"context_lines":[{"line_number":372,"context_line":"                            .format(resp_type))"},{"line_number":373,"context_line":"        return container_type(api\u003dself.api, **response)"},{"line_number":374,"context_line":""},{"line_number":375,"context_line":"    def container(self, container_ref\u003dNone, name\u003dNone, secret_refs\u003dNone):"},{"line_number":376,"context_line":"        \"\"\""},{"line_number":377,"context_line":"        Container factory method"},{"line_number":378,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"fa98f980_9f70eea5","line":375,"in_reply_to":"fa98f980_41b86ec7","updated":"2014-09-18 23:46:11.000000000","message":"Yeah, I think \u0027get_container()\u0027 is better here.","commit_id":"04fb5880ceea29109c697ebf35267e7d67211847"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"977b9f0178400200b732aa557542ffb9c32b50b2","unresolved":false,"context_lines":[{"line_number":372,"context_line":"                            .format(resp_type))"},{"line_number":373,"context_line":"        return container_type(api\u003dself.api, **response)"},{"line_number":374,"context_line":""},{"line_number":375,"context_line":"    def container(self, container_ref\u003dNone, name\u003dNone, secret_refs\u003dNone):"},{"line_number":376,"context_line":"        \"\"\""},{"line_number":377,"context_line":"        Container factory method"},{"line_number":378,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"fa98f980_41b86ec7","line":375,"in_reply_to":"fa98f980_59a077a5","updated":"2014-09-18 20:29:57.000000000","message":"Yeah I am not sure at this point. Maybe this needs to go back to \"get_container( )\" and \"get_\u003ctype\u003e_container( )\", or possibly even remove the \"get_\u003ctype\u003e_container( )\" functions and rely solely on the \"expected_type\" arg in \"get_container( )\"...","commit_id":"04fb5880ceea29109c697ebf35267e7d67211847"},{"author":{"_account_id":7973,"name":"Douglas Mendizábal","email":"dmendiza@redhat.com","username":"dougmendizabal"},"change_message_id":"bf7a363a811a800f055db92c718edec54778513b","unresolved":false,"context_lines":[{"line_number":372,"context_line":"                            .format(resp_type))"},{"line_number":373,"context_line":"        return container_type(api\u003dself.api, **response)"},{"line_number":374,"context_line":""},{"line_number":375,"context_line":"    def container(self, container_ref\u003dNone, name\u003dNone, secret_refs\u003dNone):"},{"line_number":376,"context_line":"        \"\"\""},{"line_number":377,"context_line":"        Container factory method"},{"line_number":378,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"da9df570_96c1ee30","line":375,"in_reply_to":"fa98f980_9f70eea5","updated":"2014-09-22 16:40:26.000000000","message":"I would argue that just \"get( ... )\" would be best to be consistent with other OpenStack clients.  We would still need these factory methods for brand new (not in barbican) containers though.","commit_id":"04fb5880ceea29109c697ebf35267e7d67211847"},{"author":{"_account_id":7973,"name":"Douglas Mendizábal","email":"dmendiza@redhat.com","username":"dougmendizabal"},"change_message_id":"bf7a363a811a800f055db92c718edec54778513b","unresolved":false,"context_lines":[{"line_number":453,"context_line":"            secret_refs\u003dsecret_refs"},{"line_number":454,"context_line":"        )"},{"line_number":455,"context_line":""},{"line_number":456,"context_line":"    def delete(self, container_ref):"},{"line_number":457,"context_line":"        \"\"\""},{"line_number":458,"context_line":"        Deletes a container"},{"line_number":459,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"da9df570_56230605","line":456,"updated":"2014-09-22 16:40:26.000000000","message":"It would be good if the Container objects also had a delete() method so we don\u0027t have to keep a reference to the manager externally.   This is still good for deleting with only one request.","commit_id":"04fb5880ceea29109c697ebf35267e7d67211847"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"19016953d98227949a7ac37e2a426e3901065718","unresolved":false,"context_lines":[{"line_number":23,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"def immutable_after_save(func):"},{"line_number":27,"context_line":"    @functools.wraps(func)"},{"line_number":28,"context_line":"    def wrapper(self, *args):"},{"line_number":29,"context_line":"        if hasattr(self, \u0027_container_ref\u0027) and self._container_ref:"}],"source_content_type":"text/x-python","patch_set":20,"id":"da9df570_a7db071a","line":26,"updated":"2014-09-23 07:31:41.000000000","message":"I think you should use a more explicit name, since this only applies to containers... or structures that have the attribute \"_container_ref\"; Thus, the name is not fitting. Or better yet, if this only applies to containers, or only this module, then make this private for the module :)","commit_id":"cb74741b9f206598b6f68018415b6c898a4d256a"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"7eaa242788b5a8eff1a90eeb933b2209031ade7f","unresolved":false,"context_lines":[{"line_number":23,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"def immutable_after_save(func):"},{"line_number":27,"context_line":"    @functools.wraps(func)"},{"line_number":28,"context_line":"    def wrapper(self, *args):"},{"line_number":29,"context_line":"        if hasattr(self, \u0027_container_ref\u0027) and self._container_ref:"}],"source_content_type":"text/x-python","patch_set":20,"id":"da9df570_1247a51e","line":26,"in_reply_to":"da9df570_7a3c5630","updated":"2014-09-23 15:38:02.000000000","message":"Done","commit_id":"cb74741b9f206598b6f68018415b6c898a4d256a"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"9f118ed601d9d7f53f9e23bcaf81a6b2541dd8e2","unresolved":false,"context_lines":[{"line_number":23,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"def immutable_after_save(func):"},{"line_number":27,"context_line":"    @functools.wraps(func)"},{"line_number":28,"context_line":"    def wrapper(self, *args):"},{"line_number":29,"context_line":"        if hasattr(self, \u0027_container_ref\u0027) and self._container_ref:"}],"source_content_type":"text/x-python","patch_set":20,"id":"da9df570_7a3c5630","line":26,"in_reply_to":"da9df570_a7db071a","updated":"2014-09-23 07:59:05.000000000","message":"Yeah, there\u0027s one of these specific to each type of object. I can make it private, I think.","commit_id":"cb74741b9f206598b6f68018415b6c898a4d256a"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"19016953d98227949a7ac37e2a426e3901065718","unresolved":false,"context_lines":[{"line_number":49,"context_line":"        self._name \u003d name"},{"line_number":50,"context_line":"        self._secret_refs \u003d secret_refs"},{"line_number":51,"context_line":"        self._cached_secrets \u003d list()"},{"line_number":52,"context_line":"        if secrets:"},{"line_number":53,"context_line":"            try:"},{"line_number":54,"context_line":"                # Fill our _cached_secrets if we are adding a combination of"},{"line_number":55,"context_line":"                # secret_refs and secrets, otherwise don\u0027t do this yet and"}],"source_content_type":"text/x-python","patch_set":20,"id":"da9df570_e7042f80","line":52,"updated":"2014-09-23 07:31:41.000000000","message":"could you move this whole thing to a separate function? It distracts the purpose of the __init__","commit_id":"cb74741b9f206598b6f68018415b6c898a4d256a"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"7eaa242788b5a8eff1a90eeb933b2209031ade7f","unresolved":false,"context_lines":[{"line_number":49,"context_line":"        self._name \u003d name"},{"line_number":50,"context_line":"        self._secret_refs \u003d secret_refs"},{"line_number":51,"context_line":"        self._cached_secrets \u003d list()"},{"line_number":52,"context_line":"        if secrets:"},{"line_number":53,"context_line":"            try:"},{"line_number":54,"context_line":"                # Fill our _cached_secrets if we are adding a combination of"},{"line_number":55,"context_line":"                # secret_refs and secrets, otherwise don\u0027t do this yet and"}],"source_content_type":"text/x-python","patch_set":20,"id":"da9df570_52512dd7","line":52,"in_reply_to":"da9df570_ba46bebd","updated":"2014-09-23 15:38:02.000000000","message":"Done","commit_id":"cb74741b9f206598b6f68018415b6c898a4d256a"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"9f118ed601d9d7f53f9e23bcaf81a6b2541dd8e2","unresolved":false,"context_lines":[{"line_number":49,"context_line":"        self._name \u003d name"},{"line_number":50,"context_line":"        self._secret_refs \u003d secret_refs"},{"line_number":51,"context_line":"        self._cached_secrets \u003d list()"},{"line_number":52,"context_line":"        if secrets:"},{"line_number":53,"context_line":"            try:"},{"line_number":54,"context_line":"                # Fill our _cached_secrets if we are adding a combination of"},{"line_number":55,"context_line":"                # secret_refs and secrets, otherwise don\u0027t do this yet and"}],"source_content_type":"text/x-python","patch_set":20,"id":"da9df570_ba46bebd","line":52,"in_reply_to":"da9df570_e7042f80","updated":"2014-09-23 07:59:05.000000000","message":"Yeah, can do.","commit_id":"cb74741b9f206598b6f68018415b6c898a4d256a"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"19016953d98227949a7ac37e2a426e3901065718","unresolved":false,"context_lines":[{"line_number":104,"context_line":"            ]"},{"line_number":105,"context_line":"        return self._secret_refs"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    def _fill_secrets(self):"},{"line_number":108,"context_line":"        if self._secret_refs:"},{"line_number":109,"context_line":"            self._cached_secrets \u003d ["},{"line_number":110,"context_line":"                {"}],"source_content_type":"text/x-python","patch_set":20,"id":"da9df570_673f5f26","line":107,"updated":"2014-09-23 07:31:41.000000000","message":"This function seems to be set kind of randomly amongst properties, can you move this somewhere else?","commit_id":"cb74741b9f206598b6f68018415b6c898a4d256a"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"9f118ed601d9d7f53f9e23bcaf81a6b2541dd8e2","unresolved":false,"context_lines":[{"line_number":104,"context_line":"            ]"},{"line_number":105,"context_line":"        return self._secret_refs"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    def _fill_secrets(self):"},{"line_number":108,"context_line":"        if self._secret_refs:"},{"line_number":109,"context_line":"            self._cached_secrets \u003d ["},{"line_number":110,"context_line":"                {"}],"source_content_type":"text/x-python","patch_set":20,"id":"da9df570_5a26b217","line":107,"in_reply_to":"da9df570_673f5f26","updated":"2014-09-23 07:59:05.000000000","message":"Sure.","commit_id":"cb74741b9f206598b6f68018415b6c898a4d256a"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"19016953d98227949a7ac37e2a426e3901065718","unresolved":false,"context_lines":[{"line_number":135,"context_line":"            raise ValueError(\"Must provide a valid Secret object\")"},{"line_number":136,"context_line":"        self._cached_secrets.append({\u0027name\u0027: name.lower(), \u0027secret\u0027: sec})"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"    def _get_secrets_and_store_them_if_necessary(self):"},{"line_number":139,"context_line":"        # Save all secrets if they are not yet saved"},{"line_number":140,"context_line":"        LOG.debug(\"Storing secrets: {0}\".format(self.secrets))"},{"line_number":141,"context_line":"        secret_refs \u003d []"}],"source_content_type":"text/x-python","patch_set":20,"id":"da9df570_67267f18","line":138,"updated":"2014-09-23 07:31:41.000000000","message":"good naming :)","commit_id":"cb74741b9f206598b6f68018415b6c898a4d256a"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"19016953d98227949a7ac37e2a426e3901065718","unresolved":false,"context_lines":[{"line_number":194,"context_line":"        self._updated \u003d parse_isotime(updated) if updated else None"},{"line_number":195,"context_line":"        self._status \u003d response.get(\u0027status\u0027)"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"    def _get_named_secret(self, name):"},{"line_number":198,"context_line":"        for s in self.secrets:"},{"line_number":199,"context_line":"            if s.get(\u0027name\u0027) \u003d\u003d name.lower():"},{"line_number":200,"context_line":"                return s.get(\u0027secret\u0027)"}],"source_content_type":"text/x-python","patch_set":20,"id":"da9df570_676d9f32","line":197,"updated":"2014-09-23 07:31:41.000000000","message":"So, this only gets the first named secret? or how is this supposed to be?","commit_id":"cb74741b9f206598b6f68018415b6c898a4d256a"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"9f118ed601d9d7f53f9e23bcaf81a6b2541dd8e2","unresolved":false,"context_lines":[{"line_number":194,"context_line":"        self._updated \u003d parse_isotime(updated) if updated else None"},{"line_number":195,"context_line":"        self._status \u003d response.get(\u0027status\u0027)"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"    def _get_named_secret(self, name):"},{"line_number":198,"context_line":"        for s in self.secrets:"},{"line_number":199,"context_line":"            if s.get(\u0027name\u0027) \u003d\u003d name.lower():"},{"line_number":200,"context_line":"                return s.get(\u0027secret\u0027)"}],"source_content_type":"text/x-python","patch_set":20,"id":"da9df570_fa7e86e3","line":197,"in_reply_to":"da9df570_676d9f32","updated":"2014-09-23 07:59:05.000000000","message":"Yes, it is private and only called by subclasses, and it does get the first secret of that name. I can rename this to make that clearer, it isn\u0027t a big deal.","commit_id":"cb74741b9f206598b6f68018415b6c898a4d256a"},{"author":{"_account_id":7973,"name":"Douglas Mendizábal","email":"dmendiza@redhat.com","username":"dougmendizabal"},"change_message_id":"ab045e3d51bccffff5c5f3d51905230c7030a4fa","unresolved":false,"context_lines":[{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    def __init__(self, api, name\u003dNone, secrets\u003dNone, consumers\u003dNone,"},{"line_number":43,"context_line":"                 container_ref\u003dNone, created\u003dNone, updated\u003dNone, status\u003dNone,"},{"line_number":44,"context_line":"                 secret_refs\u003dNone):"},{"line_number":45,"context_line":"        \"\"\""},{"line_number":46,"context_line":"        Builds a container object from a dictionary."},{"line_number":47,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":22,"id":"da9df570_3ad381d7","line":44,"updated":"2014-09-24 14:35:28.000000000","message":"I think the expected data structure for secret_refs is too complex for a python argument.  I realize you\u0027re just passing the json response through, which makes it convenient for the purpose of writing this library, but not very friendly for a savvy user that wants to instantiate Containers directly.\n\nI would prefer that the secret_refs data structure here be just a plain dict.  e.g.\n\n    secret_refs \u003d {\"secret_name\": \"http://the_secret_ref\",\n                   \"another_secret\": \"http://another_secret_ref\"}\n\nThis makes it super easy to build up the argument, instead of having to describe and document that secret_refs should be a list of dicts, where each dict has to have both a \"name\" and \"ref\" key.","commit_id":"d7b4654d82796c2a47fbda06ea25e7af5d2ca6b8"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"503cb041a7152e0bee3d6cc39ec96348b3b16cd5","unresolved":false,"context_lines":[{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    def __init__(self, api, name\u003dNone, secrets\u003dNone, consumers\u003dNone,"},{"line_number":43,"context_line":"                 container_ref\u003dNone, created\u003dNone, updated\u003dNone, status\u003dNone,"},{"line_number":44,"context_line":"                 secret_refs\u003dNone):"},{"line_number":45,"context_line":"        \"\"\""},{"line_number":46,"context_line":"        Builds a container object from a dictionary."},{"line_number":47,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":22,"id":"da9df570_91e8d311","line":44,"in_reply_to":"da9df570_3ad381d7","updated":"2014-09-24 15:15:42.000000000","message":"1) secret_refs should not be used by clients, \"secrets\" should be used by clients.\n\n2) secret_refs is used by the CLI handlers because of how secrets are passed in via CLI, and the user never has to see this structure.\n\n3) Most importantly, it CAN\u0027T be a dict, because there can be multiple secrets with the same name. I *wanted* to just use a plain dict, but it won\u0027t work because it didn\u0027t allow duplicate secret-names.","commit_id":"d7b4654d82796c2a47fbda06ea25e7af5d2ca6b8"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"17aa2ae2b22323ef3dffad359152f13c05c691ba","unresolved":false,"context_lines":[{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    def __init__(self, api, name\u003dNone, secrets\u003dNone, consumers\u003dNone,"},{"line_number":43,"context_line":"                 container_ref\u003dNone, created\u003dNone, updated\u003dNone, status\u003dNone,"},{"line_number":44,"context_line":"                 secret_refs\u003dNone):"},{"line_number":45,"context_line":"        \"\"\""},{"line_number":46,"context_line":"        Builds a container object from a dictionary."},{"line_number":47,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":22,"id":"da9df570_3d9e1657","line":44,"in_reply_to":"da9df570_91e8d311","updated":"2014-09-24 21:37:46.000000000","message":"Ok, so per discussion, that is incorrect, and it CAN be a dict, because Containers are validated to not contain duplicate names... I swear I brought that up at the mid-cycle meet and was told it *didn\u0027t* validate that, but it\u0027s clear from the validator code that it does. Fixing!","commit_id":"d7b4654d82796c2a47fbda06ea25e7af5d2ca6b8"},{"author":{"_account_id":7973,"name":"Douglas Mendizábal","email":"dmendiza@redhat.com","username":"dougmendizabal"},"change_message_id":"ab045e3d51bccffff5c5f3d51905230c7030a4fa","unresolved":false,"context_lines":[{"line_number":43,"context_line":"                 container_ref\u003dNone, created\u003dNone, updated\u003dNone, status\u003dNone,"},{"line_number":44,"context_line":"                 secret_refs\u003dNone):"},{"line_number":45,"context_line":"        \"\"\""},{"line_number":46,"context_line":"        Builds a container object from a dictionary."},{"line_number":47,"context_line":"        \"\"\""},{"line_number":48,"context_line":"        self._api \u003d api"},{"line_number":49,"context_line":"        self._name \u003d name"}],"source_content_type":"text/x-python","patch_set":22,"id":"da9df570_14d77fee","line":46,"updated":"2014-09-24 14:35:28.000000000","message":"This docstring isn\u0027t accurate anymore.","commit_id":"d7b4654d82796c2a47fbda06ea25e7af5d2ca6b8"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"503cb041a7152e0bee3d6cc39ec96348b3b16cd5","unresolved":false,"context_lines":[{"line_number":43,"context_line":"                 container_ref\u003dNone, created\u003dNone, updated\u003dNone, status\u003dNone,"},{"line_number":44,"context_line":"                 secret_refs\u003dNone):"},{"line_number":45,"context_line":"        \"\"\""},{"line_number":46,"context_line":"        Builds a container object from a dictionary."},{"line_number":47,"context_line":"        \"\"\""},{"line_number":48,"context_line":"        self._api \u003d api"},{"line_number":49,"context_line":"        self._name \u003d name"}],"source_content_type":"text/x-python","patch_set":22,"id":"da9df570_914c5372","line":46,"in_reply_to":"da9df570_14d77fee","updated":"2014-09-24 15:15:42.000000000","message":"True. Will fix.","commit_id":"d7b4654d82796c2a47fbda06ea25e7af5d2ca6b8"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"17aa2ae2b22323ef3dffad359152f13c05c691ba","unresolved":false,"context_lines":[{"line_number":43,"context_line":"                 container_ref\u003dNone, created\u003dNone, updated\u003dNone, status\u003dNone,"},{"line_number":44,"context_line":"                 secret_refs\u003dNone):"},{"line_number":45,"context_line":"        \"\"\""},{"line_number":46,"context_line":"        Builds a container object from a dictionary."},{"line_number":47,"context_line":"        \"\"\""},{"line_number":48,"context_line":"        self._api \u003d api"},{"line_number":49,"context_line":"        self._name \u003d name"}],"source_content_type":"text/x-python","patch_set":22,"id":"da9df570_bd9be670","line":46,"in_reply_to":"da9df570_914c5372","updated":"2014-09-24 21:37:46.000000000","message":"Done","commit_id":"d7b4654d82796c2a47fbda06ea25e7af5d2ca6b8"},{"author":{"_account_id":7973,"name":"Douglas Mendizábal","email":"dmendiza@redhat.com","username":"dougmendizabal"},"change_message_id":"ab045e3d51bccffff5c5f3d51905230c7030a4fa","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        if self._secret_refs:"},{"line_number":78,"context_line":"            self._cached_secrets \u003d ["},{"line_number":79,"context_line":"                {"},{"line_number":80,"context_line":"                    \u0027name\u0027: s.get(\u0027name\u0027).lower(),"},{"line_number":81,"context_line":"                    \u0027secret\u0027: self._api.secrets.Secret("},{"line_number":82,"context_line":"                        secret_ref\u003ds.get(\u0027secret_ref\u0027))"},{"line_number":83,"context_line":"                } for s in self._secret_refs"}],"source_content_type":"text/x-python","patch_set":22,"id":"da9df570_f4f2fb98","line":80,"updated":"2014-09-24 14:35:28.000000000","message":"Could you replace \"s\" with \"secret\" for better readability?","commit_id":"d7b4654d82796c2a47fbda06ea25e7af5d2ca6b8"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"17aa2ae2b22323ef3dffad359152f13c05c691ba","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        if self._secret_refs:"},{"line_number":78,"context_line":"            self._cached_secrets \u003d ["},{"line_number":79,"context_line":"                {"},{"line_number":80,"context_line":"                    \u0027name\u0027: s.get(\u0027name\u0027).lower(),"},{"line_number":81,"context_line":"                    \u0027secret\u0027: self._api.secrets.Secret("},{"line_number":82,"context_line":"                        secret_ref\u003ds.get(\u0027secret_ref\u0027))"},{"line_number":83,"context_line":"                } for s in self._secret_refs"}],"source_content_type":"text/x-python","patch_set":22,"id":"da9df570_9da0e2a0","line":80,"in_reply_to":"da9df570_f4f2fb98","updated":"2014-09-24 21:37:46.000000000","message":"I feel like the var \"secret\" is really overloaded by now, but yeah, it\u0027s fine in this scope.","commit_id":"d7b4654d82796c2a47fbda06ea25e7af5d2ca6b8"},{"author":{"_account_id":7973,"name":"Douglas Mendizábal","email":"dmendiza@redhat.com","username":"dougmendizabal"},"change_message_id":"387aa90670125eec9d48e95fc71f2a54a626322b","unresolved":false,"context_lines":[{"line_number":108,"context_line":"        return self._status"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    @property"},{"line_number":111,"context_line":"    def secret_refs(self):"},{"line_number":112,"context_line":"        if self._cached_secrets:"},{"line_number":113,"context_line":"            self._secret_refs \u003d ["},{"line_number":114,"context_line":"                {\u0027name\u0027: sec.get(\u0027name\u0027),"}],"source_content_type":"text/x-python","patch_set":22,"id":"da9df570_2eb982e9","line":111,"updated":"2014-09-24 14:47:36.000000000","message":"Not sure that exposing this is necessary.","commit_id":"d7b4654d82796c2a47fbda06ea25e7af5d2ca6b8"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"503cb041a7152e0bee3d6cc39ec96348b3b16cd5","unresolved":false,"context_lines":[{"line_number":108,"context_line":"        return self._status"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    @property"},{"line_number":111,"context_line":"    def secret_refs(self):"},{"line_number":112,"context_line":"        if self._cached_secrets:"},{"line_number":113,"context_line":"            self._secret_refs \u003d ["},{"line_number":114,"context_line":"                {\u0027name\u0027: sec.get(\u0027name\u0027),"}],"source_content_type":"text/x-python","patch_set":22,"id":"da9df570_51c58b8c","line":111,"in_reply_to":"da9df570_2eb982e9","updated":"2014-09-24 15:15:42.000000000","message":"It\u0027s not strictly necessary, but I believe it could be useful and there\u0027s no reason to NOT expose it.","commit_id":"d7b4654d82796c2a47fbda06ea25e7af5d2ca6b8"},{"author":{"_account_id":7973,"name":"Douglas Mendizábal","email":"dmendiza@redhat.com","username":"dougmendizabal"},"change_message_id":"387aa90670125eec9d48e95fc71f2a54a626322b","unresolved":false,"context_lines":[{"line_number":118,"context_line":"        return self._secret_refs"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    @property"},{"line_number":121,"context_line":"    def secrets(self, cache\u003dTrue):"},{"line_number":122,"context_line":"        if not self._cached_secrets or not cache:"},{"line_number":123,"context_line":"            self._fill_secrets_from_secret_refs()"},{"line_number":124,"context_line":"        return self._cached_secrets"}],"source_content_type":"text/x-python","patch_set":22,"id":"da9df570_8ec98e7a","line":121,"updated":"2014-09-24 14:47:36.000000000","message":"Not thrilled about this being a list of dicts.  I can\u0027t think of a better alternative though. :-\\","commit_id":"d7b4654d82796c2a47fbda06ea25e7af5d2ca6b8"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"503cb041a7152e0bee3d6cc39ec96348b3b16cd5","unresolved":false,"context_lines":[{"line_number":118,"context_line":"        return self._secret_refs"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    @property"},{"line_number":121,"context_line":"    def secrets(self, cache\u003dTrue):"},{"line_number":122,"context_line":"        if not self._cached_secrets or not cache:"},{"line_number":123,"context_line":"            self._fill_secrets_from_secret_refs()"},{"line_number":124,"context_line":"        return self._cached_secrets"}],"source_content_type":"text/x-python","patch_set":22,"id":"da9df570_d1389ba2","line":121,"in_reply_to":"da9df570_8ec98e7a","updated":"2014-09-24 15:15:42.000000000","message":"Right, to allow for duplicate secret names, it has to be this way, I believe. :(","commit_id":"d7b4654d82796c2a47fbda06ea25e7af5d2ca6b8"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"17aa2ae2b22323ef3dffad359152f13c05c691ba","unresolved":false,"context_lines":[{"line_number":118,"context_line":"        return self._secret_refs"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    @property"},{"line_number":121,"context_line":"    def secrets(self, cache\u003dTrue):"},{"line_number":122,"context_line":"        if not self._cached_secrets or not cache:"},{"line_number":123,"context_line":"            self._fill_secrets_from_secret_refs()"},{"line_number":124,"context_line":"        return self._cached_secrets"}],"source_content_type":"text/x-python","patch_set":22,"id":"da9df570_1db232e6","line":121,"in_reply_to":"da9df570_d1389ba2","updated":"2014-09-24 21:37:46.000000000","message":"Woot, fixing!","commit_id":"d7b4654d82796c2a47fbda06ea25e7af5d2ca6b8"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"17aa2ae2b22323ef3dffad359152f13c05c691ba","unresolved":false,"context_lines":[{"line_number":197,"context_line":"        self._updated \u003d parse_isotime(updated) if updated else None"},{"line_number":198,"context_line":"        self._status \u003d response.get(\u0027status\u0027)"},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"    def _get_first_named_secret(self, name):"},{"line_number":201,"context_line":"        for s in self.secrets:"},{"line_number":202,"context_line":"            if s.get(\u0027name\u0027) \u003d\u003d name.lower():"},{"line_number":203,"context_line":"                return s.get(\u0027secret\u0027)"}],"source_content_type":"text/x-python","patch_set":22,"id":"da9df570_9dc5423e","line":200,"updated":"2014-09-24 21:37:46.000000000","message":"Can remove \"first\" now, woot.","commit_id":"d7b4654d82796c2a47fbda06ea25e7af5d2ca6b8"},{"author":{"_account_id":7973,"name":"Douglas Mendizábal","email":"dmendiza@redhat.com","username":"dougmendizabal"},"change_message_id":"ab045e3d51bccffff5c5f3d51905230c7030a4fa","unresolved":false,"context_lines":[{"line_number":234,"context_line":""},{"line_number":235,"context_line":"    def __init__(self, api, name\u003dNone, public_key\u003dNone, private_key\u003dNone,"},{"line_number":236,"context_line":"                 private_key_passphrase\u003dNone, consumers\u003d[], container_ref\u003dNone,"},{"line_number":237,"context_line":"                 created\u003dNone, updated\u003dNone, status\u003dNone, secret_refs\u003dNone):"},{"line_number":238,"context_line":"        super(RSAContainer, self).__init__("},{"line_number":239,"context_line":"            api\u003dapi,"},{"line_number":240,"context_line":"            name\u003dname,"}],"source_content_type":"text/x-python","patch_set":22,"id":"da9df570_ba821192","line":237,"updated":"2014-09-24 14:35:28.000000000","message":"I think that accepting secret_refs here could lead to some unexpected behavior, since we\u0027re just deferring to the super constructor to deal with them.  I think a better approach is to leave the secret_refs out of this constructor, and pass None to the super constructor.\n\nIf we still want to provide instantiation directly from secret refs, we should add 3 separate parameters: \"public_key_ref\", \"private_key_ref\", and \"private_key_passphrase_ref\"","commit_id":"d7b4654d82796c2a47fbda06ea25e7af5d2ca6b8"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"17aa2ae2b22323ef3dffad359152f13c05c691ba","unresolved":false,"context_lines":[{"line_number":234,"context_line":""},{"line_number":235,"context_line":"    def __init__(self, api, name\u003dNone, public_key\u003dNone, private_key\u003dNone,"},{"line_number":236,"context_line":"                 private_key_passphrase\u003dNone, consumers\u003d[], container_ref\u003dNone,"},{"line_number":237,"context_line":"                 created\u003dNone, updated\u003dNone, status\u003dNone, secret_refs\u003dNone):"},{"line_number":238,"context_line":"        super(RSAContainer, self).__init__("},{"line_number":239,"context_line":"            api\u003dapi,"},{"line_number":240,"context_line":"            name\u003dname,"}],"source_content_type":"text/x-python","patch_set":22,"id":"da9df570_3c97f391","line":237,"in_reply_to":"da9df570_31464724","updated":"2014-09-24 21:37:46.000000000","message":"Done","commit_id":"d7b4654d82796c2a47fbda06ea25e7af5d2ca6b8"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"503cb041a7152e0bee3d6cc39ec96348b3b16cd5","unresolved":false,"context_lines":[{"line_number":234,"context_line":""},{"line_number":235,"context_line":"    def __init__(self, api, name\u003dNone, public_key\u003dNone, private_key\u003dNone,"},{"line_number":236,"context_line":"                 private_key_passphrase\u003dNone, consumers\u003d[], container_ref\u003dNone,"},{"line_number":237,"context_line":"                 created\u003dNone, updated\u003dNone, status\u003dNone, secret_refs\u003dNone):"},{"line_number":238,"context_line":"        super(RSAContainer, self).__init__("},{"line_number":239,"context_line":"            api\u003dapi,"},{"line_number":240,"context_line":"            name\u003dname,"}],"source_content_type":"text/x-python","patch_set":22,"id":"da9df570_31464724","line":237,"in_reply_to":"da9df570_ba821192","updated":"2014-09-24 15:15:42.000000000","message":"I wouldn\u0027t be against doing that, if you really want to.","commit_id":"d7b4654d82796c2a47fbda06ea25e7af5d2ca6b8"},{"author":{"_account_id":7973,"name":"Douglas Mendizábal","email":"dmendiza@redhat.com","username":"dougmendizabal"},"change_message_id":"ab045e3d51bccffff5c5f3d51905230c7030a4fa","unresolved":false,"context_lines":[{"line_number":243,"context_line":"            created\u003dcreated,"},{"line_number":244,"context_line":"            updated\u003dupdated,"},{"line_number":245,"context_line":"            status\u003dstatus,"},{"line_number":246,"context_line":"            secret_refs\u003dsecret_refs"},{"line_number":247,"context_line":"        )"},{"line_number":248,"context_line":"        if public_key:"},{"line_number":249,"context_line":"            self.public_key \u003d public_key"}],"source_content_type":"text/x-python","patch_set":22,"id":"da9df570_7a26e9cf","line":246,"updated":"2014-09-24 14:35:28.000000000","message":"This would be better with \n    secret_refs\u003dNone","commit_id":"d7b4654d82796c2a47fbda06ea25e7af5d2ca6b8"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"17aa2ae2b22323ef3dffad359152f13c05c691ba","unresolved":false,"context_lines":[{"line_number":243,"context_line":"            created\u003dcreated,"},{"line_number":244,"context_line":"            updated\u003dupdated,"},{"line_number":245,"context_line":"            status\u003dstatus,"},{"line_number":246,"context_line":"            secret_refs\u003dsecret_refs"},{"line_number":247,"context_line":"        )"},{"line_number":248,"context_line":"        if public_key:"},{"line_number":249,"context_line":"            self.public_key \u003d public_key"}],"source_content_type":"text/x-python","patch_set":22,"id":"da9df570_bcea030d","line":246,"in_reply_to":"da9df570_7a26e9cf","updated":"2014-09-24 21:37:46.000000000","message":"Still need to pass refs here to the super-constructor.","commit_id":"d7b4654d82796c2a47fbda06ea25e7af5d2ca6b8"},{"author":{"_account_id":7973,"name":"Douglas Mendizábal","email":"dmendiza@redhat.com","username":"dougmendizabal"},"change_message_id":"ab045e3d51bccffff5c5f3d51905230c7030a4fa","unresolved":false,"context_lines":[{"line_number":316,"context_line":"    def __init__(self, api, name\u003dNone, certificate\u003dNone, intermediates\u003dNone,"},{"line_number":317,"context_line":"                 private_key\u003dNone, private_key_passphrase\u003dNone, consumers\u003d[],"},{"line_number":318,"context_line":"                 container_ref\u003dNone, created\u003dNone, updated\u003dNone, status\u003dNone,"},{"line_number":319,"context_line":"                 secret_refs\u003dNone):"},{"line_number":320,"context_line":"        super(CertificateContainer, self).__init__("},{"line_number":321,"context_line":"            api\u003dapi,"},{"line_number":322,"context_line":"            name\u003dname,"}],"source_content_type":"text/x-python","patch_set":22,"id":"da9df570_fa19f988","line":319,"updated":"2014-09-24 14:35:28.000000000","message":"Same issue here with the secret refs as above.   If we want to provide cert Instantiation from secret refs, we should add \"certificate_ref\", \"private_key_ref\", \"private_key_passphrase_ref\", and \"intermediates_ref\" instead.","commit_id":"d7b4654d82796c2a47fbda06ea25e7af5d2ca6b8"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"17aa2ae2b22323ef3dffad359152f13c05c691ba","unresolved":false,"context_lines":[{"line_number":316,"context_line":"    def __init__(self, api, name\u003dNone, certificate\u003dNone, intermediates\u003dNone,"},{"line_number":317,"context_line":"                 private_key\u003dNone, private_key_passphrase\u003dNone, consumers\u003d[],"},{"line_number":318,"context_line":"                 container_ref\u003dNone, created\u003dNone, updated\u003dNone, status\u003dNone,"},{"line_number":319,"context_line":"                 secret_refs\u003dNone):"},{"line_number":320,"context_line":"        super(CertificateContainer, self).__init__("},{"line_number":321,"context_line":"            api\u003dapi,"},{"line_number":322,"context_line":"            name\u003dname,"}],"source_content_type":"text/x-python","patch_set":22,"id":"da9df570_5c92f79f","line":319,"in_reply_to":"da9df570_915613d1","updated":"2014-09-24 21:37:46.000000000","message":"Done","commit_id":"d7b4654d82796c2a47fbda06ea25e7af5d2ca6b8"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"503cb041a7152e0bee3d6cc39ec96348b3b16cd5","unresolved":false,"context_lines":[{"line_number":316,"context_line":"    def __init__(self, api, name\u003dNone, certificate\u003dNone, intermediates\u003dNone,"},{"line_number":317,"context_line":"                 private_key\u003dNone, private_key_passphrase\u003dNone, consumers\u003d[],"},{"line_number":318,"context_line":"                 container_ref\u003dNone, created\u003dNone, updated\u003dNone, status\u003dNone,"},{"line_number":319,"context_line":"                 secret_refs\u003dNone):"},{"line_number":320,"context_line":"        super(CertificateContainer, self).__init__("},{"line_number":321,"context_line":"            api\u003dapi,"},{"line_number":322,"context_line":"            name\u003dname,"}],"source_content_type":"text/x-python","patch_set":22,"id":"da9df570_915613d1","line":319,"in_reply_to":"da9df570_fa19f988","updated":"2014-09-24 15:15:42.000000000","message":"Same as above, If you really want to do this...","commit_id":"d7b4654d82796c2a47fbda06ea25e7af5d2ca6b8"},{"author":{"_account_id":7973,"name":"Douglas Mendizábal","email":"dmendiza@redhat.com","username":"dougmendizabal"},"change_message_id":"ab045e3d51bccffff5c5f3d51905230c7030a4fa","unresolved":false,"context_lines":[{"line_number":325,"context_line":"            created\u003dcreated,"},{"line_number":326,"context_line":"            updated\u003dupdated,"},{"line_number":327,"context_line":"            status\u003dstatus,"},{"line_number":328,"context_line":"            secret_refs\u003dsecret_refs"},{"line_number":329,"context_line":"        )"},{"line_number":330,"context_line":"        if certificate:"},{"line_number":331,"context_line":"            self.certificate \u003d certificate"}],"source_content_type":"text/x-python","patch_set":22,"id":"da9df570_1a1ddd73","line":328,"updated":"2014-09-24 14:35:28.000000000","message":"This would also be better with secret_refs\u003dNone","commit_id":"d7b4654d82796c2a47fbda06ea25e7af5d2ca6b8"},{"author":{"_account_id":7973,"name":"Douglas Mendizábal","email":"dmendiza@redhat.com","username":"dougmendizabal"},"change_message_id":"ab045e3d51bccffff5c5f3d51905230c7030a4fa","unresolved":false,"context_lines":[{"line_number":462,"context_line":"        Container creation method"},{"line_number":463,"context_line":""},{"line_number":464,"context_line":"        :param name: A friendly name for the Container"},{"line_number":465,"context_line":"        :param secret_refs: Secret_refs to populate when creating a Container"},{"line_number":466,"context_line":"        :returns: Container"},{"line_number":467,"context_line":"        \"\"\""},{"line_number":468,"context_line":"        return Container("}],"source_content_type":"text/x-python","patch_set":22,"id":"da9df570_ba07711b","line":465,"updated":"2014-09-24 14:35:28.000000000","message":"param/doc mismatch.","commit_id":"d7b4654d82796c2a47fbda06ea25e7af5d2ca6b8"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"17aa2ae2b22323ef3dffad359152f13c05c691ba","unresolved":false,"context_lines":[{"line_number":462,"context_line":"        Container creation method"},{"line_number":463,"context_line":""},{"line_number":464,"context_line":"        :param name: A friendly name for the Container"},{"line_number":465,"context_line":"        :param secret_refs: Secret_refs to populate when creating a Container"},{"line_number":466,"context_line":"        :returns: Container"},{"line_number":467,"context_line":"        \"\"\""},{"line_number":468,"context_line":"        return Container("}],"source_content_type":"text/x-python","patch_set":22,"id":"da9df570_5cd91782","line":465,"in_reply_to":"da9df570_115a23f3","updated":"2014-09-24 21:37:46.000000000","message":"Done","commit_id":"d7b4654d82796c2a47fbda06ea25e7af5d2ca6b8"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"503cb041a7152e0bee3d6cc39ec96348b3b16cd5","unresolved":false,"context_lines":[{"line_number":462,"context_line":"        Container creation method"},{"line_number":463,"context_line":""},{"line_number":464,"context_line":"        :param name: A friendly name for the Container"},{"line_number":465,"context_line":"        :param secret_refs: Secret_refs to populate when creating a Container"},{"line_number":466,"context_line":"        :returns: Container"},{"line_number":467,"context_line":"        \"\"\""},{"line_number":468,"context_line":"        return Container("}],"source_content_type":"text/x-python","patch_set":22,"id":"da9df570_115a23f3","line":465,"in_reply_to":"da9df570_ba07711b","updated":"2014-09-24 15:15:42.000000000","message":"Erk, yeah, forgot to update that.","commit_id":"d7b4654d82796c2a47fbda06ea25e7af5d2ca6b8"}],"barbicanclient/test/test_client.py":[{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"19016953d98227949a7ac37e2a426e3901065718","unresolved":false,"context_lines":[{"line_number":472,"context_line":"            if differences:"},{"line_number":473,"context_line":"                msg \u003d \"Items differ: {0}\".format(differences)"},{"line_number":474,"context_line":"                self.fail(msg)"},{"line_number":475,"context_line":""},{"line_number":476,"context_line":"    def _setUp(self, entity):"},{"line_number":477,"context_line":"        super(BaseEntityResource, self).setUp()"},{"line_number":478,"context_line":"        self.endpoint \u003d \u0027https://localhost:9311/v1/\u0027"}],"source_content_type":"text/x-python","patch_set":20,"id":"da9df570_1a6fcac6","line":475,"updated":"2014-09-23 07:31:41.000000000","message":"Can you move this whole block to a separate function? I think there is a function to set up class wide stuff, such as setUpClass. You might want to check it out. On the other hand... uh... what are you doing here? Seems to me that this goes beyond the scope of this CR.","commit_id":"cb74741b9f206598b6f68018415b6c898a4d256a"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"9f118ed601d9d7f53f9e23bcaf81a6b2541dd8e2","unresolved":false,"context_lines":[{"line_number":472,"context_line":"            if differences:"},{"line_number":473,"context_line":"                msg \u003d \"Items differ: {0}\".format(differences)"},{"line_number":474,"context_line":"                self.fail(msg)"},{"line_number":475,"context_line":""},{"line_number":476,"context_line":"    def _setUp(self, entity):"},{"line_number":477,"context_line":"        super(BaseEntityResource, self).setUp()"},{"line_number":478,"context_line":"        self.endpoint \u003d \u0027https://localhost:9311/v1/\u0027"}],"source_content_type":"text/x-python","patch_set":20,"id":"da9df570_dac70211","line":475,"in_reply_to":"da9df570_1a6fcac6","updated":"2014-09-23 07:59:05.000000000","message":"So, this is really ridiculous, and I was beating my head against a wall for a while, until I finally did the code above.\n\nIn unittest in py27, there is a function \"assertItemsEqual\", but in py3.x it was renamed to \"assertCountEqual\", and it doesn\u0027t exist in py26 at all. However, I need to do this type of assert in my tests! This was the cleanest way I could think of to do it, since there didn\u0027t seem to be anything unittest related in \"six\"...\n\nI am noticing a small bug though, which is that I failed to make use of the \"msg\" arg, and only overwrite it. I\u0027ll have to fix that.","commit_id":"cb74741b9f206598b6f68018415b6c898a4d256a"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"ef4b36c0af638a49951ad8965029c719a49ec18e","unresolved":false,"context_lines":[{"line_number":472,"context_line":"            if differences:"},{"line_number":473,"context_line":"                msg \u003d \"Items differ: {0}\".format(differences)"},{"line_number":474,"context_line":"                self.fail(msg)"},{"line_number":475,"context_line":""},{"line_number":476,"context_line":"    def _setUp(self, entity):"},{"line_number":477,"context_line":"        super(BaseEntityResource, self).setUp()"},{"line_number":478,"context_line":"        self.endpoint \u003d \u0027https://localhost:9311/v1/\u0027"}],"source_content_type":"text/x-python","patch_set":20,"id":"da9df570_be16a553","line":475,"in_reply_to":"da9df570_9a065a1f","updated":"2014-09-23 15:23:05.000000000","message":"I started off using six to test python version, but it got really far into the weeds because I needed to check specific major/minor version combos, not just \"PY2/PY3\", and there\u0027s versions of py3 that don\u0027t have any of this stuff either from what I can tell in the docs, so I decided it\u0027d just be easier to check for what I really *need to know* rather than something like version that \"implies\" what it is I need to know (which function is available, if any). \n\nIsn\u0027t testtools outside of Barbican\u0027s codebase? How would I patch that?","commit_id":"cb74741b9f206598b6f68018415b6c898a4d256a"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"7eaa242788b5a8eff1a90eeb933b2209031ade7f","unresolved":false,"context_lines":[{"line_number":472,"context_line":"            if differences:"},{"line_number":473,"context_line":"                msg \u003d \"Items differ: {0}\".format(differences)"},{"line_number":474,"context_line":"                self.fail(msg)"},{"line_number":475,"context_line":""},{"line_number":476,"context_line":"    def _setUp(self, entity):"},{"line_number":477,"context_line":"        super(BaseEntityResource, self).setUp()"},{"line_number":478,"context_line":"        self.endpoint \u003d \u0027https://localhost:9311/v1/\u0027"}],"source_content_type":"text/x-python","patch_set":20,"id":"da9df570_f226a115","line":475,"in_reply_to":"da9df570_be16a553","updated":"2014-09-23 15:38:02.000000000","message":"I\u0027m adding some comments, maybe that will help.","commit_id":"cb74741b9f206598b6f68018415b6c898a4d256a"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"c43eb471f7c892479b4a7cca1d25289dde43ee0a","unresolved":false,"context_lines":[{"line_number":472,"context_line":"            if differences:"},{"line_number":473,"context_line":"                msg \u003d \"Items differ: {0}\".format(differences)"},{"line_number":474,"context_line":"                self.fail(msg)"},{"line_number":475,"context_line":""},{"line_number":476,"context_line":"    def _setUp(self, entity):"},{"line_number":477,"context_line":"        super(BaseEntityResource, self).setUp()"},{"line_number":478,"context_line":"        self.endpoint \u003d \u0027https://localhost:9311/v1/\u0027"}],"source_content_type":"text/x-python","patch_set":20,"id":"da9df570_9a065a1f","line":475,"in_reply_to":"da9df570_dac70211","updated":"2014-09-23 08:02:29.000000000","message":"Oh, I see. I think I now understand. Well, what about patching the testtools.TestCase module on the top of the file? So there would be a check with six to see what version of python is being used. And after that you can do the proper patch work. Does it make sense? I think that would be explicit still.","commit_id":"cb74741b9f206598b6f68018415b6c898a4d256a"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"4a6f7aed2382726b9f081a0bb7f9c11bfa300222","unresolved":false,"context_lines":[{"line_number":483,"context_line":"                    msg \u003d \"Size of collection differs: {0} !\u003d {1}\".format("},{"line_number":484,"context_line":"                        len(first_seq), len(second_seq)"},{"line_number":485,"context_line":"                    )"},{"line_number":486,"context_line":"                self.fail(msg)"},{"line_number":487,"context_line":""},{"line_number":488,"context_line":"    def _setUp(self, entity):"},{"line_number":489,"context_line":"        super(BaseEntityResource, self).setUp()"}],"source_content_type":"text/x-python","patch_set":23,"id":"da9df570_cd761ca4","line":486,"updated":"2014-09-25 14:24:43.000000000","message":"I can live with this the way it is now. But couldn\u0027t you move this to a setUpClass function? testtools should have support for that.","commit_id":"85ea711c0a464a7c04a51e9e33dca65a1f38e0a9"}],"barbicanclient/test/test_client_containers.py":[{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"19016953d98227949a7ac37e2a426e3901065718","unresolved":false,"context_lines":[{"line_number":66,"context_line":"        elif type \u003d\u003d \u0027certificate\u0027:"},{"line_number":67,"context_line":"            container[\u0027secret_refs\u0027] \u003d self.certificate_secret_refs"},{"line_number":68,"context_line":"        else:"},{"line_number":69,"context_line":"            container[\u0027secret_refs\u0027] \u003d self.generic_secret_refs"},{"line_number":70,"context_line":"        if consumers:"},{"line_number":71,"context_line":"            container[\u0027consumers\u0027] \u003d consumers"},{"line_number":72,"context_line":"        return container"}],"source_content_type":"text/x-python","patch_set":20,"id":"da9df570_7a6536e0","line":69,"updated":"2014-09-23 07:31:41.000000000","message":"perhaps you could move all the stuff where you setup \u0027secret_refs\u0027 to a separate function, that way it\u0027s easier to read.","commit_id":"cb74741b9f206598b6f68018415b6c898a4d256a"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"9f118ed601d9d7f53f9e23bcaf81a6b2541dd8e2","unresolved":false,"context_lines":[{"line_number":66,"context_line":"        elif type \u003d\u003d \u0027certificate\u0027:"},{"line_number":67,"context_line":"            container[\u0027secret_refs\u0027] \u003d self.certificate_secret_refs"},{"line_number":68,"context_line":"        else:"},{"line_number":69,"context_line":"            container[\u0027secret_refs\u0027] \u003d self.generic_secret_refs"},{"line_number":70,"context_line":"        if consumers:"},{"line_number":71,"context_line":"            container[\u0027consumers\u0027] \u003d consumers"},{"line_number":72,"context_line":"        return container"}],"source_content_type":"text/x-python","patch_set":20,"id":"da9df570_ba907eed","line":69,"in_reply_to":"da9df570_7a6536e0","updated":"2014-09-23 07:59:05.000000000","message":"This seems like it belongs here, since it is dealing with initializing the dict, but just happens to be a couple lines longer than the other operations. Not sure it really makes sense to split out 6 lines, which would add two extra lines for 33% overhead...","commit_id":"cb74741b9f206598b6f68018415b6c898a4d256a"}]}
