)]}'
{"nova/scheduler/filters/affinity_filter.py":[{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"e72721197f42bd6f755222056a3c94b023c07290","unresolved":false,"context_lines":[{"line_number":32,"context_line":"        context \u003d filter_properties[\u0027context\u0027]"},{"line_number":33,"context_line":"        spec \u003d filter_properties[\u0027request_spec\u0027]"},{"line_number":34,"context_line":"        instance_properties \u003d spec.get(\u0027instance_properties\u0027)"},{"line_number":35,"context_line":"        instance_id \u003d instance_properties.get(\u0027instance_id\u0027)"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"        return context, instance_id"},{"line_number":38,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAD3%2F%2F8FE%3D","line":35,"updated":"2012-01-20 17:08:46.000000000","message":"Ah, I misread this in the last review.. thought it came from filter_properties.  Hm.. instance_properties does not have instance_id.  What instance_id is this supposed to be?","commit_id":"82f05c25583fbae496463ba6e5ec0ed940587f08"},{"author":{"_account_id":693,"name":"Christopher MacGown","email":"chris@pistoncloud.com","username":"0x44"},"change_message_id":"b6d5f36dc2ae44d0827b19563f3568c79e331bbc","unresolved":false,"context_lines":[{"line_number":32,"context_line":"        context \u003d filter_properties[\u0027context\u0027]"},{"line_number":33,"context_line":"        spec \u003d filter_properties[\u0027request_spec\u0027]"},{"line_number":34,"context_line":"        instance_properties \u003d spec.get(\u0027instance_properties\u0027)"},{"line_number":35,"context_line":"        instance_id \u003d instance_properties.get(\u0027instance_id\u0027)"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"        return context, instance_id"},{"line_number":38,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAD3%2F%2F8E8%3D","line":35,"in_reply_to":"AAAAD3%2F%2F8FE%3D","updated":"2012-01-20 17:10:42.000000000","message":"It\u0027s passed in as part of the filter_properties spec that hasn\u0027t been solidified. bcwaldon is working on it.","commit_id":"82f05c25583fbae496463ba6e5ec0ed940587f08"},{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"5f0a0cad32d2e8a5ad822df80c375bdd8f45fc12","unresolved":false,"context_lines":[{"line_number":48,"context_line":"    def host_passes(self, host_state, filter_properties):"},{"line_number":49,"context_line":"        context, instance_id \u003d self._context_and_instance_id(filter_properties)"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"        return not host_state.host \u003d\u003d self._affinity_host(context, instance_id)"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"class SimpleBuildNearMeFilter(AffinityFilter):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAD3%2F%2F8FQ%3D","line":51,"updated":"2012-01-20 17:06:08.000000000","message":"Does your \u0027not \u003d\u003d\u0027 come from ruby?  Could be !\u003d.  Removes 4 characters and is easier to read! ;)","commit_id":"82f05c25583fbae496463ba6e5ec0ed940587f08"},{"author":{"_account_id":475,"name":"Rick Harris","email":"rick.harris@rackspace.com","username":"rconradharris"},"change_message_id":"63d92431d760c178755940fa9978c0edef25be2a","unresolved":false,"context_lines":[{"line_number":48,"context_line":"    def host_passes(self, host_state, filter_properties):"},{"line_number":49,"context_line":"        context, instance_id \u003d self._context_and_instance_id(filter_properties)"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"        return not host_state.host \u003d\u003d self._affinity_host(context, instance_id)"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"class SimpleBuildNearMeFilter(AffinityFilter):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAD3%2F%2F8FU%3D","line":51,"updated":"2012-01-20 17:16:16.000000000","message":"Might be clearer as:\n\n  return host_state.host !\u003d self._affinity_host(context, instance_id).\n\n\nOR, just for discussion really, since they are opposites, it could be written as:\n\nclass AvoidMeFilter(ComeAtMeFilter):\n   def host_passes(self, host_state, filter_properties):\n        return not super(ComeAtMeFilter, self).host_passes(host_state, filter_properties)","commit_id":"82f05c25583fbae496463ba6e5ec0ed940587f08"},{"author":{"_account_id":475,"name":"Rick Harris","email":"rick.harris@rackspace.com","username":"rconradharris"},"change_message_id":"63d92431d760c178755940fa9978c0edef25be2a","unresolved":false,"context_lines":[{"line_number":53,"context_line":""},{"line_number":54,"context_line":"class SimpleBuildNearMeFilter(AffinityFilter):"},{"line_number":55,"context_line":"    def _near(self, h1, h2, cidr\u003d\u0027/24\u0027):"},{"line_number":56,"context_line":"        affinity_net \u003d netaddr.IPNetwork(str.join(\u0027\u0027, (h1, cidr)))"},{"line_number":57,"context_line":"        return netaddr.IPAddress(h2) in affinity_net"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def host_passes(self, host_state, filter_properties):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAD3%2F%2F8Fc%3D","line":56,"updated":"2012-01-20 17:16:16.000000000","message":"str methods are usually preferred over str.functions:\n\n\u0027 \u0027.join([h1, cidr])","commit_id":"82f05c25583fbae496463ba6e5ec0ed940587f08"},{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"5f0a0cad32d2e8a5ad822df80c375bdd8f45fc12","unresolved":false,"context_lines":[{"line_number":54,"context_line":"class SimpleBuildNearMeFilter(AffinityFilter):"},{"line_number":55,"context_line":"    def _near(self, h1, h2, cidr\u003d\u0027/24\u0027):"},{"line_number":56,"context_line":"        affinity_net \u003d netaddr.IPNetwork(str.join(\u0027\u0027, (h1, cidr)))"},{"line_number":57,"context_line":"        return netaddr.IPAddress(h2) in affinity_net"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def host_passes(self, host_state, filter_properties):"},{"line_number":60,"context_line":"        context, instance_id \u003d self._context_and_instance_id(filter_properties)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAD3%2F%2F8FY%3D","line":57,"updated":"2012-01-20 17:06:08.000000000","message":"h2 is instance[\u0027host\u0027] it appears.  I think it\u0027d be better to not pass the instance_id... and instead pass the appropriate args needed in the filter_properties, like the other instance\u0027s host/cidr.  Avoids a DB call here if we\u0027ve already received the image and simplifies this stuff a bit.","commit_id":"82f05c25583fbae496463ba6e5ec0ed940587f08"},{"author":{"_account_id":693,"name":"Christopher MacGown","email":"chris@pistoncloud.com","username":"0x44"},"change_message_id":"b6d5f36dc2ae44d0827b19563f3568c79e331bbc","unresolved":false,"context_lines":[{"line_number":54,"context_line":"class SimpleBuildNearMeFilter(AffinityFilter):"},{"line_number":55,"context_line":"    def _near(self, h1, h2, cidr\u003d\u0027/24\u0027):"},{"line_number":56,"context_line":"        affinity_net \u003d netaddr.IPNetwork(str.join(\u0027\u0027, (h1, cidr)))"},{"line_number":57,"context_line":"        return netaddr.IPAddress(h2) in affinity_net"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def host_passes(self, host_state, filter_properties):"},{"line_number":60,"context_line":"        context, instance_id \u003d self._context_and_instance_id(filter_properties)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAD3%2F%2F8FI%3D","line":57,"in_reply_to":"AAAAD3%2F%2F8FY%3D","updated":"2012-01-20 17:10:42.000000000","message":"Vish specifically asked for the instance id to get passed in and to look it up based on that.","commit_id":"82f05c25583fbae496463ba6e5ec0ed940587f08"},{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"5ee9189eb0ddf7157f4fddfc4a1b4ef9f3dba075","unresolved":false,"context_lines":[{"line_number":52,"context_line":"class SimpleBuildNearMeFilter(AffinityFilter):"},{"line_number":53,"context_line":"    def _near(self, h1, h2, cidr\u003d\u0027/24\u0027):"},{"line_number":54,"context_line":"        affinity_net \u003d netaddr.IPNetwork(str.join(\u0027\u0027, (h1, cidr)))"},{"line_number":55,"context_line":"        return netaddr.IPAddress(h2) in affinity_net"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def host_passes(self, host_state, filter_properties):"},{"line_number":58,"context_line":"        context, affinity  \u003d self._context_and_affinity_uuid(filter_properties)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAD3%2F%2F8Do%3D","line":55,"updated":"2012-01-20 18:01:00.000000000","message":"I\u0027m still confused by this.  IPNetwork and IPAddress take cidrs or IP strings only.  Shouldn\u0027t the first line just be:  affinity_net \u003d netaddr.IPNetwork(cidr).   And the 2nd line... somehow you need to get h2\u0027s cidr.  h2 is instance[\u0027host\u0027].  Unfortunately this will require a call to the network manager.","commit_id":"272b646a2c4e4451fc2cc888d3c78722a6435ce7"}]}
