)]}'
{"glance/api/v2/images.py":[{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"60c11bc19691a24dcda1a3502e060ee664700b2b","unresolved":false,"context_lines":[{"line_number":333,"context_line":"            raise webob.exc.HTTPBadRequest(explanation\u003de.msg)"},{"line_number":334,"context_line":"        image \u003d {}"},{"line_number":335,"context_line":"        properties \u003d body"},{"line_number":336,"context_line":"        tags \u003d properties.pop(\u0027tags\u0027, [])"},{"line_number":337,"context_line":"        for key in self._base_properties:"},{"line_number":338,"context_line":"            try:"},{"line_number":339,"context_line":"                # NOTE(flwang): Instead of changing the _check_unexpected"}],"source_content_type":"text/x-python","patch_set":9,"id":"5a890539_1c40aa06","line":336,"updated":"2014-11-28 16:44:03.000000000","message":"maybe use properties.pop(\u0027tags\u0027, []) in place?","commit_id":"77efb2d62bbda6fb24d9361cce33eb332468bc82"}],"glance/domain/__init__.py":[{"author":{"_account_id":8127,"name":"Alexander Tivelkov","email":"locher@yandex.ru","username":"ativelkov"},"change_message_id":"5a0a1b2cecb74781b035b8ce76e2b366a8b065a3","unresolved":false,"context_lines":[{"line_number":113,"context_line":"    def __init__(self, image_id, status, created_at, updated_at, **kwargs):"},{"line_number":114,"context_line":"        # Remove all None values from kwargs"},{"line_number":115,"context_line":"        kwargs \u003d dict((k, v) for k, v in kwargs.iteritems() if v is not None)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"        self.image_id \u003d image_id"},{"line_number":118,"context_line":"        self.status \u003d status"},{"line_number":119,"context_line":"        self.created_at \u003d created_at"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_89284398","line":116,"updated":"2014-11-25 14:36:10.000000000","message":"Could you please explain the reasons behind this? In commit message and/or here","commit_id":"58229e33507bb0d7dcc7f3f948a9b4dea0e1a768"},{"author":{"_account_id":8127,"name":"Alexander Tivelkov","email":"locher@yandex.ru","username":"ativelkov"},"change_message_id":"a999e91ed1290cfa497e5e18c1728282ce9ea97f","unresolved":false,"context_lines":[{"line_number":113,"context_line":"    def __init__(self, image_id, status, created_at, updated_at, **kwargs):"},{"line_number":114,"context_line":"        # Remove all None values from kwargs"},{"line_number":115,"context_line":"        kwargs \u003d dict((k, v) for k, v in kwargs.iteritems() if v is not None)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"        self.image_id \u003d image_id"},{"line_number":118,"context_line":"        self.status \u003d status"},{"line_number":119,"context_line":"        self.created_at \u003d created_at"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_1d272dcb","line":116,"in_reply_to":"5a890539_52fa8443","updated":"2014-11-25 15:55:14.000000000","message":"By here - I mean in code here, as the change is not obvious and I\u0027d prefer it to be better documented","commit_id":"58229e33507bb0d7dcc7f3f948a9b4dea0e1a768"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"1f55009755ba6f9949eef29dc9a5464591d12d0a","unresolved":false,"context_lines":[{"line_number":113,"context_line":"    def __init__(self, image_id, status, created_at, updated_at, **kwargs):"},{"line_number":114,"context_line":"        # Remove all None values from kwargs"},{"line_number":115,"context_line":"        kwargs \u003d dict((k, v) for k, v in kwargs.iteritems() if v is not None)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"        self.image_id \u003d image_id"},{"line_number":118,"context_line":"        self.status \u003d status"},{"line_number":119,"context_line":"        self.created_at \u003d created_at"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_52fa8443","line":116,"in_reply_to":"5a890539_89284398","updated":"2014-11-25 15:49:32.000000000","message":"Of course! It\u0027s done because input kwargs by default contain all the fields with value None.\nFor example: \nkwargs:{...\n\u0027min_disk\u0027: None,\ntags: None,\n...} \nIt means that default values below have no meaning at all.\nIt leads to some inconsistency: min_ram expected to be 0 if it\u0027s not set, but later it\u0027s expected that min_ram must be None. For the reason min_ram is never set to 0 everything goes fine.\n\nSo, in brief, this code enables default params for Image fields and takes away the crutches like self.tags \u003d kwargs.pop(\u0027tags\u0027, None) or []","commit_id":"58229e33507bb0d7dcc7f3f948a9b4dea0e1a768"},{"author":{"_account_id":11356,"name":"Louis Taylor","email":"louis@kragniz.eu","username":"kragniz"},"change_message_id":"ec8009e7829213e6a1dd456d3e8f781bf327f00a","unresolved":false,"context_lines":[{"line_number":73,"context_line":"    def new_image(self, image_id\u003dNone, name\u003dNone, visibility\u003d\u0027private\u0027,"},{"line_number":74,"context_line":"                  min_disk\u003d0, min_ram\u003d0, protected\u003dFalse, owner\u003dNone,"},{"line_number":75,"context_line":"                  disk_format\u003dNone, container_format\u003dNone,"},{"line_number":76,"context_line":"                  extra_properties\u003d{}, tags\u003d[], **other_args):"},{"line_number":77,"context_line":"        self._check_readonly(other_args)"},{"line_number":78,"context_line":"        self._check_unexpected(other_args)"},{"line_number":79,"context_line":"        self._check_reserved(extra_properties)"}],"source_content_type":"text/x-python","patch_set":7,"id":"5a890539_b0aa9618","line":76,"updated":"2014-11-26 16:21:57.000000000","message":"This is a bad idea and should be avoided, since those default args are mutable and the instance is tied to the function.\n\nThis means that if somehow this function mutates the value of either of those properties, the next call to new_image will have those mutated values as the defaults.","commit_id":"85a8b488b64f97f1a05eaa68a6df00f15ed7605f"},{"author":{"_account_id":11356,"name":"Louis Taylor","email":"louis@kragniz.eu","username":"kragniz"},"change_message_id":"12d85e37233b40f0bbd67fce6e8cb39074992aaa","unresolved":false,"context_lines":[{"line_number":73,"context_line":"    def new_image(self, image_id\u003dNone, name\u003dNone, visibility\u003d\u0027private\u0027,"},{"line_number":74,"context_line":"                  min_disk\u003d0, min_ram\u003d0, protected\u003dFalse, owner\u003dNone,"},{"line_number":75,"context_line":"                  disk_format\u003dNone, container_format\u003dNone,"},{"line_number":76,"context_line":"                  extra_properties\u003d{}, tags\u003d[], **other_args):"},{"line_number":77,"context_line":"        self._check_readonly(other_args)"},{"line_number":78,"context_line":"        self._check_unexpected(other_args)"},{"line_number":79,"context_line":"        self._check_reserved(extra_properties)"}],"source_content_type":"text/x-python","patch_set":7,"id":"5a890539_e7effeaf","line":76,"in_reply_to":"5a890539_67a94e90","updated":"2014-11-26 18:10:22.000000000","message":"It\u0027s an easy pitfall - and the cause of baffling bugs!","commit_id":"85a8b488b64f97f1a05eaa68a6df00f15ed7605f"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"c0ea77372b55170e28dad24b3f000eb4e143e8ee","unresolved":false,"context_lines":[{"line_number":73,"context_line":"    def new_image(self, image_id\u003dNone, name\u003dNone, visibility\u003d\u0027private\u0027,"},{"line_number":74,"context_line":"                  min_disk\u003d0, min_ram\u003d0, protected\u003dFalse, owner\u003dNone,"},{"line_number":75,"context_line":"                  disk_format\u003dNone, container_format\u003dNone,"},{"line_number":76,"context_line":"                  extra_properties\u003d{}, tags\u003d[], **other_args):"},{"line_number":77,"context_line":"        self._check_readonly(other_args)"},{"line_number":78,"context_line":"        self._check_unexpected(other_args)"},{"line_number":79,"context_line":"        self._check_reserved(extra_properties)"}],"source_content_type":"text/x-python","patch_set":7,"id":"5a890539_67a94e90","line":76,"in_reply_to":"5a890539_b0aa9618","updated":"2014-11-26 18:08:46.000000000","message":"Heh... Thanks! I don\u0027t think about it :)","commit_id":"85a8b488b64f97f1a05eaa68a6df00f15ed7605f"},{"author":{"_account_id":8127,"name":"Alexander Tivelkov","email":"locher@yandex.ru","username":"ativelkov"},"change_message_id":"248df4181fb18b7a2e2ec2af01396be7f7f5eaa7","unresolved":false,"context_lines":[{"line_number":74,"context_line":"                  min_disk\u003d0, min_ram\u003d0, protected\u003dFalse, owner\u003dNone,"},{"line_number":75,"context_line":"                  disk_format\u003dNone, container_format\u003dNone,"},{"line_number":76,"context_line":"                  extra_properties\u003dNone, tags\u003dNone, **other_args):"},{"line_number":77,"context_line":"        if extra_properties is None:"},{"line_number":78,"context_line":"            extra_properties \u003d {}"},{"line_number":79,"context_line":"        if tags is None:"},{"line_number":80,"context_line":"            tags \u003d []"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a890539_daa2c64a","line":77,"updated":"2014-11-27 10:45:51.000000000","message":"Having this as \"extra_properties \u003d extra_properties or {}\" would be shorter and more pythonic","commit_id":"4fccb2b15c4b9c9c952e095e4b059b940e8f3ee0"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"2111f2cfa4d0c3b996759ecc5feaeecf1bf609fd","unresolved":false,"context_lines":[{"line_number":74,"context_line":"                  min_disk\u003d0, min_ram\u003d0, protected\u003dFalse, owner\u003dNone,"},{"line_number":75,"context_line":"                  disk_format\u003dNone, container_format\u003dNone,"},{"line_number":76,"context_line":"                  extra_properties\u003dNone, tags\u003dNone, **other_args):"},{"line_number":77,"context_line":"        if extra_properties is None:"},{"line_number":78,"context_line":"            extra_properties \u003d {}"},{"line_number":79,"context_line":"        if tags is None:"},{"line_number":80,"context_line":"            tags \u003d []"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a890539_fd3e9cb8","line":77,"in_reply_to":"5a890539_daa2c64a","updated":"2014-11-27 10:55:53.000000000","message":"Done","commit_id":"4fccb2b15c4b9c9c952e095e4b059b940e8f3ee0"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"60c11bc19691a24dcda1a3502e060ee664700b2b","unresolved":false,"context_lines":[{"line_number":75,"context_line":"                  disk_format\u003dNone, container_format\u003dNone,"},{"line_number":76,"context_line":"                  extra_properties\u003dNone, tags\u003dNone, **other_args):"},{"line_number":77,"context_line":"        extra_properties \u003d extra_properties or {}"},{"line_number":78,"context_line":"        tags \u003d tags or []"},{"line_number":79,"context_line":"        self._check_readonly(other_args)"},{"line_number":80,"context_line":"        self._check_unexpected(other_args)"},{"line_number":81,"context_line":"        self._check_reserved(extra_properties)"}],"source_content_type":"text/x-python","patch_set":9,"id":"5a890539_5cdb127d","line":78,"updated":"2014-11-28 16:44:03.000000000","message":"tags or [] can be used in place at 95 line","commit_id":"77efb2d62bbda6fb24d9361cce33eb332468bc82"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"60c11bc19691a24dcda1a3502e060ee664700b2b","unresolved":false,"context_lines":[{"line_number":107,"context_line":"        \u0027queued\u0027: (\u0027saving\u0027, \u0027active\u0027, \u0027deleted\u0027),"},{"line_number":108,"context_line":"        \u0027saving\u0027: (\u0027active\u0027, \u0027killed\u0027, \u0027deleted\u0027, \u0027queued\u0027),"},{"line_number":109,"context_line":"        \u0027active\u0027: (\u0027queued\u0027, \u0027pending_delete\u0027, \u0027deleted\u0027),"},{"line_number":110,"context_line":"        \u0027killed\u0027: (\u0027deleted\u0027,),"},{"line_number":111,"context_line":"        \u0027pending_delete\u0027: (\u0027deleted\u0027,),"},{"line_number":112,"context_line":"        \u0027deleted\u0027: (),"},{"line_number":113,"context_line":"    }"}],"source_content_type":"text/x-python","patch_set":9,"id":"5a890539_3c800646","line":110,"updated":"2014-11-28 16:44:03.000000000","message":"I think you should write unit tests for this case.","commit_id":"77efb2d62bbda6fb24d9361cce33eb332468bc82"}]}
