)]}'
{"nova/db/api.py":[{"author":{"_account_id":360,"name":"Dan Prince","email":"dprince@redhat.com","username":"dan-prince"},"change_message_id":"467f382baaa88c87eed39e4cc32b8f74a37d0397","unresolved":false,"context_lines":[{"line_number":581,"context_line":""},{"line_number":582,"context_line":""},{"line_number":583,"context_line":"def instance_get_all_by_host_and_not_type(context, host, type_id\u003dNone):"},{"line_number":584,"context_line":"    \"\"\"Get all instance belonging to a host with a different type_id.\"\"\""},{"line_number":585,"context_line":"    return IMPL.instance_get_all_by_host_and_not_type(context, host, type_id)"},{"line_number":586,"context_line":""},{"line_number":587,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAHX%2F%2F4kg%3D","line":584,"updated":"2012-05-23 18:27:22.000000000","message":"Minor nit: comment should say: Get all instances... (add an extra s instances)","commit_id":"65c028dfaf7925d6df1599b8d6c5fb39bcf52fe1"}],"nova/scheduler/filters/type_filter.py":[{"author":{"_account_id":360,"name":"Dan Prince","email":"dprince@redhat.com","username":"dan-prince"},"change_message_id":"62951f0a38dc6704f3f6eacbf9847fd71cc0248e","unresolved":false,"context_lines":[{"line_number":39,"context_line":"        else:"},{"line_number":40,"context_line":"            # Only check first instance since assume all instances are of the"},{"line_number":41,"context_line":"            # same type"},{"line_number":42,"context_line":"            instance_type \u003d filter_properties.get(\u0027instance_type\u0027)"},{"line_number":43,"context_line":"            node_instance \u003d instances[0]"},{"line_number":44,"context_line":"            return instance_type[\u0027id\u0027] \u003d\u003d node_instance[\u0027instance_type_id\u0027]"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAHX%2F%2F6Oc%3D","line":42,"updated":"2012-05-18 16:03:22.000000000","message":"So is the intent here that you\u0027d have to have TypeAffinityFilter enabled \"from the start\".\n\nWould it make sense to loop over all the instances and if they don\u0027t match then return False. Then if someone were to enable TypeAffinityFilter on an existing OpenStack deployment it would skip over nodes that didn\u0027t have a homogeneous set of instance types on them.","commit_id":"f056148bc7358c908447a7234a986b20e526f88a"},{"author":{"_account_id":1849,"name":"Joe Gordon","email":"joe.gordon0@gmail.com","username":"jogo"},"change_message_id":"1d8c2aa79d6b2e1c23fbcb111beb033b87031579","unresolved":false,"context_lines":[{"line_number":39,"context_line":"        else:"},{"line_number":40,"context_line":"            # Only check first instance since assume all instances are of the"},{"line_number":41,"context_line":"            # same type"},{"line_number":42,"context_line":"            instance_type \u003d filter_properties.get(\u0027instance_type\u0027)"},{"line_number":43,"context_line":"            node_instance \u003d instances[0]"},{"line_number":44,"context_line":"            return instance_type[\u0027id\u0027] \u003d\u003d node_instance[\u0027instance_type_id\u0027]"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAHX%2F%2F6J4%3D","line":42,"in_reply_to":"AAAAHX%2F%2F6Oc%3D","updated":"2012-05-18 17:54:02.000000000","message":"After taking a second look, this sounds like a reasonable tradeoff between performance and usability (especially since no extra DB calls needed).","commit_id":"f056148bc7358c908447a7234a986b20e526f88a"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"1fe4ce069ce5dffbf0a46495e75734fd1dc24f4d","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        instance_type \u003d filter_properties.get(\u0027instance_type\u0027)"},{"line_number":38,"context_line":"        for node_instance in instances:"},{"line_number":39,"context_line":"            if instance_type[\u0027id\u0027] !\u003d node_instance[\u0027instance_type_id\u0027]:"},{"line_number":40,"context_line":"                return False"},{"line_number":41,"context_line":"        return True"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAHX%2F%2F6IU%3D","line":40,"updated":"2012-05-18 18:23:16.000000000","message":"This is a pretty critical query. I think I would prefer that instead of looping over all instances checking for instance_type_id, that the instance_type is simply passed to a DB API call that adds a WHERE clause to the database query...","commit_id":"a3cbdbbcdccfcf13fbe1b2ae844cceb1adae1c26"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"850e73ddc17da6ac7b33c2cf9780e943c4e10df6","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        instance_type \u003d filter_properties.get(\u0027instance_type\u0027)"},{"line_number":38,"context_line":"        for node_instance in instances:"},{"line_number":39,"context_line":"            if instance_type[\u0027id\u0027] !\u003d node_instance[\u0027instance_type_id\u0027]:"},{"line_number":40,"context_line":"                return False"},{"line_number":41,"context_line":"        return True"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAHX%2F%2F6Gs%3D","line":40,"in_reply_to":"AAAAHX%2F%2F6G4%3D","updated":"2012-05-18 19:35:03.000000000","message":"Right, that\u0027s exactly what I was saying...","commit_id":"a3cbdbbcdccfcf13fbe1b2ae844cceb1adae1c26"},{"author":{"_account_id":191,"name":"Trey Morris","email":"trey.morris@rackspace.com","username":"tr3buchet"},"change_message_id":"524454fc784ba038390d553961db93262ee25d03","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        instance_type \u003d filter_properties.get(\u0027instance_type\u0027)"},{"line_number":38,"context_line":"        for node_instance in instances:"},{"line_number":39,"context_line":"            if instance_type[\u0027id\u0027] !\u003d node_instance[\u0027instance_type_id\u0027]:"},{"line_number":40,"context_line":"                return False"},{"line_number":41,"context_line":"        return True"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAHX%2F%2F6G4%3D","line":40,"in_reply_to":"AAAAHX%2F%2F6Hg%3D","updated":"2012-05-18 19:32:53.000000000","message":"add a filter to instance_get_all_by_host and use that to filter on instance type id","commit_id":"a3cbdbbcdccfcf13fbe1b2ae844cceb1adae1c26"},{"author":{"_account_id":1849,"name":"Joe Gordon","email":"joe.gordon0@gmail.com","username":"jogo"},"change_message_id":"a82296a88c0303b1b778039b17ed239e21fbd803","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        instance_type \u003d filter_properties.get(\u0027instance_type\u0027)"},{"line_number":38,"context_line":"        for node_instance in instances:"},{"line_number":39,"context_line":"            if instance_type[\u0027id\u0027] !\u003d node_instance[\u0027instance_type_id\u0027]:"},{"line_number":40,"context_line":"                return False"},{"line_number":41,"context_line":"        return True"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAHX%2F%2F6Hg%3D","line":40,"in_reply_to":"AAAAHX%2F%2F6IU%3D","updated":"2012-05-18 19:08:54.000000000","message":"Jay, in order to remove this loop and still make make sure all current instances are of the filter instance_type.  I would need to DB queries:\n\ninstances \u003d db.instance_get_all_by_host\n\nif not instances:\n  return True\nelif len(instances)\u003d\u003dlen(db.instance_get_all_by_host_and_type):\n return False\nelse:\n  return True\n\nCurrently db.instance_get_all_by_host_and_type doesn\u0027t exist so I would have to create that as well.  \n\n\nSo is it still worth changing this? As this will go from 1 DB query to 2.","commit_id":"a3cbdbbcdccfcf13fbe1b2ae844cceb1adae1c26"},{"author":{"_account_id":360,"name":"Dan Prince","email":"dprince@redhat.com","username":"dan-prince"},"change_message_id":"467f382baaa88c87eed39e4cc32b8f74a37d0397","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    def host_passes(self, host_state, filter_properties):"},{"line_number":29,"context_line":"        \"\"\"Dynamically limits hosts to one instance type"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"        Return False if host has instances of a different instance_type"},{"line_number":32,"context_line":"        else Return False."},{"line_number":33,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAHX%2F%2F4kc%3D","line":30,"updated":"2012-05-23 18:27:22.000000000","message":"I might expand this comment to say:\n\nReturn True if host has instances which are all the same type....","commit_id":"65c028dfaf7925d6df1599b8d6c5fb39bcf52fe1"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"4920da6610d67def19f95d6453bdfc964cf492f2","unresolved":false,"context_lines":[{"line_number":28,"context_line":"    def host_passes(self, host_state, filter_properties):"},{"line_number":29,"context_line":"        \"\"\"Dynamically limits hosts to one instance type"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"        Return False if host has any instance types other then the requested "},{"line_number":32,"context_line":"        type. Return True if all instance types match or if host is empty."},{"line_number":33,"context_line":"        \"\"\""},{"line_number":34,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAHX%2F%2F4V8%3D","line":31,"updated":"2012-05-23 22:12:51.000000000","message":"Here\u0027s your PEP8 error—trailing whitespace","commit_id":"b1e2d6a1ee4674ce7cb860c722e32ebd5b8245d4"}]}
