)]}'
{"nova/compute/manager.py":[{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"31eba6aae9047a165a14dcd5f7179c4df6e22804","unresolved":false,"context_lines":[{"line_number":1611,"context_line":"                instance.task_state \u003d None"},{"line_number":1612,"context_line":"                # Update system metadata if necessary. The instance group"},{"line_number":1613,"context_line":"                # will be saved on the system metadata."},{"line_number":1614,"context_line":"                if filter_properties:"},{"line_number":1615,"context_line":"                    hints \u003d filter_properties.get(\u0027scheduler_hints\u0027) or {}"},{"line_number":1616,"context_line":"                    group_uuid \u003d hints.get(\u0027group\u0027)"},{"line_number":1617,"context_line":"                    if group_uuid:"}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAAU3%2F%2FcCQ%3D","line":1614,"updated":"2014-02-26 16:56:25.000000000","message":"build_and_run_instance is not used ATM - is this here by design? we should put it in run_instance method which is currently used.\n\nBut really - why is updating metadata this not in the scheduler where it used to be?\n\nBut really really - why do we need it at all still ? For backwards compatibility with different versions of the scheduler (this is not really versioned at all)? Once this lands - the metadata will not be used for determining groups so why add it here, we can allways look it up from the db?.\n\nAnd also it used to be \u0027group\u0027 and now it\u0027s \u0027instance group\u0027.","commit_id":"4c8ec34f91eeded07b4383fcd24e7974f4a6c167"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"1606025f0a3087b3347f8deb8c297346bf70bdf8","unresolved":false,"context_lines":[{"line_number":1611,"context_line":"                instance.task_state \u003d None"},{"line_number":1612,"context_line":"                # Update system metadata if necessary. The instance group"},{"line_number":1613,"context_line":"                # will be saved on the system metadata."},{"line_number":1614,"context_line":"                if filter_properties:"},{"line_number":1615,"context_line":"                    hints \u003d filter_properties.get(\u0027scheduler_hints\u0027) or {}"},{"line_number":1616,"context_line":"                    group_uuid \u003d hints.get(\u0027group\u0027)"},{"line_number":1617,"context_line":"                    if group_uuid:"}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAAU3%2F%2FaXU%3D","line":1614,"in_reply_to":"AAAAU3%2F%2FcCQ%3D","updated":"2014-02-27 10:06:12.000000000","message":"we no longer need this. the members will be updated when the scheduling takes place.\nthat is, if there has been a change on the instances in the specific instance group then the instance group will be updated accordingly.","commit_id":"4c8ec34f91eeded07b4383fcd24e7974f4a6c167"}],"nova/conductor/manager.py":[{"author":{"_account_id":1561,"name":"Russell Bryant","email":"rbryant@redhat.com","username":"russellb"},"change_message_id":"17dc450afd16bb0084c9f2efab89e6bb5cdb0704","unresolved":false,"context_lines":[{"line_number":324,"context_line":"        instance_group \u003d system_meta.get(\u0027instance_group\u0027, None)"},{"line_number":325,"context_line":"        if instance_group:"},{"line_number":326,"context_line":"            self.db.instance_group_member_delete(context, instance_group,"},{"line_number":327,"context_line":"                                                 instance[\u0027uuid\u0027])"},{"line_number":328,"context_line":"        self.db.instance_info_cache_delete(context, instance[\u0027uuid\u0027])"},{"line_number":329,"context_line":""},{"line_number":330,"context_line":"    def instance_info_cache_update(self, context, instance, values):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAP3%2F%2F4GY%3D","line":327,"updated":"2013-07-09 22:47:56.000000000","message":"This seems like an odd place to put this.\n\nPerhaps nova.db.sqlalchemy.api.instance_destroy() is the right place to clean this up?","commit_id":"69f2aae266e94eecbc32c56dbf1720bdc7430fbf"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"e536ca4e70172e314be8f1019624c632f47b2b07","unresolved":false,"context_lines":[{"line_number":324,"context_line":"        instance_group \u003d system_meta.get(\u0027instance_group\u0027, None)"},{"line_number":325,"context_line":"        if instance_group:"},{"line_number":326,"context_line":"            self.db.instance_group_member_delete(context, instance_group,"},{"line_number":327,"context_line":"                                                 instance[\u0027uuid\u0027])"},{"line_number":328,"context_line":"        self.db.instance_info_cache_delete(context, instance[\u0027uuid\u0027])"},{"line_number":329,"context_line":""},{"line_number":330,"context_line":"    def instance_info_cache_update(self, context, instance, values):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAP3%2F%2F3B8%3D","line":327,"in_reply_to":"AAAAP3%2F%2F4GY%3D","updated":"2013-07-10 09:04:22.000000000","message":"Good point. \nI think that it may be better to add this to nova.db.api.instance_destroy the motivation is that if there is another backend database implementation then the behavior would be different.","commit_id":"69f2aae266e94eecbc32c56dbf1720bdc7430fbf"}],"nova/db/api.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"9b352cd612476e4552d5e39e487d60e1d013190f","unresolved":false,"context_lines":[{"line_number":591,"context_line":"    \"\"\"Destroy the instance or raise if it does not exist.\"\"\""},{"line_number":592,"context_line":""},{"line_number":593,"context_line":"    # Delete the instance from the instance_group member data"},{"line_number":594,"context_line":"    system_meta \u003d instance_system_metadata_get(context, instance_uuid)"},{"line_number":595,"context_line":"    instance_group \u003d system_meta.get(\u0027instance_group\u0027)"},{"line_number":596,"context_line":"    if instance_group:"},{"line_number":597,"context_line":"        instance_group_member_delete(context, instance_group, instance_uuid)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAQn%2F%2Fbec%3D","line":594,"updated":"2013-07-31 10:48:21.000000000","message":"Sorry, not sure I get why this is needed?","commit_id":"53742dc304b3365907674433f9f61469f55022e9"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"2c36d99ed7307fc35a1820575128f8e91c3b56c8","unresolved":false,"context_lines":[{"line_number":591,"context_line":"    \"\"\"Destroy the instance or raise if it does not exist.\"\"\""},{"line_number":592,"context_line":""},{"line_number":593,"context_line":"    # Delete the instance from the instance_group member data"},{"line_number":594,"context_line":"    system_meta \u003d instance_system_metadata_get(context, instance_uuid)"},{"line_number":595,"context_line":"    instance_group \u003d system_meta.get(\u0027instance_group\u0027)"},{"line_number":596,"context_line":"    if instance_group:"},{"line_number":597,"context_line":"        instance_group_member_delete(context, instance_group, instance_uuid)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAQ3%2F%2F46c%3D","line":594,"in_reply_to":"AAAAQ3%2F%2F%2FYk%3D","updated":"2013-08-13 13:05:47.000000000","message":"I agree that it would be cleaner. The issue is that I do not think that this will land if we make a DB change now. The patch was actually approved 2 months ago - but was reverted due to the fact that it used the conductor API instead of direct access to the database.","commit_id":"53742dc304b3365907674433f9f61469f55022e9"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"75b364f6d611866bf1bbb99b3cc1c703112350c8","unresolved":false,"context_lines":[{"line_number":591,"context_line":"    \"\"\"Destroy the instance or raise if it does not exist.\"\"\""},{"line_number":592,"context_line":""},{"line_number":593,"context_line":"    # Delete the instance from the instance_group member data"},{"line_number":594,"context_line":"    system_meta \u003d instance_system_metadata_get(context, instance_uuid)"},{"line_number":595,"context_line":"    instance_group \u003d system_meta.get(\u0027instance_group\u0027)"},{"line_number":596,"context_line":"    if instance_group:"},{"line_number":597,"context_line":"        instance_group_member_delete(context, instance_group, instance_uuid)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAQ3%2F%2F%2FYk%3D","line":594,"in_reply_to":"AAAAQn%2F%2FbSQ%3D","updated":"2013-08-11 16:19:31.000000000","message":"Would seem cleaner to add that now ish. This feels very hacky/messy really, when the db could this in a more relational way.","commit_id":"53742dc304b3365907674433f9f61469f55022e9"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"41601fb361c0e35bc3a0df7a3b11a8e3cf905d18","unresolved":false,"context_lines":[{"line_number":591,"context_line":"    \"\"\"Destroy the instance or raise if it does not exist.\"\"\""},{"line_number":592,"context_line":""},{"line_number":593,"context_line":"    # Delete the instance from the instance_group member data"},{"line_number":594,"context_line":"    system_meta \u003d instance_system_metadata_get(context, instance_uuid)"},{"line_number":595,"context_line":"    instance_group \u003d system_meta.get(\u0027instance_group\u0027)"},{"line_number":596,"context_line":"    if instance_group:"},{"line_number":597,"context_line":"        instance_group_member_delete(context, instance_group, instance_uuid)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAQn%2F%2FbSQ%3D","line":594,"in_reply_to":"AAAAQn%2F%2Fbec%3D","updated":"2013-07-31 11:38:26.000000000","message":"This is how we get the instance group ID. That is, at the moment the instance data structure does not store the instance_group id (this is something that we would like to add in the future). At the moment this information is stored on the system metadata for the instance.\nWhen an instance is destroyed we need to remove the instance from the \u0027members\u0027 of the specific instance group.","commit_id":"53742dc304b3365907674433f9f61469f55022e9"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"9b352cd612476e4552d5e39e487d60e1d013190f","unresolved":false,"context_lines":[{"line_number":789,"context_line":""},{"line_number":790,"context_line":""},{"line_number":791,"context_line":"def instance_group_members_get(context, group_uuid):"},{"line_number":792,"context_line":"    \"\"\"Get the members from the group.\"\"\""},{"line_number":793,"context_line":"    return IMPL.instance_group_members_get(context, group_uuid)"},{"line_number":794,"context_line":""},{"line_number":795,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAQn%2F%2FbeQ%3D","line":792,"updated":"2013-07-31 10:48:21.000000000","message":"Could this not just exclude deleted instances?","commit_id":"53742dc304b3365907674433f9f61469f55022e9"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"2c36d99ed7307fc35a1820575128f8e91c3b56c8","unresolved":false,"context_lines":[{"line_number":789,"context_line":""},{"line_number":790,"context_line":""},{"line_number":791,"context_line":"def instance_group_members_get(context, group_uuid):"},{"line_number":792,"context_line":"    \"\"\"Get the members from the group.\"\"\""},{"line_number":793,"context_line":"    return IMPL.instance_group_members_get(context, group_uuid)"},{"line_number":794,"context_line":""},{"line_number":795,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAQ3%2F%2F46E%3D","line":792,"in_reply_to":"AAAAQn%2F%2FbeQ%3D","updated":"2013-08-13 13:05:47.000000000","message":"Not really sure what you mean by that. The scheduler code may not know which instances are deleted - hence the DB read.","commit_id":"53742dc304b3365907674433f9f61469f55022e9"},{"author":{"_account_id":1561,"name":"Russell Bryant","email":"rbryant@redhat.com","username":"russellb"},"change_message_id":"54360ac4d653796ecda9ff25b844b9398e16af16","unresolved":false,"context_lines":[{"line_number":623,"context_line":"    system_meta \u003d instance_system_metadata_get(context, instance_uuid)"},{"line_number":624,"context_line":"    instance_group \u003d system_meta.get(\u0027instance_group\u0027)"},{"line_number":625,"context_line":"    if instance_group:"},{"line_number":626,"context_line":"        instance_group_member_delete(context, instance_group, instance_uuid)"},{"line_number":627,"context_line":""},{"line_number":628,"context_line":"    rv \u003d IMPL.instance_destroy(context, instance_uuid, constraint)"},{"line_number":629,"context_line":"    if update_cells:"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAATn%2F%2FSQY%3D","line":626,"updated":"2013-11-11 17:36:38.000000000","message":"I don\u0027t feel great about hooking in here.  I\u0027m not sure I know what\u0027s best though.\n\nWhen loading a group, you could just ignore instances that don\u0027t exist, or even auto-delete them then, since that would mean they have been deleted.","commit_id":"7c3a5c1aa8774d4025e8a65a7d403297e79bafd1"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"f964837a6c80e3c601b91d4ac741d3e714a4a0f3","unresolved":false,"context_lines":[{"line_number":623,"context_line":"    system_meta \u003d instance_system_metadata_get(context, instance_uuid)"},{"line_number":624,"context_line":"    instance_group \u003d system_meta.get(\u0027instance_group\u0027)"},{"line_number":625,"context_line":"    if instance_group:"},{"line_number":626,"context_line":"        instance_group_member_delete(context, instance_group, instance_uuid)"},{"line_number":627,"context_line":""},{"line_number":628,"context_line":"    rv \u003d IMPL.instance_destroy(context, instance_uuid, constraint)"},{"line_number":629,"context_line":"    if update_cells:"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAATn%2F%2FSK8%3D","line":626,"in_reply_to":"AAAATn%2F%2FSQY%3D","updated":"2013-11-11 18:10:51.000000000","message":"interesting idea. the members of the instance group do not have the status of the instance - the idea was that it would just be those which are used. let me think about this a little","commit_id":"7c3a5c1aa8774d4025e8a65a7d403297e79bafd1"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"1ec18cad22bce79507208074a47f09596e46baaa","unresolved":false,"context_lines":[{"line_number":625,"context_line":"    system_meta \u003d instance_system_metadata_get(context, instance_uuid)"},{"line_number":626,"context_line":"    instance_group \u003d system_meta.get(\u0027instance_group\u0027)"},{"line_number":627,"context_line":"    if instance_group:"},{"line_number":628,"context_line":"        instance_group_member_delete(context, instance_group, instance_uuid)"},{"line_number":629,"context_line":""},{"line_number":630,"context_line":"    if update_cells:"},{"line_number":631,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F%2BWSM%3D","line":628,"updated":"2014-01-27 20:03:46.000000000","message":"If the instance group has been deleted already, then this will raise an exception and the instance deletion will be stuck in limbo forever.  It might make sense to handle exception.InstanceGroupNotFound here since it shouldn\u0027t prevent the instance deletion from continuing.","commit_id":"5b8f04485cafc1b9b6ff40ca30b6c0fe19de917b"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"ebeaf1685a94d131f7ebb83f7363da6629cfd697","unresolved":false,"context_lines":[{"line_number":625,"context_line":"    system_meta \u003d instance_system_metadata_get(context, instance_uuid)"},{"line_number":626,"context_line":"    instance_group \u003d system_meta.get(\u0027instance_group\u0027)"},{"line_number":627,"context_line":"    if instance_group:"},{"line_number":628,"context_line":"        instance_group_member_delete(context, instance_group, instance_uuid)"},{"line_number":629,"context_line":""},{"line_number":630,"context_line":"    if update_cells:"},{"line_number":631,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F%2BL38%3D","line":628,"in_reply_to":"AAAAUH%2F%2BWSM%3D","updated":"2014-01-29 10:11:49.000000000","message":"Done","commit_id":"5b8f04485cafc1b9b6ff40ca30b6c0fe19de917b"},{"author":{"_account_id":1561,"name":"Russell Bryant","email":"rbryant@redhat.com","username":"russellb"},"change_message_id":"6de377f014cad276c3bd58ae6bb9d85f5a48c6c8","unresolved":false,"context_lines":[{"line_number":627,"context_line":"    rv \u003d IMPL.instance_destroy(context, instance_uuid, constraint)"},{"line_number":628,"context_line":""},{"line_number":629,"context_line":"    # Delete the instance from the instance_group member data"},{"line_number":630,"context_line":"    system_meta \u003d instance_system_metadata_get(context, instance_uuid)"},{"line_number":631,"context_line":"    instance_group \u003d system_meta.get(\u0027instance_group\u0027)"},{"line_number":632,"context_line":"    if instance_group:"},{"line_number":633,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAUH%2F95uk%3D","line":630,"updated":"2014-02-02 02:12:47.000000000","message":"This is adding at least 1 extra query to instance_destroy() every time it gets called.  I wonder if we can optimize this out in many cases.\n\nWe could do something up in nova/objects/instance.py where we may already have the system_metadata and remove the instance from the group there and then pass down some hint to here that this check and removal isn\u0027t needed.\n\nI\u0027d be curious what Dan Smith thinks ...","commit_id":"8829e80ba7b0996acc5d3ae5d7a63e2d2f1b02b5"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"eca49683dee4d33788511c477ed66e7c32cd9cf7","unresolved":false,"context_lines":[{"line_number":627,"context_line":"    rv \u003d IMPL.instance_destroy(context, instance_uuid, constraint)"},{"line_number":628,"context_line":""},{"line_number":629,"context_line":"    # Delete the instance from the instance_group member data"},{"line_number":630,"context_line":"    system_meta \u003d instance_system_metadata_get(context, instance_uuid)"},{"line_number":631,"context_line":"    instance_group \u003d system_meta.get(\u0027instance_group\u0027)"},{"line_number":632,"context_line":"    if instance_group:"},{"line_number":633,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAUH%2F94bQ%3D","line":630,"in_reply_to":"AAAAUH%2F95uk%3D","updated":"2014-02-02 15:58:35.000000000","message":"Very good point. I have looked into this - the rv returned will contain the system metadata. I\u0027ll deal with this tomorrow - that is, we can read from the variable rv instead of having the additional query.","commit_id":"8829e80ba7b0996acc5d3ae5d7a63e2d2f1b02b5"},{"author":{"_account_id":7494,"name":"Guangya Liu","email":"gyliu513@gmail.com","username":"JayLau"},"change_message_id":"c2d2d30b3df904865d6389c4c3cbc340ae75619a","unresolved":false,"context_lines":[{"line_number":635,"context_line":"                instance_group_member_delete(context, instance_group,"},{"line_number":636,"context_line":"                                             instance_uuid)"},{"line_number":637,"context_line":"            except Exception:"},{"line_number":638,"context_line":"                LOG.exception(_(\"Failed to delete instance group member\"))"},{"line_number":639,"context_line":""},{"line_number":640,"context_line":"    if update_cells:"},{"line_number":641,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2Fkts%3D","line":638,"updated":"2014-02-12 09:11:16.000000000","message":"Can we enhance the message a bit by adding instance_group and instance_uuid to enhance debug ability?","commit_id":"95deb625645bdfbec872733dc7bf3814531609b3"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"2ce58c7489050baf909d81e792ed976231c4bb20","unresolved":false,"context_lines":[{"line_number":635,"context_line":"                instance_group_member_delete(context, instance_group,"},{"line_number":636,"context_line":"                                             instance_uuid)"},{"line_number":637,"context_line":"            except Exception:"},{"line_number":638,"context_line":"                LOG.exception(_(\"Failed to delete instance group member\"))"},{"line_number":639,"context_line":""},{"line_number":640,"context_line":"    if update_cells:"},{"line_number":641,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2FkXU%3D","line":638,"in_reply_to":"AAAAUX%2F%2Fkts%3D","updated":"2014-02-12 09:43:27.000000000","message":"Done","commit_id":"95deb625645bdfbec872733dc7bf3814531609b3"},{"author":{"_account_id":1561,"name":"Russell Bryant","email":"rbryant@redhat.com","username":"russellb"},"change_message_id":"3a21dd7eec43c4a6d2687eed4340a8a5311bf479","unresolved":false,"context_lines":[{"line_number":623,"context_line":"    rv \u003d IMPL.instance_destroy(context, instance_uuid, constraint)"},{"line_number":624,"context_line":""},{"line_number":625,"context_line":"    # Delete the instance from the instance_group member data"},{"line_number":626,"context_line":"    if hasattr(rv, \u0027system_metadata\u0027):"},{"line_number":627,"context_line":"        system_metadata \u003d utils.instance_sys_meta(rv)"},{"line_number":628,"context_line":"        instance_group \u003d system_metadata.get(\u0027instance_group\u0027)"},{"line_number":629,"context_line":"        if instance_group:"}],"source_content_type":"text/x-python","patch_set":22,"id":"AAAAUX%2F%2BfuE%3D","line":626,"updated":"2014-02-20 21:37:14.000000000","message":"What\u0027s the goal of hasattr() here?  Are you trying to avoid lazy loading of system_metadata?  That\u0027s my best guess, at least.\n\nIf so, I don\u0027t think it will work.  AFAIK, hasattr is just something like:\n\n    try:\n        getattr(...)\n        return True\n    except:\n        return False\n\nSo, it\u0027s going to do a getattr() internally and cause the lazy load to happen.","commit_id":"07964036b593e039c3b4d712d91af9b3be0b7bf3"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"316dfd68f655eb92434438563884e536bf73da78","unresolved":false,"context_lines":[{"line_number":623,"context_line":"    rv \u003d IMPL.instance_destroy(context, instance_uuid, constraint)"},{"line_number":624,"context_line":""},{"line_number":625,"context_line":"    # Delete the instance from the instance_group member data"},{"line_number":626,"context_line":"    if hasattr(rv, \u0027system_metadata\u0027):"},{"line_number":627,"context_line":"        system_metadata \u003d utils.instance_sys_meta(rv)"},{"line_number":628,"context_line":"        instance_group \u003d system_metadata.get(\u0027instance_group\u0027)"},{"line_number":629,"context_line":"        if instance_group:"}],"source_content_type":"text/x-python","patch_set":22,"id":"AAAAU3%2F%2F%2BLY%3D","line":626,"in_reply_to":"AAAAUX%2F%2BfuE%3D","updated":"2014-02-23 08:19:51.000000000","message":"Done\nI was not 100% sure that the system_metadata was loaded here. Thanks for the clarification.","commit_id":"07964036b593e039c3b4d712d91af9b3be0b7bf3"},{"author":{"_account_id":1561,"name":"Russell Bryant","email":"rbryant@redhat.com","username":"russellb"},"change_message_id":"794f646e14060e64a8ca65cb19ab996c6968aa46","unresolved":false,"context_lines":[{"line_number":633,"context_line":"            LOG.exception(_(\"Failed to delete instance group member \""},{"line_number":634,"context_line":"                            \"%s(member)s from %(ig).\"),"},{"line_number":635,"context_line":"                          {\u0027ig\u0027: instance_group, \u0027member\u0027: instance_uuid})"},{"line_number":636,"context_line":""},{"line_number":637,"context_line":"    if update_cells:"},{"line_number":638,"context_line":"        try:"},{"line_number":639,"context_line":"            cells_rpcapi.CellsAPI().instance_destroy_at_top(context, rv)"}],"source_content_type":"text/x-python","patch_set":24,"id":"AAAAU3%2F%2F0XQ%3D","line":636,"updated":"2014-02-24 16:45:01.000000000","message":"A while back I had suggested this may make better sense in the instance object.\n\nI did some looking and now definitely feel that way.  There was only one place left that wasn\u0027t deleting the instance via the instance object, and it\u0027s an error handling path, anyway.  I have a patch to fix it here: https://review.openstack.org/75921","commit_id":"6852255140342ef71e710b1a10843be88ccddf98"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"099a32d8d93f8a06c9d527ad3b5eaf6da8bfde44","unresolved":false,"context_lines":[{"line_number":633,"context_line":"            LOG.exception(_(\"Failed to delete instance group member \""},{"line_number":634,"context_line":"                            \"%s(member)s from %(ig).\"),"},{"line_number":635,"context_line":"                          {\u0027ig\u0027: instance_group, \u0027member\u0027: instance_uuid})"},{"line_number":636,"context_line":""},{"line_number":637,"context_line":"    if update_cells:"},{"line_number":638,"context_line":"        try:"},{"line_number":639,"context_line":"            cells_rpcapi.CellsAPI().instance_destroy_at_top(context, rv)"}],"source_content_type":"text/x-python","patch_set":24,"id":"AAAAU3%2F%2F0xw%3D","line":636,"updated":"2014-02-24 16:17:25.000000000","message":"This should be in the Instance object IMHO","commit_id":"6852255140342ef71e710b1a10843be88ccddf98"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"59b8c4cfb670b6ef5f7883ebf498798bc58ddcd6","unresolved":false,"context_lines":[{"line_number":633,"context_line":"            LOG.exception(_(\"Failed to delete instance group member \""},{"line_number":634,"context_line":"                            \"%s(member)s from %(ig).\"),"},{"line_number":635,"context_line":"                          {\u0027ig\u0027: instance_group, \u0027member\u0027: instance_uuid})"},{"line_number":636,"context_line":""},{"line_number":637,"context_line":"    if update_cells:"},{"line_number":638,"context_line":"        try:"},{"line_number":639,"context_line":"            cells_rpcapi.CellsAPI().instance_destroy_at_top(context, rv)"}],"source_content_type":"text/x-python","patch_set":24,"id":"AAAAU3%2F%2FqWo%3D","line":636,"in_reply_to":"AAAAU3%2F%2F0XQ%3D","updated":"2014-02-25 13:51:46.000000000","message":"Done","commit_id":"6852255140342ef71e710b1a10843be88ccddf98"}],"nova/objects/instance.py":[{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"31eba6aae9047a165a14dcd5f7179c4df6e22804","unresolved":false,"context_lines":[{"line_number":359,"context_line":""},{"line_number":360,"context_line":"        # Delete the instance from the instance_group member data. The"},{"line_number":361,"context_line":"        # instance group uuid is stored on the system_metadata"},{"line_number":362,"context_line":"        instance_group \u003d self.system_metadata.get(\u0027instance_group\u0027)"},{"line_number":363,"context_line":"        if instance_group:"},{"line_number":364,"context_line":"            try:"},{"line_number":365,"context_line":"                db.instance_group_member_delete(context, instance_group,"}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAAU3%2F%2Fb0A%3D","line":362,"updated":"2014-02-26 16:56:25.000000000","message":"Ah so this is why! (my comment from the caompute/manager.py. This is broken double book keeping that wil bite us IMHO. We can relatively efficiently look up the group based on the instance through InstanceMember table. We should be using that instead and not keep lame metadata keys.","commit_id":"4c8ec34f91eeded07b4383fcd24e7974f4a6c167"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"048ce52b3a4b178069bdf4534e7e7cac18fcf310","unresolved":false,"context_lines":[{"line_number":359,"context_line":""},{"line_number":360,"context_line":"        # Delete the instance from the instance_group member data. The"},{"line_number":361,"context_line":"        # instance group uuid is stored on the system_metadata"},{"line_number":362,"context_line":"        instance_group \u003d self.system_metadata.get(\u0027instance_group\u0027)"},{"line_number":363,"context_line":"        if instance_group:"},{"line_number":364,"context_line":"            try:"},{"line_number":365,"context_line":"                db.instance_group_member_delete(context, instance_group,"}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAAU3%2F%2Fae0%3D","line":362,"in_reply_to":"AAAAU3%2F%2Fa5k%3D","updated":"2014-02-26 19:23:54.000000000","message":"I missed that instance_id was indexed.  That\u0027s kind of gross given that it\u0027s a 255-byte string, but maybe that\u0027s just me being picky.  Also, an index is probably still not as efficient as an explicit back-reference.\n\nOn the other hand, if we are going to index it anyway then it might make sense to use it for this case, but if we\u0027re going to use a database transaction to find the instance group this instance is a member of then it would probably make sense to incorporate the delete operation into the same transaction instead of using two separate transactions.","commit_id":"4c8ec34f91eeded07b4383fcd24e7974f4a6c167"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"17139e89b425b8ef894084857d3600a24e798cb3","unresolved":false,"context_lines":[{"line_number":359,"context_line":""},{"line_number":360,"context_line":"        # Delete the instance from the instance_group member data. The"},{"line_number":361,"context_line":"        # instance group uuid is stored on the system_metadata"},{"line_number":362,"context_line":"        instance_group \u003d self.system_metadata.get(\u0027instance_group\u0027)"},{"line_number":363,"context_line":"        if instance_group:"},{"line_number":364,"context_line":"            try:"},{"line_number":365,"context_line":"                db.instance_group_member_delete(context, instance_group,"}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAAVX%2F%2F%2F%2F8%3D","line":362,"in_reply_to":"AAAAU3%2F%2Fae0%3D","updated":"2014-02-26 22:27:24.000000000","message":"Yeah that could be done as a single db method - up to garyk tho.\n\nExplicit back reference is a horrible idea here if done through a key value pair stored in a third table (system metadata) as it is now AND updated in a different service. It\u0027s just asking for trouble.","commit_id":"4c8ec34f91eeded07b4383fcd24e7974f4a6c167"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"1606025f0a3087b3347f8deb8c297346bf70bdf8","unresolved":false,"context_lines":[{"line_number":359,"context_line":""},{"line_number":360,"context_line":"        # Delete the instance from the instance_group member data. The"},{"line_number":361,"context_line":"        # instance group uuid is stored on the system_metadata"},{"line_number":362,"context_line":"        instance_group \u003d self.system_metadata.get(\u0027instance_group\u0027)"},{"line_number":363,"context_line":"        if instance_group:"},{"line_number":364,"context_line":"            try:"},{"line_number":365,"context_line":"                db.instance_group_member_delete(context, instance_group,"}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAAU3%2F%2FaWc%3D","line":362,"in_reply_to":"AAAAU3%2F%2Fae0%3D","updated":"2014-02-27 10:06:12.000000000","message":"we no longer need this. please see the change in the scheduler driver","commit_id":"4c8ec34f91eeded07b4383fcd24e7974f4a6c167"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"82e310016eca1c5ec8360a848ece4900d4fe1f90","unresolved":false,"context_lines":[{"line_number":359,"context_line":""},{"line_number":360,"context_line":"        # Delete the instance from the instance_group member data. The"},{"line_number":361,"context_line":"        # instance group uuid is stored on the system_metadata"},{"line_number":362,"context_line":"        instance_group \u003d self.system_metadata.get(\u0027instance_group\u0027)"},{"line_number":363,"context_line":"        if instance_group:"},{"line_number":364,"context_line":"            try:"},{"line_number":365,"context_line":"                db.instance_group_member_delete(context, instance_group,"}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAAU3%2F%2Fbac%3D","line":362,"in_reply_to":"AAAAU3%2F%2Fb0A%3D","updated":"2014-02-26 17:49:41.000000000","message":"We could conceivably have many instance groups with many members in them, so it would not be efficient to search all groups to see if the current instance is a member--for efficiency the instance needs to know which group it is in.\n\nI agree that storing it as a metadata item is a bit hacky, but at the same time I\u0027m not sure we want it to be a first-class instance field since many instances will not be in a group.","commit_id":"4c8ec34f91eeded07b4383fcd24e7974f4a6c167"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"f0b747387d5734bc6fcd64c13ea28aa41693e2db","unresolved":false,"context_lines":[{"line_number":359,"context_line":""},{"line_number":360,"context_line":"        # Delete the instance from the instance_group member data. The"},{"line_number":361,"context_line":"        # instance group uuid is stored on the system_metadata"},{"line_number":362,"context_line":"        instance_group \u003d self.system_metadata.get(\u0027instance_group\u0027)"},{"line_number":363,"context_line":"        if instance_group:"},{"line_number":364,"context_line":"            try:"},{"line_number":365,"context_line":"                db.instance_group_member_delete(context, instance_group,"}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAAU3%2F%2Fa5k%3D","line":362,"in_reply_to":"AAAAU3%2F%2Fbac%3D","updated":"2014-02-26 18:43:31.000000000","message":"No it wouldn\u0027t be inefficient it\u0027s a single query on an indexed field?!?\n\nSELECT * FROM instance_group_memeber WHERE instance_id \u003d my_id;\n\nHow is that inefficient?","commit_id":"4c8ec34f91eeded07b4383fcd24e7974f4a6c167"}],"nova/scheduler/driver.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"9b352cd612476e4552d5e39e487d60e1d013190f","unresolved":false,"context_lines":[{"line_number":92,"context_line":"        values.update(extra_values)"},{"line_number":93,"context_line":"        # Get the instance_group if it exists. This will be written to the"},{"line_number":94,"context_line":"        # system_metadata as it will be used when the VM is deleted"},{"line_number":95,"context_line":"        system_metadata \u003d extra_values.get(\u0027system_metadata\u0027, None)"},{"line_number":96,"context_line":"        if system_metadata:"},{"line_number":97,"context_line":"            instance_group \u003d system_metadata.get(\u0027instance_group\u0027, None)"},{"line_number":98,"context_line":"            if instance_group:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAQn%2F%2Fbdo%3D","line":95,"updated":"2013-07-31 10:48:21.000000000","message":"If this is really needed, should it not also be done at the db layer?","commit_id":"53742dc304b3365907674433f9f61469f55022e9"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"2c36d99ed7307fc35a1820575128f8e91c3b56c8","unresolved":false,"context_lines":[{"line_number":92,"context_line":"        values.update(extra_values)"},{"line_number":93,"context_line":"        # Get the instance_group if it exists. This will be written to the"},{"line_number":94,"context_line":"        # system_metadata as it will be used when the VM is deleted"},{"line_number":95,"context_line":"        system_metadata \u003d extra_values.get(\u0027system_metadata\u0027, None)"},{"line_number":96,"context_line":"        if system_metadata:"},{"line_number":97,"context_line":"            instance_group \u003d system_metadata.get(\u0027instance_group\u0027, None)"},{"line_number":98,"context_line":"            if instance_group:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAQ3%2F%2F46A%3D","line":95,"in_reply_to":"AAAAQ3%2F%2F%2FYg%3D","updated":"2013-08-13 13:05:47.000000000","message":"I agree with you but I do not think that this will land in time hence the usage of the metadata","commit_id":"53742dc304b3365907674433f9f61469f55022e9"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"75b364f6d611866bf1bbb99b3cc1c703112350c8","unresolved":false,"context_lines":[{"line_number":92,"context_line":"        values.update(extra_values)"},{"line_number":93,"context_line":"        # Get the instance_group if it exists. This will be written to the"},{"line_number":94,"context_line":"        # system_metadata as it will be used when the VM is deleted"},{"line_number":95,"context_line":"        system_metadata \u003d extra_values.get(\u0027system_metadata\u0027, None)"},{"line_number":96,"context_line":"        if system_metadata:"},{"line_number":97,"context_line":"            instance_group \u003d system_metadata.get(\u0027instance_group\u0027, None)"},{"line_number":98,"context_line":"            if instance_group:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAQ3%2F%2F%2FYg%3D","line":95,"in_reply_to":"AAAAQn%2F%2FbRk%3D","updated":"2013-08-11 16:19:31.000000000","message":"OK, I feel this method should be part of the db layer, then.\n\ndb.instance_add_instance_group() would make the intent more obvious, and easier to add in that extra collum if that happens later. Seems like a db implementation detail that it is stored in system_metadata, but maybe that makes no sense...","commit_id":"53742dc304b3365907674433f9f61469f55022e9"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"41601fb361c0e35bc3a0df7a3b11a8e3cf905d18","unresolved":false,"context_lines":[{"line_number":92,"context_line":"        values.update(extra_values)"},{"line_number":93,"context_line":"        # Get the instance_group if it exists. This will be written to the"},{"line_number":94,"context_line":"        # system_metadata as it will be used when the VM is deleted"},{"line_number":95,"context_line":"        system_metadata \u003d extra_values.get(\u0027system_metadata\u0027, None)"},{"line_number":96,"context_line":"        if system_metadata:"},{"line_number":97,"context_line":"            instance_group \u003d system_metadata.get(\u0027instance_group\u0027, None)"},{"line_number":98,"context_line":"            if instance_group:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAQn%2F%2FbRk%3D","line":95,"in_reply_to":"AAAAQn%2F%2Fbdo%3D","updated":"2013-07-31 11:38:26.000000000","message":"This is how we update the members of the instance group. It was the most logical place to do as it is a post scheduling opertaion.","commit_id":"53742dc304b3365907674433f9f61469f55022e9"},{"author":{"_account_id":7629,"name":"Shawn Hartsock","email":"hartsock@acm.org","username":"hartsocks"},"change_message_id":"b111f758838f2046b99895a6aea33374b7cc2cfc","unresolved":false,"context_lines":[{"line_number":162,"context_line":""},{"line_number":163,"context_line":"        instances \u003d instance_group[\u0027instances\u0027]"},{"line_number":164,"context_line":"        return [instance[\u0027host\u0027] for instance in instances"},{"line_number":165,"context_line":"                if instance.get(\u0027host\u0027) is not None]"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"    def schedule_run_instance(self, context, request_spec,"},{"line_number":168,"context_line":"                              admin_password, injected_files,"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAARH%2F%2FzFo%3D","line":165,"updated":"2013-08-17 11:07:24.000000000","message":"can two instances in an instance group have the same host? will all calling methods be written to handle that possibility? Would it be more intuitive to use a set here creating a list of unique hosts?","commit_id":"545815817e81eea24e904762ecf8203db87f3182"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"65fbaeee279a5336f1b405202bdacb1cb96c2fbb","unresolved":false,"context_lines":[{"line_number":162,"context_line":""},{"line_number":163,"context_line":"        instances \u003d instance_group[\u0027instances\u0027]"},{"line_number":164,"context_line":"        return [instance[\u0027host\u0027] for instance in instances"},{"line_number":165,"context_line":"                if instance.get(\u0027host\u0027) is not None]"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"    def schedule_run_instance(self, context, request_spec,"},{"line_number":168,"context_line":"                              admin_password, injected_files,"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAARX%2F%2F%2Fj4%3D","line":165,"in_reply_to":"AAAARH%2F%2FzFo%3D","updated":"2013-08-18 16:23:52.000000000","message":"In this specific use case the answer is no. At the moment we are supporting anti affinity - hence all of the entries are unique.But the set is nonetheless a good idea.","commit_id":"545815817e81eea24e904762ecf8203db87f3182"},{"author":{"_account_id":7494,"name":"Guangya Liu","email":"gyliu513@gmail.com","username":"JayLau"},"change_message_id":"a4efc04c060134f3fc5bb937664fb9a507319e7c","unresolved":false,"context_lines":[{"line_number":138,"context_line":"                    instances.append(instance)"},{"line_number":139,"context_line":"            except exception.InstanceNotFound:"},{"line_number":140,"context_line":"                LOG.error(_(\"Invalid instance %(member)s in instance \""},{"line_number":141,"context_line":"                            \" group %(group)s\"),"},{"line_number":142,"context_line":"                          {\u0027member\u0027: member, \u0027group\u0027: group_uuid})"},{"line_number":143,"context_line":"        return (instance_group, instances)"},{"line_number":144,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAATn%2F%2FVDg%3D","line":141,"updated":"2013-11-10 13:06:34.000000000","message":"Please remove this blank space","commit_id":"3665366bf94469d94f0f983a0aa5e0d1a3424482"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"36fe00e5da2efa2ecc74822032700b8282541bc5","unresolved":false,"context_lines":[{"line_number":138,"context_line":"                    instances.append(instance)"},{"line_number":139,"context_line":"            except exception.InstanceNotFound:"},{"line_number":140,"context_line":"                LOG.error(_(\"Invalid instance %(member)s in instance \""},{"line_number":141,"context_line":"                            \" group %(group)s\"),"},{"line_number":142,"context_line":"                          {\u0027member\u0027: member, \u0027group\u0027: group_uuid})"},{"line_number":143,"context_line":"        return (instance_group, instances)"},{"line_number":144,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAATn%2F%2FU%2Bo%3D","line":141,"in_reply_to":"AAAATn%2F%2FVDg%3D","updated":"2013-11-10 15:15:14.000000000","message":"Done","commit_id":"3665366bf94469d94f0f983a0aa5e0d1a3424482"},{"author":{"_account_id":7494,"name":"Guangya Liu","email":"gyliu513@gmail.com","username":"JayLau"},"change_message_id":"a4efc04c060134f3fc5bb937664fb9a507319e7c","unresolved":false,"context_lines":[{"line_number":143,"context_line":"        return (instance_group, instances)"},{"line_number":144,"context_line":""},{"line_number":145,"context_line":"    def instance_group_hosts(self, context, instances):"},{"line_number":146,"context_line":"        \"\"\"Return the hosts that have VM\u0027s from the instance_group.\"\"\""},{"line_number":147,"context_line":"        return set([instance[\u0027host\u0027] for instance in instances"},{"line_number":148,"context_line":"                    if instance.get(\u0027host\u0027) is not None])"},{"line_number":149,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAATn%2F%2FVCs%3D","line":146,"updated":"2013-11-10 13:06:34.000000000","message":"VM\u0027s or VMs? ;-)","commit_id":"3665366bf94469d94f0f983a0aa5e0d1a3424482"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"36fe00e5da2efa2ecc74822032700b8282541bc5","unresolved":false,"context_lines":[{"line_number":143,"context_line":"        return (instance_group, instances)"},{"line_number":144,"context_line":""},{"line_number":145,"context_line":"    def instance_group_hosts(self, context, instances):"},{"line_number":146,"context_line":"        \"\"\"Return the hosts that have VM\u0027s from the instance_group.\"\"\""},{"line_number":147,"context_line":"        return set([instance[\u0027host\u0027] for instance in instances"},{"line_number":148,"context_line":"                    if instance.get(\u0027host\u0027) is not None])"},{"line_number":149,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAATn%2F%2FU%2Bk%3D","line":146,"in_reply_to":"AAAATn%2F%2FVCs%3D","updated":"2013-11-10 15:15:14.000000000","message":"Done","commit_id":"3665366bf94469d94f0f983a0aa5e0d1a3424482"},{"author":{"_account_id":1561,"name":"Russell Bryant","email":"rbryant@redhat.com","username":"russellb"},"change_message_id":"54360ac4d653796ecda9ff25b844b9398e16af16","unresolved":false,"context_lines":[{"line_number":129,"context_line":""},{"line_number":130,"context_line":"    def instance_group_data(self, context, group_uuid):"},{"line_number":131,"context_line":"        \"\"\"Return the instance group and a list of relevant instances.\"\"\""},{"line_number":132,"context_line":"        instance_group \u003d db.instance_group_get(context, group_uuid)"},{"line_number":133,"context_line":"        instances \u003d []"},{"line_number":134,"context_line":"        for member in instance_group[\u0027members\u0027]:"},{"line_number":135,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAATn%2F%2FSQ4%3D","line":132,"updated":"2013-11-11 17:36:38.000000000","message":"How about converting this over to use the InstanceGroup object?\n\nIt also seems like the object should have an implementation inside of it to load up all of the instances that it contains (that haven\u0027t been deleted).","commit_id":"7c3a5c1aa8774d4025e8a65a7d403297e79bafd1"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"f964837a6c80e3c601b91d4ac741d3e714a4a0f3","unresolved":false,"context_lines":[{"line_number":129,"context_line":""},{"line_number":130,"context_line":"    def instance_group_data(self, context, group_uuid):"},{"line_number":131,"context_line":"        \"\"\"Return the instance group and a list of relevant instances.\"\"\""},{"line_number":132,"context_line":"        instance_group \u003d db.instance_group_get(context, group_uuid)"},{"line_number":133,"context_line":"        instances \u003d []"},{"line_number":134,"context_line":"        for member in instance_group[\u0027members\u0027]:"},{"line_number":135,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAATn%2F%2FSLI%3D","line":132,"in_reply_to":"AAAATn%2F%2FSQ4%3D","updated":"2013-11-11 18:10:51.000000000","message":"yes, good idea!","commit_id":"7c3a5c1aa8774d4025e8a65a7d403297e79bafd1"},{"author":{"_account_id":7629,"name":"Shawn Hartsock","email":"hartsock@acm.org","username":"hartsocks"},"change_message_id":"282b7fb611023df4f992c21e108e5d2408833284","unresolved":false,"context_lines":[{"line_number":102,"context_line":"            instance_group \u003d system_metadata.get(\u0027instance_group\u0027)"},{"line_number":103,"context_line":"            if instance_group:"},{"line_number":104,"context_line":"                db.instance_group_members_add(context, instance_group,"},{"line_number":105,"context_line":"                                              [instance_uuid])"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    return db.instance_update(context, instance_uuid, values)"},{"line_number":108,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F8puU%3D","line":105,"updated":"2013-12-23 18:42:35.000000000","message":"I don\u0027t like the flow of this block but I can\u0027t come up with anything better.","commit_id":"fb581d497e378bdb7115cba9a16ca463215cc77b"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"39b57e91f3c9b921d3c3af483b46b6f3a492033b","unresolved":false,"context_lines":[{"line_number":102,"context_line":"            instance_group \u003d system_metadata.get(\u0027instance_group\u0027)"},{"line_number":103,"context_line":"            if instance_group:"},{"line_number":104,"context_line":"                db.instance_group_members_add(context, instance_group,"},{"line_number":105,"context_line":"                                              [instance_uuid])"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    return db.instance_update(context, instance_uuid, values)"},{"line_number":108,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAT3%2F%2F88I%3D","line":105,"in_reply_to":"AAAATn%2F8puU%3D","updated":"2013-12-26 12:42:31.000000000","message":"this flow it to ensure that the instance groups is updated on the instance - at the moment this is part of the system metadata as it is not a first class citizen","commit_id":"fb581d497e378bdb7115cba9a16ca463215cc77b"},{"author":{"_account_id":6447,"name":"Avishay Balderman","email":"avishayb@radware.com","username":"avishayb"},"change_message_id":"998a49110c690819fe892e8bd6473bcdb8414d23","unresolved":false,"context_lines":[{"line_number":153,"context_line":""},{"line_number":154,"context_line":"    def instance_group_hosts(self, context, instances):"},{"line_number":155,"context_line":"        \"\"\"Return the hosts that have VMs from the instance_group.\"\"\""},{"line_number":156,"context_line":"        return set([instance[\u0027host\u0027] for instance in instances"},{"line_number":157,"context_line":"                    if instance.get(\u0027host\u0027) is not None])"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"    def schedule_run_instance(self, context, request_spec,"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F9Vuo%3D","line":156,"updated":"2013-12-12 14:22:23.000000000","message":"Isnt\nset([instance[\u0027host\u0027] for instance in instances\n\t\t   if instance.get(\u0027host\u0027) ])\n\nenough?","commit_id":"fb581d497e378bdb7115cba9a16ca463215cc77b"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"39b57e91f3c9b921d3c3af483b46b6f3a492033b","unresolved":false,"context_lines":[{"line_number":153,"context_line":""},{"line_number":154,"context_line":"    def instance_group_hosts(self, context, instances):"},{"line_number":155,"context_line":"        \"\"\"Return the hosts that have VMs from the instance_group.\"\"\""},{"line_number":156,"context_line":"        return set([instance[\u0027host\u0027] for instance in instances"},{"line_number":157,"context_line":"                    if instance.get(\u0027host\u0027) is not None])"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"    def schedule_run_instance(self, context, request_spec,"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAT3%2F%2F87k%3D","line":156,"in_reply_to":"AAAATn%2F8pzU%3D","updated":"2013-12-26 12:42:31.000000000","message":"Done","commit_id":"fb581d497e378bdb7115cba9a16ca463215cc77b"},{"author":{"_account_id":7629,"name":"Shawn Hartsock","email":"hartsock@acm.org","username":"hartsocks"},"change_message_id":"282b7fb611023df4f992c21e108e5d2408833284","unresolved":false,"context_lines":[{"line_number":153,"context_line":""},{"line_number":154,"context_line":"    def instance_group_hosts(self, context, instances):"},{"line_number":155,"context_line":"        \"\"\"Return the hosts that have VMs from the instance_group.\"\"\""},{"line_number":156,"context_line":"        return set([instance[\u0027host\u0027] for instance in instances"},{"line_number":157,"context_line":"                    if instance.get(\u0027host\u0027) is not None])"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"    def schedule_run_instance(self, context, request_spec,"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F8pzU%3D","line":156,"in_reply_to":"AAAATn%2F9Vuo%3D","updated":"2013-12-23 18:42:35.000000000","message":"+1","commit_id":"fb581d497e378bdb7115cba9a16ca463215cc77b"},{"author":{"_account_id":7629,"name":"Shawn Hartsock","email":"hartsock@acm.org","username":"hartsocks"},"change_message_id":"a279ca5126732ef0418d9a27439a28ac06bde8ee","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        if len(members) !\u003d len(ig.members):"},{"line_number":150,"context_line":"            ig.members \u003d members"},{"line_number":151,"context_line":"            ig.save()"},{"line_number":152,"context_line":"        return (ig, instances)"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"    def instance_group_hosts(self, context, instances):"},{"line_number":155,"context_line":"        \"\"\"Return the hosts that have VMs from the instance_group.\"\"\""}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAT3%2F%2F0yQ%3D","line":152,"updated":"2013-12-30 18:00:09.000000000","message":"I do not like this method because there are several repetitions in this code. Consider doing something that is more DRY...\n\nConsider:\nig \u003d instance_group.InstanceGroup.get_by_uuid(context, group_uuid)\ninstances \u003d []\nmissing \u003d []\nfor member in ig.members:\n    try:\n        instance \u003d db.instance_get_by_uuid(context, member)\n        # logically if an instance is not found then the\n        # not found exception is thrown, otherwise it exists.\n        instances.append(instance)\n    except exception.InstanceNotFound:\n        # logging\n        missing.append(member)\n\nif missing:\n    ig.members \u003d [ m for m in ig.members if m not in missing ]\n    ig.save()\n\nreturn (ig, instances)\n\n\nNOTE: if there is a real possibility that db.instance_get_by_uuid can return None then this should be an exception and you should raise it / catch it as you would InstanceNotFound","commit_id":"254636a51e67307514eacfc80a48cce66b1b2657"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"0f99e324c7f1804928d6ae8205ad7240da81cada","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        if len(members) !\u003d len(ig.members):"},{"line_number":150,"context_line":"            ig.members \u003d members"},{"line_number":151,"context_line":"            ig.save()"},{"line_number":152,"context_line":"        return (ig, instances)"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"    def instance_group_hosts(self, context, instances):"},{"line_number":155,"context_line":"        \"\"\"Return the hosts that have VMs from the instance_group.\"\"\""}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAUH%2F%2F%2BvI%3D","line":152,"in_reply_to":"AAAAT3%2F%2F0yQ%3D","updated":"2014-01-05 13:17:58.000000000","message":"I think that the code above is more efficient as it only has one loop. You are correct regarding the exception for the instance_get_by_uuid. I will update","commit_id":"254636a51e67307514eacfc80a48cce66b1b2657"},{"author":{"_account_id":7629,"name":"Shawn Hartsock","email":"hartsock@acm.org","username":"hartsocks"},"change_message_id":"aaf54fa84a3a774012fc5d3e88dd3415e456e9d4","unresolved":false,"context_lines":[{"line_number":148,"context_line":"        if len(members) !\u003d len(ig.members):"},{"line_number":149,"context_line":"            ig.members \u003d members"},{"line_number":150,"context_line":"            ig.save()"},{"line_number":151,"context_line":"        return (ig, instances)"},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"    def instance_group_hosts(self, context, instances):"},{"line_number":154,"context_line":"        \"\"\"Return the hosts that have VMs from the instance_group.\"\"\""}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAUH%2F%2F2io%3D","line":151,"updated":"2014-01-07 17:06:38.000000000","message":"I do not like this method because it is inefficient. \n\nConsider: how frequently do you think there are missing members? does this happen a lot? If it is rare then expending the extra loop once a month is actually far more efficient than expending the memory to store the two lists. \n\nAlso, you are forcing a database call to update the data, this is the largest time expense in the method dwarfing all other operations.\n\nI do not like this method because it is complicated.\n\nYou are asking the reader to mentally track two lists for later comparison and then reason about what the significance of the two lists are. If you communicated what the first list was and what the second list was beyond the general \u0027noun\u0027 members then I would be better able to mentally track what is happening here.\n\nConsider doing something that is more DRY...\n\nConsider:\n\ninstances \u003d []\nmissing \u003d []\nfor member in ig.members:\n    try:\n        instance \u003d db.instance_get_by_uuid(context, member)\n        # logically if an instance is not found then the\n        # not found exception is thrown, otherwise it exists.\n        instances.append(instance)\n    except exception.InstanceNotFound:\n        # logging code... and communicates \"save missing\"\n        missing.append(member)\n\nif missing:\n    # communicates: only do something if things were missing.\n    ig.members \u003d [ m for m in ig.members if m not in missing ]\n    ig.save()","commit_id":"39ff17ed7407f46c5baea310f07fe344238e3fb2"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"dc84eca1e04c99b9a3e99f8a65d072b37cf667aa","unresolved":false,"context_lines":[{"line_number":148,"context_line":"        if len(members) !\u003d len(ig.members):"},{"line_number":149,"context_line":"            ig.members \u003d members"},{"line_number":150,"context_line":"            ig.save()"},{"line_number":151,"context_line":"        return (ig, instances)"},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"    def instance_group_hosts(self, context, instances):"},{"line_number":154,"context_line":"        \"\"\"Return the hosts that have VMs from the instance_group.\"\"\""}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAUH%2F%2Fzos%3D","line":151,"in_reply_to":"AAAAUH%2F%2F2io%3D","updated":"2014-01-08 08:34:02.000000000","message":"I have refactored this taking into account your suggestion. Not sure I understand the line \"Also, you are forcing a database call to update the data, this is the largest time expense in the method dwarfing all other operations.\"\nThat is only done if and only if there is an inconsistency with the members. \nThe original code had the member management done when an instance was deleted. The community did not like that ...","commit_id":"39ff17ed7407f46c5baea310f07fe344238e3fb2"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"f8ba5a27422cdf4d8e6c81dd6758752acf2b84b1","unresolved":false,"context_lines":[{"line_number":146,"context_line":"                missing_members +\u003d 1"},{"line_number":147,"context_line":"        # A member may have been deleted - for example the instance was"},{"line_number":148,"context_line":"        # deleted. If this is the case then we need to purge the deleted"},{"line_number":149,"context_line":"        # instances from the members."},{"line_number":150,"context_line":"        if missing_members:"},{"line_number":151,"context_line":"            ig.members \u003d members"},{"line_number":152,"context_line":"            ig.save()"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAUH%2F%2FvfM%3D","line":149,"updated":"2014-01-09 00:06:57.000000000","message":"If I\u0027m reading this right, by putting this check here (rather than at instance deletion time like some previous versions) it means that if I delete an instance that is in a group and then run \"nova instance-group-list\" it will show the instance still present in the group.\n\nIf we\u0027re not going to delete the instance from the group at instance deletion time then I think we should check for deletion any time the data could be passed back to the user, otherwise it\u0027s going to be confusing for the user.\n\nI personally think that the most logical thing is to remove the instance from the group at instance deletion time.  Given that this likely won\u0027t be the only thing that wants this sort of behaviour I actually think the cleanest approach would be to have a notifier chain that gets called on instance deletion such that any code could register a callback that would be called with the instance being deleted as an argument...that way they can do whatever cleanup is necessary without explicitly adding to the main deletion code path.","commit_id":"e35c6a6621b60417109be5bdc2c5eb988d5b2d6c"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"b5820676d571df9be29c18d5effeeec2bf1a9c10","unresolved":false,"context_lines":[{"line_number":146,"context_line":"                missing_members +\u003d 1"},{"line_number":147,"context_line":"        # A member may have been deleted - for example the instance was"},{"line_number":148,"context_line":"        # deleted. If this is the case then we need to purge the deleted"},{"line_number":149,"context_line":"        # instances from the members."},{"line_number":150,"context_line":"        if missing_members:"},{"line_number":151,"context_line":"            ig.members \u003d members"},{"line_number":152,"context_line":"            ig.save()"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAUH%2F%2FsV0%3D","line":149,"in_reply_to":"AAAAUH%2F%2FuM4%3D","updated":"2014-01-09 15:37:12.000000000","message":"I saw that comment earlier.  I understand where he\u0027s coming from (we wouldn\u0027t want everyone to explicitly add code to the instance deletion function) which is why I suggested the notifier chain.\n\nIf we had a standard way for arbitrary code to register a callback that would be called when an instance is deleted I think that would solve the problem of code messiness as well as the goal of timely database updates.","commit_id":"e35c6a6621b60417109be5bdc2c5eb988d5b2d6c"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"2696b67ffd5122ce3fafe8b4b38934b9f2ef2831","unresolved":false,"context_lines":[{"line_number":146,"context_line":"                missing_members +\u003d 1"},{"line_number":147,"context_line":"        # A member may have been deleted - for example the instance was"},{"line_number":148,"context_line":"        # deleted. If this is the case then we need to purge the deleted"},{"line_number":149,"context_line":"        # instances from the members."},{"line_number":150,"context_line":"        if missing_members:"},{"line_number":151,"context_line":"            ig.members \u003d members"},{"line_number":152,"context_line":"            ig.save()"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAUH%2F%2FuM4%3D","line":149,"in_reply_to":"AAAAUH%2F%2FvfM%3D","updated":"2014-01-09 07:38:50.000000000","message":"Chris I agree 100% with you. Can you please see Russell\u0027s comments on patch set 10. I will return that code. https://review.openstack.org/#/c/33956/10/nova/db/api.py","commit_id":"e35c6a6621b60417109be5bdc2c5eb988d5b2d6c"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"4d6707214e05fe4ff8839042a499496e89a25446","unresolved":false,"context_lines":[{"line_number":135,"context_line":"        for member in ig.members:"},{"line_number":136,"context_line":"            try:"},{"line_number":137,"context_line":"                instance \u003d db.instance_get_by_uuid(context, member)"},{"line_number":138,"context_line":"                instances.append(instance)"},{"line_number":139,"context_line":"            except exception.InstanceNotFound:"},{"line_number":140,"context_line":"                LOG.error(_(\"Invalid instance %(member)s in instance \""},{"line_number":141,"context_line":"                            \"group %(group)s\"),"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAAUH%2F%2FsMM%3D","line":138,"updated":"2014-01-09 15:39:00.000000000","message":"It seems like we could have an instance get deleted in between getting \"ig\" and trying to get all the instances in the group?\n\nIf so, then first of all that error message is a bit misleading--it\u0027s not invalid, just stale.  Second, the return values of this routine will have a mismatch between ig.members and instances.  Maybe we should document this, or else resolve the mismatch?","commit_id":"af5bfefa1e2db4d0a7334edad6b7fdbeaf5a027a"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"8672f442b816316076efeccbd1ebeb54285ceb8b","unresolved":false,"context_lines":[{"line_number":135,"context_line":"        for member in ig.members:"},{"line_number":136,"context_line":"            try:"},{"line_number":137,"context_line":"                instance \u003d db.instance_get_by_uuid(context, member)"},{"line_number":138,"context_line":"                instances.append(instance)"},{"line_number":139,"context_line":"            except exception.InstanceNotFound:"},{"line_number":140,"context_line":"                LOG.error(_(\"Invalid instance %(member)s in instance \""},{"line_number":141,"context_line":"                            \"group %(group)s\"),"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAAUH%2F%2FiNk%3D","line":138,"in_reply_to":"AAAAUH%2F%2Fkyg%3D","updated":"2014-01-12 09:34:26.000000000","message":"Our goal in the long run is to have the instance group id as a firct class member of an instance. That will help return the data with one database access instead of two. Prior to doing that we need to be the API\u0027s. It is a nice idea but I do not think that it is relevant in the context of this change as we are planning to change this morning forwards.","commit_id":"af5bfefa1e2db4d0a7334edad6b7fdbeaf5a027a"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"8672f442b816316076efeccbd1ebeb54285ceb8b","unresolved":false,"context_lines":[{"line_number":135,"context_line":"        for member in ig.members:"},{"line_number":136,"context_line":"            try:"},{"line_number":137,"context_line":"                instance \u003d db.instance_get_by_uuid(context, member)"},{"line_number":138,"context_line":"                instances.append(instance)"},{"line_number":139,"context_line":"            except exception.InstanceNotFound:"},{"line_number":140,"context_line":"                LOG.error(_(\"Invalid instance %(member)s in instance \""},{"line_number":141,"context_line":"                            \"group %(group)s\"),"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAAUH%2F%2FiN0%3D","line":138,"in_reply_to":"AAAAUH%2F%2FsMM%3D","updated":"2014-01-12 09:34:26.000000000","message":"There may be situations when there are inconsistencies. A classic example is when one will be deleting an instance that is part of an instance group. The delete operation may take place after a new VM is spawned in the instance group.\nI think that the code above is correct - it gives the scheduler the current view of the instances that are running that are associated with the instance group.\nI will change the message as it may be a little misleading.","commit_id":"af5bfefa1e2db4d0a7334edad6b7fdbeaf5a027a"},{"author":{"_account_id":7629,"name":"Shawn Hartsock","email":"hartsock@acm.org","username":"hartsocks"},"change_message_id":"ba48bc59a09ae718b25a9c2c8c3d232271fcd325","unresolved":false,"context_lines":[{"line_number":135,"context_line":"        for member in ig.members:"},{"line_number":136,"context_line":"            try:"},{"line_number":137,"context_line":"                instance \u003d db.instance_get_by_uuid(context, member)"},{"line_number":138,"context_line":"                instances.append(instance)"},{"line_number":139,"context_line":"            except exception.InstanceNotFound:"},{"line_number":140,"context_line":"                LOG.error(_(\"Invalid instance %(member)s in instance \""},{"line_number":141,"context_line":"                            \"group %(group)s\"),"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAAUH%2F%2Fkyg%3D","line":138,"in_reply_to":"AAAAUH%2F%2FsMM%3D","updated":"2014-01-10 21:20:32.000000000","message":"seems to me like InstanceGroup is always used in conjunction with full instance objects. Can we alter InstanceGroup so that it uses a join on members to pull back full instance objects instead of making a second trip to the DB?","commit_id":"af5bfefa1e2db4d0a7334edad6b7fdbeaf5a027a"},{"author":{"_account_id":1561,"name":"Russell Bryant","email":"rbryant@redhat.com","username":"russellb"},"change_message_id":"0ac16adf6777e6acba7ba02b99984eab7dbd8f8e","unresolved":false,"context_lines":[{"line_number":129,"context_line":"        instances \u003d []"},{"line_number":130,"context_line":"        for member in ig.members:"},{"line_number":131,"context_line":"            try:"},{"line_number":132,"context_line":"                instance \u003d db.instance_get_by_uuid(context, member)"},{"line_number":133,"context_line":"                instances.append(instance)"},{"line_number":134,"context_line":"            except exception.InstanceNotFound:"},{"line_number":135,"context_line":"                LOG.warning(_(\"Instance %(member)s defined in group \""}],"source_content_type":"text/x-python","patch_set":20,"id":"AAAAUX%2F%2F6lo%3D","line":132,"updated":"2014-02-09 23:28:48.000000000","message":"I think this should use the instance object instead of adding a new direct db query for an instance.\n\nYou could add a classmethod on InstanceList to do something like get_by_group_uuid().","commit_id":"4114d281fa575a96e97db705d29b33e3d0ff5fe4"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"2c54152543aed7de19b11af64ec09e1619725e93","unresolved":false,"context_lines":[{"line_number":129,"context_line":"        instances \u003d []"},{"line_number":130,"context_line":"        for member in ig.members:"},{"line_number":131,"context_line":"            try:"},{"line_number":132,"context_line":"                instance \u003d db.instance_get_by_uuid(context, member)"},{"line_number":133,"context_line":"                instances.append(instance)"},{"line_number":134,"context_line":"            except exception.InstanceNotFound:"},{"line_number":135,"context_line":"                LOG.warning(_(\"Instance %(member)s defined in group \""}],"source_content_type":"text/x-python","patch_set":20,"id":"AAAAUX%2F%2F3gg%3D","line":132,"in_reply_to":"AAAAUX%2F%2F6lo%3D","updated":"2014-02-10 09:41:49.000000000","message":"I have used the instance object","commit_id":"4114d281fa575a96e97db705d29b33e3d0ff5fe4"},{"author":{"_account_id":1561,"name":"Russell Bryant","email":"rbryant@redhat.com","username":"russellb"},"change_message_id":"3a21dd7eec43c4a6d2687eed4340a8a5311bf479","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        if system_metadata:"},{"line_number":101,"context_line":"            instance_group \u003d system_metadata.get(\u0027instance_group\u0027)"},{"line_number":102,"context_line":"            if instance_group:"},{"line_number":103,"context_line":"                db.instance_group_members_add(context, instance_group,"},{"line_number":104,"context_line":"                                              [instance_uuid])"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"    return db.instance_update(context, instance_uuid, values)"}],"source_content_type":"text/x-python","patch_set":22,"id":"AAAAUX%2F%2Bfs0%3D","line":103,"updated":"2014-02-20 21:37:14.000000000","message":"I think we need to avoid new db calls and use a nova object call here.","commit_id":"07964036b593e039c3b4d712d91af9b3be0b7bf3"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"316dfd68f655eb92434438563884e536bf73da78","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        if system_metadata:"},{"line_number":101,"context_line":"            instance_group \u003d system_metadata.get(\u0027instance_group\u0027)"},{"line_number":102,"context_line":"            if instance_group:"},{"line_number":103,"context_line":"                db.instance_group_members_add(context, instance_group,"},{"line_number":104,"context_line":"                                              [instance_uuid])"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"    return db.instance_update(context, instance_uuid, values)"}],"source_content_type":"text/x-python","patch_set":22,"id":"AAAAU3%2F%2F%2BKA%3D","line":103,"in_reply_to":"AAAAUX%2F%2Bfs0%3D","updated":"2014-02-23 08:19:51.000000000","message":"Done","commit_id":"07964036b593e039c3b4d712d91af9b3be0b7bf3"},{"author":{"_account_id":1561,"name":"Russell Bryant","email":"rbryant@redhat.com","username":"russellb"},"change_message_id":"3a21dd7eec43c4a6d2687eed4340a8a5311bf479","unresolved":false,"context_lines":[{"line_number":134,"context_line":"                LOG.warning(_(\"Instance %(member)s defined in group \""},{"line_number":135,"context_line":"                            \"group %(group)s is not found.\"),"},{"line_number":136,"context_line":"                          {\u0027member\u0027: member, \u0027group\u0027: group_uuid})"},{"line_number":137,"context_line":"        return (ig, instances)"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"    def instance_group_hosts(self, context, instances):"},{"line_number":140,"context_line":"        \"\"\"Return the hosts that have VMs from the instance_group.\"\"\""}],"source_content_type":"text/x-python","patch_set":22,"id":"AAAAUX%2F%2Bfo0%3D","line":137,"updated":"2014-02-20 21:37:14.000000000","message":"I think it would be a bit nicer to have a method on the InstanceGroup object that just returned an InstanceList instead of having to iterate like this in the scheduler.\n\nAnd an even nicer improvement would be to fix this so the instances are looked up using a single db query instead of a query per instance in the group.  For large groups this is going to get expensive and very slow.","commit_id":"07964036b593e039c3b4d712d91af9b3be0b7bf3"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"316dfd68f655eb92434438563884e536bf73da78","unresolved":false,"context_lines":[{"line_number":134,"context_line":"                LOG.warning(_(\"Instance %(member)s defined in group \""},{"line_number":135,"context_line":"                            \"group %(group)s is not found.\"),"},{"line_number":136,"context_line":"                          {\u0027member\u0027: member, \u0027group\u0027: group_uuid})"},{"line_number":137,"context_line":"        return (ig, instances)"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"    def instance_group_hosts(self, context, instances):"},{"line_number":140,"context_line":"        \"\"\"Return the hosts that have VMs from the instance_group.\"\"\""}],"source_content_type":"text/x-python","patch_set":22,"id":"AAAAU3%2F%2F%2BIE%3D","line":137,"in_reply_to":"AAAAUX%2F%2Bfo0%3D","updated":"2014-02-23 08:19:51.000000000","message":"Done","commit_id":"07964036b593e039c3b4d712d91af9b3be0b7bf3"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"07100e24ba9c20a231a156dc2cd90a82ecb96066","unresolved":false,"context_lines":[{"line_number":96,"context_line":"        values.update(extra_values)"},{"line_number":97,"context_line":"        # Get the instance_group if it exists. This will be written to the"},{"line_number":98,"context_line":"        # system_metadata as it will be used when the VM is deleted"},{"line_number":99,"context_line":"        system_metadata \u003d extra_values.get(\u0027system_metadata\u0027)"},{"line_number":100,"context_line":"        if system_metadata:"},{"line_number":101,"context_line":"            instance_group \u003d system_metadata.get(\u0027instance_group\u0027)"},{"line_number":102,"context_line":"            if instance_group:"}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAAU3%2F%2F1Ig%3D","line":99,"updated":"2014-02-24 16:20:40.000000000","message":"This seems very hacky. We only want to save the instance_group if its updated, which is what we try to do the with extra_values here.\n\nWould it not be better to have an explicit save_instance_group call when required?","commit_id":"00c2365f492e77b2d901b0c2daff83164e78ba56"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"d8041735a116744a78c1c7e773ae97d5f0b41f57","unresolved":false,"context_lines":[{"line_number":96,"context_line":"        values.update(extra_values)"},{"line_number":97,"context_line":"        # Get the instance_group if it exists. This will be written to the"},{"line_number":98,"context_line":"        # system_metadata as it will be used when the VM is deleted"},{"line_number":99,"context_line":"        system_metadata \u003d extra_values.get(\u0027system_metadata\u0027)"},{"line_number":100,"context_line":"        if system_metadata:"},{"line_number":101,"context_line":"            instance_group \u003d system_metadata.get(\u0027instance_group\u0027)"},{"line_number":102,"context_line":"            if instance_group:"}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAAU3%2F%2FpoM%3D","line":99,"in_reply_to":"AAAAU3%2F%2F1Ig%3D","updated":"2014-02-25 13:51:40.000000000","message":"please see the filter scheduler code","commit_id":"00c2365f492e77b2d901b0c2daff83164e78ba56"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"099a32d8d93f8a06c9d527ad3b5eaf6da8bfde44","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        if system_metadata:"},{"line_number":101,"context_line":"            instance_group \u003d system_metadata.get(\u0027instance_group\u0027)"},{"line_number":102,"context_line":"            if instance_group:"},{"line_number":103,"context_line":"                ig \u003d ig_obj.InstanceGroup.get_by_uuid(context, instance_group)"},{"line_number":104,"context_line":"                ig.members +\u003d [instance_uuid]"},{"line_number":105,"context_line":"                ig.save()"},{"line_number":106,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"AAAAU3%2F%2F0yI%3D","line":103,"updated":"2014-02-24 16:17:25.000000000","message":"This would be a lot cleaner, IMHO, if you had a method like this:\n\n  def get_by_instance():\n\non the InstanceGroup that would look in system_metadata and return the group if possible. That decouples this code from the knowledge about how we determine that link, and makes it simpler.","commit_id":"6852255140342ef71e710b1a10843be88ccddf98"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"59b8c4cfb670b6ef5f7883ebf498798bc58ddcd6","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        if system_metadata:"},{"line_number":101,"context_line":"            instance_group \u003d system_metadata.get(\u0027instance_group\u0027)"},{"line_number":102,"context_line":"            if instance_group:"},{"line_number":103,"context_line":"                ig \u003d ig_obj.InstanceGroup.get_by_uuid(context, instance_group)"},{"line_number":104,"context_line":"                ig.members +\u003d [instance_uuid]"},{"line_number":105,"context_line":"                ig.save()"},{"line_number":106,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"AAAAU3%2F%2Fpzs%3D","line":103,"in_reply_to":"AAAAU3%2F%2F0yI%3D","updated":"2014-02-25 13:51:46.000000000","message":"i am not sure that i understand your comment here. the instance groups needs to be updated with the instance id. that is, the instance group has a field members. this has all of the active members that are currently used.\nSo, for example if we have IG A and instance X is deployed then the members will have [X]. If another instance Y is booted with the IG A then Y will be added. This means we will have [X, Y]. The contents of the members helps with the scheduling logic.\n\nThe code above updates the members. I do not understand how get_by_instance will help here.","commit_id":"6852255140342ef71e710b1a10843be88ccddf98"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"1b975085363d690b937d4ec7cd8485ae9b5774a1","unresolved":false,"context_lines":[{"line_number":129,"context_line":"        if len(instances) !\u003d len(ig.members):"},{"line_number":130,"context_line":"            # Update the instance group members"},{"line_number":131,"context_line":"            ig.members \u003d [instance.uuid for instance in instances]"},{"line_number":132,"context_line":"            ig.save()"},{"line_number":133,"context_line":"        return (ig, instances)"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def instance_group_hosts(self, context, instances):"}],"source_content_type":"text/x-python","patch_set":26,"id":"AAAAVX%2F%2F6mw%3D","line":132,"updated":"2014-02-27 12:05:55.000000000","message":"Ah I see what this is supposed to do... it will update the instance group pruning instances deleted in the meantime... where meantime is between scheduling of any instances of that group...\n\nWell - I guess... but this makes the show API for groups basically useless bcz you need to check for all the members that it returned if they are still there, since the list can get stale for an unlimited period of time...\n\nIMHO - removing from the group should go back in the instance object\u0027s destroy. I know it\u0027s more work to do since you likely need to add a db api method for this, but IMHO it\u0027s the only real solution.","commit_id":"1bad830bfa7e2d200bb95d8f5899ed1e50174112"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"c61800bc33f5377156b32af4f2f204b2dbcc5c5d","unresolved":false,"context_lines":[{"line_number":129,"context_line":"        if len(instances) !\u003d len(ig.members):"},{"line_number":130,"context_line":"            # Update the instance group members"},{"line_number":131,"context_line":"            ig.members \u003d [instance.uuid for instance in instances]"},{"line_number":132,"context_line":"            ig.save()"},{"line_number":133,"context_line":"        return (ig, instances)"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def instance_group_hosts(self, context, instances):"}],"source_content_type":"text/x-python","patch_set":26,"id":"AAAAVX%2F%2FxKQ%3D","line":132,"in_reply_to":"AAAAVX%2F%2F5j0%3D","updated":"2014-02-28 12:19:08.000000000","message":"Ok makes sense.","commit_id":"1bad830bfa7e2d200bb95d8f5899ed1e50174112"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"8937469748ad3d378d90a72ade7850de2e78d793","unresolved":false,"context_lines":[{"line_number":129,"context_line":"        if len(instances) !\u003d len(ig.members):"},{"line_number":130,"context_line":"            # Update the instance group members"},{"line_number":131,"context_line":"            ig.members \u003d [instance.uuid for instance in instances]"},{"line_number":132,"context_line":"            ig.save()"},{"line_number":133,"context_line":"        return (ig, instances)"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def instance_group_hosts(self, context, instances):"}],"source_content_type":"text/x-python","patch_set":26,"id":"AAAAVX%2F%2F5j0%3D","line":132,"in_reply_to":"AAAAVX%2F%2F6mw%3D","updated":"2014-02-27 14:18:49.000000000","message":"i would like to propose the following:\n1. we keep this code and this is the place where the instance group is updated\n2. with the display for the instance groups we display the member iff the following holds:\n    i. the policy is affinity or anti affinity\n    ii. the instance is running\nIn versions moving forwards we change the meaning of the instance meber value - this is a uuid - for this specific case it means the instance id. In other cases, for example network proximity it may mean an object.\nI\u0027ll add a NOTE here and address this in the API code.","commit_id":"1bad830bfa7e2d200bb95d8f5899ed1e50174112"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"289d9ae0d972011db53fa9e103f6f4f0beb645bd","unresolved":false,"context_lines":[{"line_number":131,"context_line":"            # are not deleted if the policy is \u0027affinity\u0027 or \u0027anti-affinity\u0027"},{"line_number":132,"context_line":"            # Update the instance group members"},{"line_number":133,"context_line":"            ig.members \u003d [instance.uuid for instance in instances]"},{"line_number":134,"context_line":"            ig.save()"},{"line_number":135,"context_line":"        return (ig, instances)"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    def instance_group_hosts(self, context, instances):"}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAAVn%2F%2F2wc%3D","line":134,"updated":"2014-03-03 19:25:44.000000000","message":"This will race with other schedulers.","commit_id":"fd651bd0430e229c26699e696318c203a99bb7fa"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"4ad568b82fd4e7b69db9d2d51c6aaed5b9f53ba3","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        ig \u003d ig_obj.InstanceGroup.get_by_uuid(context, group_uuid)"},{"line_number":123,"context_line":"        return (ig, ig.get_instances(context))"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"    def instance_group_hosts(self, context, instances):"},{"line_number":126,"context_line":"        \"\"\"Return the hosts that have VMs from the instance_group.\"\"\""},{"line_number":127,"context_line":"        return set([instance[\u0027host\u0027] for instance in instances"},{"line_number":128,"context_line":"                    if instance.get(\u0027host\u0027)])"}],"source_content_type":"text/x-python","patch_set":33,"id":"AAAAVn%2F%2Fv%2F8%3D","line":125,"updated":"2014-03-04 10:01:36.000000000","message":"We don\u0027t need this now that we have the previous patch, do we?","commit_id":"f2c2dd28ff1c061acf4ef54ca8f142895227b1b1"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"a049a3d97f0c3a831a87f5450d4684c5f454d65a","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        ig \u003d ig_obj.InstanceGroup.get_by_uuid(context, group_uuid)"},{"line_number":123,"context_line":"        return (ig, ig.get_instances(context))"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"    def instance_group_hosts(self, context, instances):"},{"line_number":126,"context_line":"        \"\"\"Return the hosts that have VMs from the instance_group.\"\"\""},{"line_number":127,"context_line":"        return set([instance[\u0027host\u0027] for instance in instances"},{"line_number":128,"context_line":"                    if instance.get(\u0027host\u0027)])"}],"source_content_type":"text/x-python","patch_set":33,"id":"AAAAVn%2F%2Fufo%3D","line":125,"in_reply_to":"AAAAVn%2F%2Fv%2F8%3D","updated":"2014-03-04 13:09:34.000000000","message":"this is no loner needed","commit_id":"f2c2dd28ff1c061acf4ef54ca8f142895227b1b1"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"ae5a1b6728bd878c478cd8a7e5669d5967f90b0b","unresolved":false,"context_lines":[{"line_number":120,"context_line":"    def instance_group_data(self, context, group_uuid):"},{"line_number":121,"context_line":"        \"\"\"Return the instance group and a list of instance hosts.\"\"\""},{"line_number":122,"context_line":"        ig \u003d ig_obj.InstanceGroup.get_by_uuid(context, group_uuid)"},{"line_number":123,"context_line":"        return (ig, ig.get_hosts(context))"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"    def schedule_run_instance(self, context, request_spec,"},{"line_number":126,"context_line":"                              admin_password, injected_files,"}],"source_content_type":"text/x-python","patch_set":35,"id":"AAAAVn%2F%2FqnY%3D","line":123,"updated":"2014-03-04 19:24:26.000000000","message":"I\u0027m not sure that this helper method is really necessary as it\u0027s only called from one place, and obscures what we\u0027re looking at in that place, IMHO.","commit_id":"f0545a9e3da3c9de49debf6bb6f5a68cd292dee5"},{"author":{"_account_id":1561,"name":"Russell Bryant","email":"rbryant@redhat.com","username":"russellb"},"change_message_id":"2b620b9a25fb86f43fde3fd39c8af1de03a489bf","unresolved":false,"context_lines":[{"line_number":120,"context_line":"    def instance_group_data(self, context, group_uuid):"},{"line_number":121,"context_line":"        \"\"\"Return the instance group and a list of instance hosts.\"\"\""},{"line_number":122,"context_line":"        ig \u003d ig_obj.InstanceGroup.get_by_uuid(context, group_uuid)"},{"line_number":123,"context_line":"        return (ig, ig.get_hosts(context))"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"    def schedule_run_instance(self, context, request_spec,"},{"line_number":126,"context_line":"                              admin_password, injected_files,"}],"source_content_type":"text/x-python","patch_set":35,"id":"AAAAVn%2F%2Fpww%3D","line":123,"in_reply_to":"AAAAVn%2F%2FqnY%3D","updated":"2014-03-04 20:50:08.000000000","message":"Done","commit_id":"f0545a9e3da3c9de49debf6bb6f5a68cd292dee5"}],"nova/scheduler/filter_scheduler.py":[{"author":{"_account_id":1561,"name":"Russell Bryant","email":"rbryant@redhat.com","username":"russellb"},"change_message_id":"17dc450afd16bb0084c9f2efab89e6bb5cdb0704","unresolved":false,"context_lines":[{"line_number":173,"context_line":""},{"line_number":174,"context_line":"        # Update the metadata if necessary"},{"line_number":175,"context_line":"        scheduler_hints \u003d filter_properties.get(\u0027scheduler_hints\u0027) or {}"},{"line_number":176,"context_line":"        group_uuid \u003d scheduler_hints.get(\u0027instance_group\u0027, None)"},{"line_number":177,"context_line":"        values \u003d None"},{"line_number":178,"context_line":"        if group_uuid:"},{"line_number":179,"context_line":"            values \u003d request_spec[\u0027instance_properties\u0027][\u0027system_metadata\u0027]"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAP3%2F%2F4GE%3D","line":176,"updated":"2013-07-09 22:47:56.000000000","message":"How important is the change from \u0027group\u0027 to \u0027instance_group\u0027?  If it\u0027s purely cosmetic, can it be left alone to avoid a backwards compatibility break?","commit_id":"69f2aae266e94eecbc32c56dbf1720bdc7430fbf"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"e536ca4e70172e314be8f1019624c632f47b2b07","unresolved":false,"context_lines":[{"line_number":173,"context_line":""},{"line_number":174,"context_line":"        # Update the metadata if necessary"},{"line_number":175,"context_line":"        scheduler_hints \u003d filter_properties.get(\u0027scheduler_hints\u0027) or {}"},{"line_number":176,"context_line":"        group_uuid \u003d scheduler_hints.get(\u0027instance_group\u0027, None)"},{"line_number":177,"context_line":"        values \u003d None"},{"line_number":178,"context_line":"        if group_uuid:"},{"line_number":179,"context_line":"            values \u003d request_spec[\u0027instance_properties\u0027][\u0027system_metadata\u0027]"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAP3%2F%2F3B4%3D","line":176,"in_reply_to":"AAAAP3%2F%2F4GE%3D","updated":"2013-07-10 09:04:22.000000000","message":"I\u0027ll update.","commit_id":"69f2aae266e94eecbc32c56dbf1720bdc7430fbf"},{"author":{"_account_id":7494,"name":"Guangya Liu","email":"gyliu513@gmail.com","username":"JayLau"},"change_message_id":"c5c9235925b3b6decfb16bce68565f5c8f65ac2d","unresolved":false,"context_lines":[{"line_number":301,"context_line":"        group_uuid \u003d scheduler_hints.get(\u0027group\u0027, None)"},{"line_number":302,"context_line":"        if group_uuid:"},{"line_number":303,"context_line":"            group_data \u003d self.instance_group_data(elevated, group_uuid)"},{"line_number":304,"context_line":"            if \u0027anti-affinity\u0027 in group_data[\u0027instance_group\u0027][\u0027policies\u0027]:"},{"line_number":305,"context_line":"                update_group_hosts \u003d True"},{"line_number":306,"context_line":"                group_hosts \u003d self.instance_group_hosts(elevated, group_data)"},{"line_number":307,"context_line":"                if \u0027group_hosts\u0027 not in filter_properties:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAQn%2F%2F34c%3D","line":304,"updated":"2013-07-20 03:23:28.000000000","message":"What about add \u0027affinity\u0027 here, since a new blueprint for GroupAffinity has been finished: https://review.openstack.org/#/c/35788/, we can also put \"affinity\" here.","commit_id":"53742dc304b3365907674433f9f61469f55022e9"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"2c36d99ed7307fc35a1820575128f8e91c3b56c8","unresolved":false,"context_lines":[{"line_number":301,"context_line":"        group_uuid \u003d scheduler_hints.get(\u0027group\u0027, None)"},{"line_number":302,"context_line":"        if group_uuid:"},{"line_number":303,"context_line":"            group_data \u003d self.instance_group_data(elevated, group_uuid)"},{"line_number":304,"context_line":"            if \u0027anti-affinity\u0027 in group_data[\u0027instance_group\u0027][\u0027policies\u0027]:"},{"line_number":305,"context_line":"                update_group_hosts \u003d True"},{"line_number":306,"context_line":"                group_hosts \u003d self.instance_group_hosts(elevated, group_data)"},{"line_number":307,"context_line":"                if \u0027group_hosts\u0027 not in filter_properties:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAQ3%2F%2F45w%3D","line":304,"in_reply_to":"AAAAQ3%2F%2F%2FYY%3D","updated":"2013-08-13 13:05:47.000000000","message":"The user API is pending object support - which was added in https://review.openstack.org/#/c/38979/. The API is: https://review.openstack.org/#/c/30028/\nI will rebase that over the objects","commit_id":"53742dc304b3365907674433f9f61469f55022e9"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"0bad202243f197ef1a345c772182805ad1e0077c","unresolved":false,"context_lines":[{"line_number":301,"context_line":"        group_uuid \u003d scheduler_hints.get(\u0027group\u0027, None)"},{"line_number":302,"context_line":"        if group_uuid:"},{"line_number":303,"context_line":"            group_data \u003d self.instance_group_data(elevated, group_uuid)"},{"line_number":304,"context_line":"            if \u0027anti-affinity\u0027 in group_data[\u0027instance_group\u0027][\u0027policies\u0027]:"},{"line_number":305,"context_line":"                update_group_hosts \u003d True"},{"line_number":306,"context_line":"                group_hosts \u003d self.instance_group_hosts(elevated, group_data)"},{"line_number":307,"context_line":"                if \u0027group_hosts\u0027 not in filter_properties:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAQn%2F%2F3mg%3D","line":304,"in_reply_to":"AAAAQn%2F%2F34c%3D","updated":"2013-07-20 14:31:04.000000000","message":"That is a little more complicated. The reason for this is that we will need to add support to the instance group API to support a policy \u0027affinity\u0027. At the moment the API part of the code is stuck in review. Once this is in I\u0027ll be happy to add it but I do not think that this should be a blocking issue for this patch and that is new support \\. Does that make sense?","commit_id":"53742dc304b3365907674433f9f61469f55022e9"},{"author":{"_account_id":7494,"name":"Guangya Liu","email":"gyliu513@gmail.com","username":"JayLau"},"change_message_id":"e573e954b1aea866ca868a8b1ade6c969ef2b5d1","unresolved":false,"context_lines":[{"line_number":301,"context_line":"        group_uuid \u003d scheduler_hints.get(\u0027group\u0027, None)"},{"line_number":302,"context_line":"        if group_uuid:"},{"line_number":303,"context_line":"            group_data \u003d self.instance_group_data(elevated, group_uuid)"},{"line_number":304,"context_line":"            if \u0027anti-affinity\u0027 in group_data[\u0027instance_group\u0027][\u0027policies\u0027]:"},{"line_number":305,"context_line":"                update_group_hosts \u003d True"},{"line_number":306,"context_line":"                group_hosts \u003d self.instance_group_hosts(elevated, group_data)"},{"line_number":307,"context_line":"                if \u0027group_hosts\u0027 not in filter_properties:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAQn%2F%2FG64%3D","line":304,"in_reply_to":"AAAAQn%2F%2F3mY%3D","updated":"2013-08-07 03:06:21.000000000","message":"Hi Gary, I have one question.  Why do we need to set policy for a VM group? I think that this should be handled by the configuration of scheduler filters.\n\nIf customer config GroupAffinity filter, then the new created VM will use affinity policy; If customer config GroupAntiAffinity filter, then the new created VM will use anti-affinity policy.\n\nComments? Thanks.","commit_id":"53742dc304b3365907674433f9f61469f55022e9"},{"author":{"_account_id":7494,"name":"Guangya Liu","email":"gyliu513@gmail.com","username":"JayLau"},"change_message_id":"d518ca3e8d2b2b6fc9a6b5b43b8902eb78b6fb4b","unresolved":false,"context_lines":[{"line_number":301,"context_line":"        group_uuid \u003d scheduler_hints.get(\u0027group\u0027, None)"},{"line_number":302,"context_line":"        if group_uuid:"},{"line_number":303,"context_line":"            group_data \u003d self.instance_group_data(elevated, group_uuid)"},{"line_number":304,"context_line":"            if \u0027anti-affinity\u0027 in group_data[\u0027instance_group\u0027][\u0027policies\u0027]:"},{"line_number":305,"context_line":"                update_group_hosts \u003d True"},{"line_number":306,"context_line":"                group_hosts \u003d self.instance_group_hosts(elevated, group_data)"},{"line_number":307,"context_line":"                if \u0027group_hosts\u0027 not in filter_properties:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAQn%2F%2F3mY%3D","line":304,"in_reply_to":"AAAAQn%2F%2F3mg%3D","updated":"2013-07-20 14:35:25.000000000","message":"Thanks Gary, no problem.","commit_id":"53742dc304b3365907674433f9f61469f55022e9"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"75b364f6d611866bf1bbb99b3cc1c703112350c8","unresolved":false,"context_lines":[{"line_number":301,"context_line":"        group_uuid \u003d scheduler_hints.get(\u0027group\u0027, None)"},{"line_number":302,"context_line":"        if group_uuid:"},{"line_number":303,"context_line":"            group_data \u003d self.instance_group_data(elevated, group_uuid)"},{"line_number":304,"context_line":"            if \u0027anti-affinity\u0027 in group_data[\u0027instance_group\u0027][\u0027policies\u0027]:"},{"line_number":305,"context_line":"                update_group_hosts \u003d True"},{"line_number":306,"context_line":"                group_hosts \u003d self.instance_group_hosts(elevated, group_data)"},{"line_number":307,"context_line":"                if \u0027group_hosts\u0027 not in filter_properties:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAQ3%2F%2F%2FYY%3D","line":304,"in_reply_to":"AAAAQn%2F%2FFww%3D","updated":"2013-08-11 16:19:31.000000000","message":"ideally this should depend on patches it requires. Has that stuff merged yet?","commit_id":"53742dc304b3365907674433f9f61469f55022e9"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"752b547d8e8abf4e4fbef2dc50ea74ececba9aaf","unresolved":false,"context_lines":[{"line_number":301,"context_line":"        group_uuid \u003d scheduler_hints.get(\u0027group\u0027, None)"},{"line_number":302,"context_line":"        if group_uuid:"},{"line_number":303,"context_line":"            group_data \u003d self.instance_group_data(elevated, group_uuid)"},{"line_number":304,"context_line":"            if \u0027anti-affinity\u0027 in group_data[\u0027instance_group\u0027][\u0027policies\u0027]:"},{"line_number":305,"context_line":"                update_group_hosts \u003d True"},{"line_number":306,"context_line":"                group_hosts \u003d self.instance_group_hosts(elevated, group_data)"},{"line_number":307,"context_line":"                if \u0027group_hosts\u0027 not in filter_properties:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAQn%2F%2FGAQ%3D","line":304,"in_reply_to":"AAAAQn%2F%2FG64%3D","updated":"2013-08-07 10:10:54.000000000","message":"The user should be able to chose between group affinity or anti-affinity via hints  - its not an either/or system configuration choice (i.e. the scheduler should have both filters configured","commit_id":"53742dc304b3365907674433f9f61469f55022e9"},{"author":{"_account_id":7494,"name":"Guangya Liu","email":"gyliu513@gmail.com","username":"JayLau"},"change_message_id":"a21aea4465c141a3e4a092fa049b715f24457805","unresolved":false,"context_lines":[{"line_number":301,"context_line":"        group_uuid \u003d scheduler_hints.get(\u0027group\u0027, None)"},{"line_number":302,"context_line":"        if group_uuid:"},{"line_number":303,"context_line":"            group_data \u003d self.instance_group_data(elevated, group_uuid)"},{"line_number":304,"context_line":"            if \u0027anti-affinity\u0027 in group_data[\u0027instance_group\u0027][\u0027policies\u0027]:"},{"line_number":305,"context_line":"                update_group_hosts \u003d True"},{"line_number":306,"context_line":"                group_hosts \u003d self.instance_group_hosts(elevated, group_data)"},{"line_number":307,"context_line":"                if \u0027group_hosts\u0027 not in filter_properties:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAQn%2F%2FFww%3D","line":304,"in_reply_to":"AAAAQn%2F%2FGAQ%3D","updated":"2013-08-07 11:39:45.000000000","message":"Thanks Phil. Just wondering does nova scheduler still work if configured both GroupAffinity and GrouAntiAffinity?\n\nFrom the logic of the two filters, GroupAffinity will select host in filter_properties[\u0027group_hosts\u0027] and GrouAntiAffinity will ignore host in filter_properties[\u0027group_hosts\u0027]. If configured both filters, I think boot VM instance will be failed.\n\nIn my understanding, seems we need to the logic as following:\n1) Get filter_properties[\u0027group_hosts\u0027] \n2) In GroupAffinity fillter, check if \u0027affinity\u0027 was enabled for the group, if does, then GroupAffinity take effect, otherwise just return.\n3) In GroupAntiAffinity fillter, check if \u0027anti-affinity\u0027 was enabled for the group, if does, then GroupAntiAffinity take effect, otherwise just return.\n\nComments? Thanks.","commit_id":"53742dc304b3365907674433f9f61469f55022e9"},{"author":{"_account_id":7758,"name":"David Xie","email":"david.scriptfan@gmail.com","username":"davidx"},"change_message_id":"563f06fbe8584e4e327f4b6f84ebd0b5dd238d8d","unresolved":false,"context_lines":[{"line_number":283,"context_line":"        group_uuid \u003d scheduler_hints.get(\u0027group\u0027, None)"},{"line_number":284,"context_line":"        if group_uuid:"},{"line_number":285,"context_line":"            group_data \u003d self.instance_group_data(elevated, group_uuid)"},{"line_number":286,"context_line":"            if \u0027anti-affinity\u0027 in group_data[\u0027instance_group\u0027][\u0027policies\u0027]:"},{"line_number":287,"context_line":"                update_group_hosts \u003d True"},{"line_number":288,"context_line":"                group_hosts \u003d self.instance_group_hosts(elevated, group_data)"},{"line_number":289,"context_line":"                if \u0027group_hosts\u0027 not in filter_properties:"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAARH%2F%2F2PE%3D","line":286,"updated":"2013-08-16 10:12:33.000000000","message":"group_data is a list, you can not use group_data[\u0027instance_group\u0027][\u0027policies\u0027]. Please see driver.py for instance_group_data method.","commit_id":"545815817e81eea24e904762ecf8203db87f3182"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"65fbaeee279a5336f1b405202bdacb1cb96c2fbb","unresolved":false,"context_lines":[{"line_number":283,"context_line":"        group_uuid \u003d scheduler_hints.get(\u0027group\u0027, None)"},{"line_number":284,"context_line":"        if group_uuid:"},{"line_number":285,"context_line":"            group_data \u003d self.instance_group_data(elevated, group_uuid)"},{"line_number":286,"context_line":"            if \u0027anti-affinity\u0027 in group_data[\u0027instance_group\u0027][\u0027policies\u0027]:"},{"line_number":287,"context_line":"                update_group_hosts \u003d True"},{"line_number":288,"context_line":"                group_hosts \u003d self.instance_group_hosts(elevated, group_data)"},{"line_number":289,"context_line":"                if \u0027group_hosts\u0027 not in filter_properties:"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAARX%2F%2F%2FiU%3D","line":286,"in_reply_to":"AAAARH%2F%2F1K4%3D","updated":"2013-08-18 16:23:52.000000000","message":"Yes, you are correct. This is my bad. Thanks and good catch. I would say that the dog ate my homework but that would be a lame excuse.","commit_id":"545815817e81eea24e904762ecf8203db87f3182"},{"author":{"_account_id":7758,"name":"David Xie","email":"david.scriptfan@gmail.com","username":"davidx"},"change_message_id":"4a762e48ba966868d39fbf8cbb602a45f25b8162","unresolved":false,"context_lines":[{"line_number":283,"context_line":"        group_uuid \u003d scheduler_hints.get(\u0027group\u0027, None)"},{"line_number":284,"context_line":"        if group_uuid:"},{"line_number":285,"context_line":"            group_data \u003d self.instance_group_data(elevated, group_uuid)"},{"line_number":286,"context_line":"            if \u0027anti-affinity\u0027 in group_data[\u0027instance_group\u0027][\u0027policies\u0027]:"},{"line_number":287,"context_line":"                update_group_hosts \u003d True"},{"line_number":288,"context_line":"                group_hosts \u003d self.instance_group_hosts(elevated, group_data)"},{"line_number":289,"context_line":"                if \u0027group_hosts\u0027 not in filter_properties:"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAARH%2F%2F1K4%3D","line":286,"in_reply_to":"AAAARH%2F%2F1Os%3D","updated":"2013-08-16 15:47:52.000000000","message":"I don\u0027t think so. Please see driver.py, line #145-158.\n#158 is \"return instances\", here instances is a list","commit_id":"545815817e81eea24e904762ecf8203db87f3182"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"5e736518496f016048e371064f3827e590693281","unresolved":false,"context_lines":[{"line_number":283,"context_line":"        group_uuid \u003d scheduler_hints.get(\u0027group\u0027, None)"},{"line_number":284,"context_line":"        if group_uuid:"},{"line_number":285,"context_line":"            group_data \u003d self.instance_group_data(elevated, group_uuid)"},{"line_number":286,"context_line":"            if \u0027anti-affinity\u0027 in group_data[\u0027instance_group\u0027][\u0027policies\u0027]:"},{"line_number":287,"context_line":"                update_group_hosts \u003d True"},{"line_number":288,"context_line":"                group_hosts \u003d self.instance_group_hosts(elevated, group_data)"},{"line_number":289,"context_line":"                if \u0027group_hosts\u0027 not in filter_properties:"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAARH%2F%2F1Os%3D","line":286,"in_reply_to":"AAAARH%2F%2F2PE%3D","updated":"2013-08-16 15:35:06.000000000","message":"The group data is a dictionary. One of the entries is policies which is a list hence the code above","commit_id":"545815817e81eea24e904762ecf8203db87f3182"},{"author":{"_account_id":2667,"name":"Alex Glikson","email":"glikson@il.ibm.com","username":"glikson"},"change_message_id":"8c6579a099d0f8d16724f85f015f8ebf75b1ceea","unresolved":false,"context_lines":[{"line_number":171,"context_line":"        values \u003d None"},{"line_number":172,"context_line":"        if group_uuid:"},{"line_number":173,"context_line":"            values \u003d request_spec[\u0027instance_properties\u0027][\u0027system_metadata\u0027]"},{"line_number":174,"context_line":"            values.update({\u0027instance_group\u0027: group_uuid})"},{"line_number":175,"context_line":"            values \u003d {\u0027system_metadata\u0027: values}"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAASX%2F%2F4Ds%3D","line":174,"updated":"2013-08-25 10:11:01.000000000","message":"Maybe I\u0027m missing something, but I don\u0027t think we need too keep the membership information in instance\u0027s system_metadata any more. Shouldn\u0027t we use the new dedicated DB relationship for this? Why duplicating it here?","commit_id":"cec189a73bef729bab92b4cd94a449f002ea3189"},{"author":{"_account_id":2667,"name":"Alex Glikson","email":"glikson@il.ibm.com","username":"glikson"},"change_message_id":"6543d70cc3838353b8d685e058325a21660ef497","unresolved":false,"context_lines":[{"line_number":171,"context_line":"        values \u003d None"},{"line_number":172,"context_line":"        if group_uuid:"},{"line_number":173,"context_line":"            values \u003d request_spec[\u0027instance_properties\u0027][\u0027system_metadata\u0027]"},{"line_number":174,"context_line":"            values.update({\u0027instance_group\u0027: group_uuid})"},{"line_number":175,"context_line":"            values \u003d {\u0027system_metadata\u0027: values}"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAASX%2F%2F4Cw%3D","line":174,"in_reply_to":"AAAASX%2F%2F4DQ%3D","updated":"2013-08-25 10:23:47.000000000","message":"OK. Not ideal, but shouldn\u0027t block inclusion in Havana, I guess.","commit_id":"cec189a73bef729bab92b4cd94a449f002ea3189"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"ae2b55a09e9824eef281a7a9c8f3f6f896ba327a","unresolved":false,"context_lines":[{"line_number":171,"context_line":"        values \u003d None"},{"line_number":172,"context_line":"        if group_uuid:"},{"line_number":173,"context_line":"            values \u003d request_spec[\u0027instance_properties\u0027][\u0027system_metadata\u0027]"},{"line_number":174,"context_line":"            values.update({\u0027instance_group\u0027: group_uuid})"},{"line_number":175,"context_line":"            values \u003d {\u0027system_metadata\u0027: values}"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAASX%2F%2F4DQ%3D","line":174,"in_reply_to":"AAAASX%2F%2F4Ds%3D","updated":"2013-08-25 10:14:34.000000000","message":"Sadly at the moment we do not have the instance-group on the actual instance. This is on our todo list. Sadly it will not make this cycle as it is a db change. We have continued to use the system data (as was with the initial anti affinity support)","commit_id":"cec189a73bef729bab92b4cd94a449f002ea3189"},{"author":{"_account_id":7494,"name":"Guangya Liu","email":"gyliu513@gmail.com","username":"JayLau"},"change_message_id":"fbb2498f84a4a83803a570aebd899fa59544315d","unresolved":false,"context_lines":[{"line_number":284,"context_line":"        if group_uuid:"},{"line_number":285,"context_line":"            (group, group_instances) \u003d self.instance_group_data(elevated,"},{"line_number":286,"context_line":"                                                                group_uuid)"},{"line_number":287,"context_line":"            if \u0027anti-affinity\u0027 in group[\u0027policies\u0027]:"},{"line_number":288,"context_line":"                update_group_hosts \u003d True"},{"line_number":289,"context_line":"                group_hosts \u003d self.instance_group_hosts(elevated,"},{"line_number":290,"context_line":"                                                        group_instances)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAARn%2F%2F%2Bpw%3D","line":287,"updated":"2013-08-19 12:04:24.000000000","message":"Hi Gary, here I want to repeat my comments for patch set 6 as I did not get a clear answer for it. ;-(\n\njust wondering does nova scheduler still work if configured both GroupAffinity and GrouAntiAffinity?\n\nFrom the logic of the two filters, GroupAffinity will select host in filter_properties[\u0027group_hosts\u0027] and GrouAntiAffinity will ignore host in filter_properties[\u0027group_hosts\u0027]. If configured both filters, I think boot VM instance will be failed.\n\nIn my understanding, seems we need to the logic as following: 1) Get filter_properties[\u0027group_hosts\u0027] 2) In GroupAffinity fillter, check if \u0027affinity\u0027 was enabled for the group, if does, then GroupAffinity take effect, otherwise just return. 3) In GroupAntiAffinity fillter, check if \u0027anti-affinity\u0027 was enabled for the group, if does, then GroupAntiAffinity take effect, otherwise just return.\n\nComments? Thanks.","commit_id":"cec189a73bef729bab92b4cd94a449f002ea3189"},{"author":{"_account_id":7494,"name":"Guangya Liu","email":"gyliu513@gmail.com","username":"JayLau"},"change_message_id":"43888e074d271982f6c4318e0a7d11bff7a5a615","unresolved":false,"context_lines":[{"line_number":284,"context_line":"        if group_uuid:"},{"line_number":285,"context_line":"            (group, group_instances) \u003d self.instance_group_data(elevated,"},{"line_number":286,"context_line":"                                                                group_uuid)"},{"line_number":287,"context_line":"            if \u0027anti-affinity\u0027 in group[\u0027policies\u0027]:"},{"line_number":288,"context_line":"                update_group_hosts \u003d True"},{"line_number":289,"context_line":"                group_hosts \u003d self.instance_group_hosts(elevated,"},{"line_number":290,"context_line":"                                                        group_instances)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAARn%2F%2F%2BEk%3D","line":287,"in_reply_to":"AAAARn%2F%2F%2BlI%3D","updated":"2013-08-19 14:50:56.000000000","message":"Thanks Gary for the clear clarification!","commit_id":"cec189a73bef729bab92b4cd94a449f002ea3189"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"c020fe0c44be29aa2e075522179542539d5f731d","unresolved":false,"context_lines":[{"line_number":284,"context_line":"        if group_uuid:"},{"line_number":285,"context_line":"            (group, group_instances) \u003d self.instance_group_data(elevated,"},{"line_number":286,"context_line":"                                                                group_uuid)"},{"line_number":287,"context_line":"            if \u0027anti-affinity\u0027 in group[\u0027policies\u0027]:"},{"line_number":288,"context_line":"                update_group_hosts \u003d True"},{"line_number":289,"context_line":"                group_hosts \u003d self.instance_group_hosts(elevated,"},{"line_number":290,"context_line":"                                                        group_instances)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAARn%2F%2F%2BlI%3D","line":287,"in_reply_to":"AAAARn%2F%2F%2Bpw%3D","updated":"2013-08-19 12:28:04.000000000","message":"Hi,\nSorry if I may have missed your comment or not addressed it to the full. At the moment this code only addresses the \u0027anti-affinity\u0027 solution. Once this is done an through I\u0027ll be very happy to add the \u0027affinity\u0027. I see this as happening on two levels. The first is the configuration of an instance group. That is, the instance group should not have conflicting policies - that is affinity and anti affinity are conflicting policies. So I see a specific check on the instance group configuration that will test this (hopefully we\u0027ll have the initial support in soon - we are currently reviewing https://review.openstack.org/#/c/38979/ and then hopefully https://review.openstack.org/#/c/30028/ will use this). I would expect that we would build on https://review.openstack.org/#/c/30028/ to ensure that there are no conflicting policies. When we were writing this we did not plan the affinity filter and it was you that added it :)\nIn addition to the above i would expect the check here to also take into account the affinity, that is, it will be something like:\nif \u0027anti-affinity\u0027 in group[\u0027policies\u0027] or \u0027affinity\u0027 in group[\u0027policies\u0027]:\n.\n.\n.\nI really think that we should start with the anti affinity support and then once that is through we should add in the affinity support.\nI also think that we need to make changes to the scheduler where that can invoke specific filters for specific policies - this is being discussed in https://review.openstack.org/#/c/37407/\nI hope that you agree. Please let me know if I have provided a complete answer.","commit_id":"cec189a73bef729bab92b4cd94a449f002ea3189"},{"author":{"_account_id":7629,"name":"Shawn Hartsock","email":"hartsock@acm.org","username":"hartsocks"},"change_message_id":"282b7fb611023df4f992c21e108e5d2408833284","unresolved":false,"context_lines":[{"line_number":297,"context_line":"                if \u0027group_hosts\u0027 not in filter_properties:"},{"line_number":298,"context_line":"                    filter_properties.update({\u0027group_hosts\u0027: set()})"},{"line_number":299,"context_line":"                user_hosts \u003d filter_properties[\u0027group_hosts\u0027]"},{"line_number":300,"context_line":"                filter_properties[\u0027group_hosts\u0027] \u003d user_hosts | group_hosts"},{"line_number":301,"context_line":""},{"line_number":302,"context_line":"        config_options \u003d self._get_configuration_options()"},{"line_number":303,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F8pcY%3D","line":300,"updated":"2013-12-23 18:42:35.000000000","message":"I\u0027m not sure I understand why you aren\u0027t using \".update\" here","commit_id":"fb581d497e378bdb7115cba9a16ca463215cc77b"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"39b57e91f3c9b921d3c3af483b46b6f3a492033b","unresolved":false,"context_lines":[{"line_number":297,"context_line":"                if \u0027group_hosts\u0027 not in filter_properties:"},{"line_number":298,"context_line":"                    filter_properties.update({\u0027group_hosts\u0027: set()})"},{"line_number":299,"context_line":"                user_hosts \u003d filter_properties[\u0027group_hosts\u0027]"},{"line_number":300,"context_line":"                filter_properties[\u0027group_hosts\u0027] \u003d user_hosts | group_hosts"},{"line_number":301,"context_line":""},{"line_number":302,"context_line":"        config_options \u003d self._get_configuration_options()"},{"line_number":303,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAT3%2F%2F860%3D","line":300,"in_reply_to":"AAAATn%2F8pcY%3D","updated":"2013-12-26 12:42:31.000000000","message":"this is updating the key pair. \nmy understanding is that update is used to update a dictionary with another dictionary.\nplease elaborate","commit_id":"fb581d497e378bdb7115cba9a16ca463215cc77b"},{"author":{"_account_id":8478,"name":"Vladislav Kuzmin","email":"vkuzmin@mirantis.com","username":"vkuzmin"},"change_message_id":"4cc07a02b8f09d87502b5268fb861295b03073c3","unresolved":false,"context_lines":[{"line_number":281,"context_line":"        if group_uuid:"},{"line_number":282,"context_line":"            (group, group_instances) \u003d self.instance_group_data(elevated,"},{"line_number":283,"context_line":"                                                                group_uuid)"},{"line_number":284,"context_line":"            if \u0027anti-affinity\u0027 in group[\u0027policies\u0027]:"},{"line_number":285,"context_line":"                update_group_hosts \u003d True"},{"line_number":286,"context_line":"                group_hosts \u003d self.instance_group_hosts(elevated,"},{"line_number":287,"context_line":"                                                        group_instances)"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F%2BxZY%3D","line":284,"updated":"2014-01-22 09:53:51.000000000","message":"I think that it work only for anti affinity filter. Will this work for affinity filter?","commit_id":"5b8f04485cafc1b9b6ff40ca30b6c0fe19de917b"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"6ced772baf6e912aad6e851f4e320932231afca9","unresolved":false,"context_lines":[{"line_number":281,"context_line":"        if group_uuid:"},{"line_number":282,"context_line":"            (group, group_instances) \u003d self.instance_group_data(elevated,"},{"line_number":283,"context_line":"                                                                group_uuid)"},{"line_number":284,"context_line":"            if \u0027anti-affinity\u0027 in group[\u0027policies\u0027]:"},{"line_number":285,"context_line":"                update_group_hosts \u003d True"},{"line_number":286,"context_line":"                group_hosts \u003d self.instance_group_hosts(elevated,"},{"line_number":287,"context_line":"                                                        group_instances)"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F%2BwfE%3D","line":284,"in_reply_to":"AAAAUH%2F%2BxZY%3D","updated":"2014-01-22 13:10:08.000000000","message":"Once we have the anti affinity filter approved for the instance groups then we will add int he support for the affinity filter. An instance group that is configured should not allow and affinity and anti affinity policy to be configured. This validation will be done in the api layer when we start to get it thorugh","commit_id":"5b8f04485cafc1b9b6ff40ca30b6c0fe19de917b"},{"author":{"_account_id":1561,"name":"Russell Bryant","email":"rbryant@redhat.com","username":"russellb"},"change_message_id":"3a21dd7eec43c4a6d2687eed4340a8a5311bf479","unresolved":false,"context_lines":[{"line_number":281,"context_line":"        if group_uuid:"},{"line_number":282,"context_line":"            (group, group_instances) \u003d self.instance_group_data(elevated,"},{"line_number":283,"context_line":"                                                                group_uuid)"},{"line_number":284,"context_line":"            if \u0027anti-affinity\u0027 in group[\u0027policies\u0027]:"},{"line_number":285,"context_line":"                update_group_hosts \u003d True"},{"line_number":286,"context_line":"                group_hosts \u003d self.instance_group_hosts(elevated,"},{"line_number":287,"context_line":"                                                        group_instances)"}],"source_content_type":"text/x-python","patch_set":22,"id":"AAAAUX%2F%2BfkY%3D","line":284,"updated":"2014-02-20 21:37:14.000000000","message":"It looks like group_hosts is only getting set now for the anti-affinity case.  It looks broken for the affinity case.  Shouldn\u0027t ti get set for affinity, as well?","commit_id":"07964036b593e039c3b4d712d91af9b3be0b7bf3"},{"author":{"_account_id":1561,"name":"Russell Bryant","email":"rbryant@redhat.com","username":"russellb"},"change_message_id":"63f37546c3cc092cbe69dccfe2088a1063020861","unresolved":false,"context_lines":[{"line_number":281,"context_line":"        if group_uuid:"},{"line_number":282,"context_line":"            (group, group_instances) \u003d self.instance_group_data(elevated,"},{"line_number":283,"context_line":"                                                                group_uuid)"},{"line_number":284,"context_line":"            if \u0027anti-affinity\u0027 in group[\u0027policies\u0027]:"},{"line_number":285,"context_line":"                update_group_hosts \u003d True"},{"line_number":286,"context_line":"                group_hosts \u003d self.instance_group_hosts(elevated,"},{"line_number":287,"context_line":"                                                        group_instances)"}],"source_content_type":"text/x-python","patch_set":22,"id":"AAAAU3%2F%2F18o%3D","line":284,"in_reply_to":"AAAAU3%2F%2F%2BHc%3D","updated":"2014-02-24 14:47:37.000000000","message":"there are both affinity and anti-affinity scheduler filters in the code right now that act on \u0027group_hosts\u0027 in filter_properties.  Should these filters be updated to be policy aware?  See nova/scheduler/filters/affinity_filter.py","commit_id":"07964036b593e039c3b4d712d91af9b3be0b7bf3"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"f4a0c7bc8b802b0a04719a499ae276460fd86913","unresolved":false,"context_lines":[{"line_number":281,"context_line":"        if group_uuid:"},{"line_number":282,"context_line":"            (group, group_instances) \u003d self.instance_group_data(elevated,"},{"line_number":283,"context_line":"                                                                group_uuid)"},{"line_number":284,"context_line":"            if \u0027anti-affinity\u0027 in group[\u0027policies\u0027]:"},{"line_number":285,"context_line":"                update_group_hosts \u003d True"},{"line_number":286,"context_line":"                group_hosts \u003d self.instance_group_hosts(elevated,"},{"line_number":287,"context_line":"                                                        group_instances)"}],"source_content_type":"text/x-python","patch_set":22,"id":"AAAAU3%2F%2F094%3D","line":284,"in_reply_to":"AAAAU3%2F%2F18o%3D","updated":"2014-02-24 16:03:26.000000000","message":"good catch!","commit_id":"07964036b593e039c3b4d712d91af9b3be0b7bf3"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"316dfd68f655eb92434438563884e536bf73da78","unresolved":false,"context_lines":[{"line_number":281,"context_line":"        if group_uuid:"},{"line_number":282,"context_line":"            (group, group_instances) \u003d self.instance_group_data(elevated,"},{"line_number":283,"context_line":"                                                                group_uuid)"},{"line_number":284,"context_line":"            if \u0027anti-affinity\u0027 in group[\u0027policies\u0027]:"},{"line_number":285,"context_line":"                update_group_hosts \u003d True"},{"line_number":286,"context_line":"                group_hosts \u003d self.instance_group_hosts(elevated,"},{"line_number":287,"context_line":"                                                        group_instances)"}],"source_content_type":"text/x-python","patch_set":22,"id":"AAAAU3%2F%2F%2BHc%3D","line":284,"in_reply_to":"AAAAUX%2F%2BfkY%3D","updated":"2014-02-23 08:19:51.000000000","message":"At the moment the instance_groups only supports the anti-affinity policy. The plan was to add affinity support after this code has landed.\nThe idea is to have a validation on the instance_group configuration that a anti-affinity and affinity policy are forbidden on the same instance group.","commit_id":"07964036b593e039c3b4d712d91af9b3be0b7bf3"},{"author":{"_account_id":1561,"name":"Russell Bryant","email":"rbryant@redhat.com","username":"russellb"},"change_message_id":"3a21dd7eec43c4a6d2687eed4340a8a5311bf479","unresolved":false,"context_lines":[{"line_number":286,"context_line":"                group_hosts \u003d self.instance_group_hosts(elevated,"},{"line_number":287,"context_line":"                                                        group_instances)"},{"line_number":288,"context_line":"                if \u0027group_hosts\u0027 not in filter_properties:"},{"line_number":289,"context_line":"                    filter_properties.update({\u0027group_hosts\u0027: set()})"},{"line_number":290,"context_line":"                user_hosts \u003d filter_properties[\u0027group_hosts\u0027]"},{"line_number":291,"context_line":"                filter_properties[\u0027group_hosts\u0027] \u003d user_hosts | group_hosts"},{"line_number":292,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"AAAAUX%2F%2BfnY%3D","line":289,"updated":"2014-02-20 21:37:14.000000000","message":"These 2 lines can be simplified down to:\n\n    filter_properties.setdefault(\u0027group_hosts\u0027, set())","commit_id":"07964036b593e039c3b4d712d91af9b3be0b7bf3"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"316dfd68f655eb92434438563884e536bf73da78","unresolved":false,"context_lines":[{"line_number":286,"context_line":"                group_hosts \u003d self.instance_group_hosts(elevated,"},{"line_number":287,"context_line":"                                                        group_instances)"},{"line_number":288,"context_line":"                if \u0027group_hosts\u0027 not in filter_properties:"},{"line_number":289,"context_line":"                    filter_properties.update({\u0027group_hosts\u0027: set()})"},{"line_number":290,"context_line":"                user_hosts \u003d filter_properties[\u0027group_hosts\u0027]"},{"line_number":291,"context_line":"                filter_properties[\u0027group_hosts\u0027] \u003d user_hosts | group_hosts"},{"line_number":292,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"AAAAU3%2F%2F%2BHY%3D","line":289,"in_reply_to":"AAAAUX%2F%2BfnY%3D","updated":"2014-02-23 08:19:51.000000000","message":"Done","commit_id":"07964036b593e039c3b4d712d91af9b3be0b7bf3"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"07100e24ba9c20a231a156dc2cd90a82ecb96066","unresolved":false,"context_lines":[{"line_number":161,"context_line":"        values \u003d None"},{"line_number":162,"context_line":"        if group_uuid:"},{"line_number":163,"context_line":"            values \u003d request_spec[\u0027instance_properties\u0027][\u0027system_metadata\u0027]"},{"line_number":164,"context_line":"            values.update({\u0027instance_group\u0027: group_uuid})"},{"line_number":165,"context_line":"            values \u003d {\u0027system_metadata\u0027: values}"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAAU3%2F%2F1DI%3D","line":164,"updated":"2014-02-24 16:20:40.000000000","message":"while its not your fault, it seems like this should have been done inside api.py when the instance object was put into the DB.\n\nI would rather all the stuff related to groups was kept in this messy bit, so we can move it to api.py at a later date.","commit_id":"00c2365f492e77b2d901b0c2daff83164e78ba56"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"d8041735a116744a78c1c7e773ae97d5f0b41f57","unresolved":false,"context_lines":[{"line_number":161,"context_line":"        values \u003d None"},{"line_number":162,"context_line":"        if group_uuid:"},{"line_number":163,"context_line":"            values \u003d request_spec[\u0027instance_properties\u0027][\u0027system_metadata\u0027]"},{"line_number":164,"context_line":"            values.update({\u0027instance_group\u0027: group_uuid})"},{"line_number":165,"context_line":"            values \u003d {\u0027system_metadata\u0027: values}"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAAU3%2F%2FpzM%3D","line":164,"in_reply_to":"AAAAU3%2F%2F1DI%3D","updated":"2014-02-25 13:51:40.000000000","message":"Done","commit_id":"00c2365f492e77b2d901b0c2daff83164e78ba56"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"07100e24ba9c20a231a156dc2cd90a82ecb96066","unresolved":false,"context_lines":[{"line_number":162,"context_line":"        if group_uuid:"},{"line_number":163,"context_line":"            values \u003d request_spec[\u0027instance_properties\u0027][\u0027system_metadata\u0027]"},{"line_number":164,"context_line":"            values.update({\u0027instance_group\u0027: group_uuid})"},{"line_number":165,"context_line":"            values \u003d {\u0027system_metadata\u0027: values}"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"        try:"},{"line_number":168,"context_line":"            updated_instance \u003d driver.instance_update_db(context,"}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAAU3%2F%2F1D4%3D","line":165,"updated":"2014-02-24 16:20:40.000000000","message":"Seems like you could make an explicit call to update the instance group here? leaving instance_update_db to only update the instance (as it does today).\n\nBut maybe this should go into the object.","commit_id":"00c2365f492e77b2d901b0c2daff83164e78ba56"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"d8041735a116744a78c1c7e773ae97d5f0b41f57","unresolved":false,"context_lines":[{"line_number":162,"context_line":"        if group_uuid:"},{"line_number":163,"context_line":"            values \u003d request_spec[\u0027instance_properties\u0027][\u0027system_metadata\u0027]"},{"line_number":164,"context_line":"            values.update({\u0027instance_group\u0027: group_uuid})"},{"line_number":165,"context_line":"            values \u003d {\u0027system_metadata\u0027: values}"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"        try:"},{"line_number":168,"context_line":"            updated_instance \u003d driver.instance_update_db(context,"}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAAU3%2F%2FpVM%3D","line":165,"in_reply_to":"AAAAU3%2F%2F1D4%3D","updated":"2014-02-25 13:51:40.000000000","message":"Done","commit_id":"00c2365f492e77b2d901b0c2daff83164e78ba56"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"1b975085363d690b937d4ec7cd8485ae9b5774a1","unresolved":false,"context_lines":[{"line_number":288,"context_line":"        if group_uuid:"},{"line_number":289,"context_line":"            (group, group_instances) \u003d self.instance_group_data(elevated,"},{"line_number":290,"context_line":"                                                                group_uuid)"},{"line_number":291,"context_line":"            if \u0027anti-affinity\u0027 in group[\u0027policies\u0027]:"},{"line_number":292,"context_line":"                update_group_hosts \u003d True"},{"line_number":293,"context_line":"                group_hosts \u003d self.instance_group_hosts(elevated,"},{"line_number":294,"context_line":"                                                        group_instances)"}],"source_content_type":"text/x-python","patch_set":26,"id":"AAAAVX%2F%2F6rY%3D","line":291,"updated":"2014-02-27 12:05:55.000000000","message":"Again why allow only anti-affinity here in such a way, making the affinity filter de facto unusable if this commit lands. \n\nEither 1) introduce affinity here and add a check here to make sure they are not used at the same time (probably better to be done in the API though, maybe base your code for that on top of the API patch and add it there), or 2) drop form this patch the changes to the affinity filters which kind of makes this patch useless so probably do 1) :)","commit_id":"1bad830bfa7e2d200bb95d8f5899ed1e50174112"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"8937469748ad3d378d90a72ade7850de2e78d793","unresolved":false,"context_lines":[{"line_number":288,"context_line":"        if group_uuid:"},{"line_number":289,"context_line":"            (group, group_instances) \u003d self.instance_group_data(elevated,"},{"line_number":290,"context_line":"                                                                group_uuid)"},{"line_number":291,"context_line":"            if \u0027anti-affinity\u0027 in group[\u0027policies\u0027]:"},{"line_number":292,"context_line":"                update_group_hosts \u003d True"},{"line_number":293,"context_line":"                group_hosts \u003d self.instance_group_hosts(elevated,"},{"line_number":294,"context_line":"                                                        group_instances)"}],"source_content_type":"text/x-python","patch_set":26,"id":"AAAAVX%2F%2F5jk%3D","line":291,"in_reply_to":"AAAAVX%2F%2F6rY%3D","updated":"2014-02-27 14:18:49.000000000","message":"agreed. will do #1","commit_id":"1bad830bfa7e2d200bb95d8f5899ed1e50174112"},{"author":{"_account_id":7494,"name":"Guangya Liu","email":"gyliu513@gmail.com","username":"JayLau"},"change_message_id":"4e734214b94382870ed456b333a9b6cadd92330c","unresolved":false,"context_lines":[{"line_number":150,"context_line":"            ig.members +\u003d [instance_uuid]"},{"line_number":151,"context_line":"            ig.save()"},{"line_number":152,"context_line":"        except exception as e:"},{"line_number":153,"context_line":"            LOG.warning(_(\"Instance group update failed: %s\"), e)"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"    def _provision_resource(self, context, weighed_host, request_spec,"},{"line_number":156,"context_line":"            filter_properties, requested_networks, injected_files,"}],"source_content_type":"text/x-python","patch_set":28,"id":"AAAAVX%2F%2FpWI%3D","line":153,"updated":"2014-03-02 02:47:31.000000000","message":"How about adding group_uuid and instance_uuid to log message?","commit_id":"fd8c54c4c6f3315b931215aa0eb4b05dc5c50b89"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"873058dfce6b442e833cca95c0ad4800ed716efb","unresolved":false,"context_lines":[{"line_number":150,"context_line":"            ig.members +\u003d [instance_uuid]"},{"line_number":151,"context_line":"            ig.save()"},{"line_number":152,"context_line":"        except exception as e:"},{"line_number":153,"context_line":"            LOG.warning(_(\"Instance group update failed: %s\"), e)"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"    def _provision_resource(self, context, weighed_host, request_spec,"},{"line_number":156,"context_line":"            filter_properties, requested_networks, injected_files,"}],"source_content_type":"text/x-python","patch_set":28,"id":"AAAAVX%2F%2FoxE%3D","line":153,"in_reply_to":"AAAAVX%2F%2FpWI%3D","updated":"2014-03-02 08:16:41.000000000","message":"Done","commit_id":"fd8c54c4c6f3315b931215aa0eb4b05dc5c50b89"},{"author":{"_account_id":1561,"name":"Russell Bryant","email":"rbryant@redhat.com","username":"russellb"},"change_message_id":"12b2855b2cf1ce3b796bb92cdbba21217e090bf1","unresolved":false,"context_lines":[{"line_number":149,"context_line":"            ig \u003d ig_obj.InstanceGroup.get_by_uuid(context, group_uuid)"},{"line_number":150,"context_line":"            ig.members +\u003d [instance_uuid]"},{"line_number":151,"context_line":"            ig.save()"},{"line_number":152,"context_line":"        except exception as e:"},{"line_number":153,"context_line":"            LOG.warning(_(\"Adding member %(member)s to group %(group)s \""},{"line_number":154,"context_line":"                          \"failed: %(e)s\"),"},{"line_number":155,"context_line":"                        {\u0027member\u0027: instance_uuid, \u0027group\u0027: group_uuid, \u0027e\u0027: e})"}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAAVn%2F%2F3CA%3D","line":152,"updated":"2014-03-03 19:03:16.000000000","message":"s/exception/Exception/","commit_id":"9bf82abc7f960ce74ff208fa3cd9b760ab9d190a"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"289d9ae0d972011db53fa9e103f6f4f0beb645bd","unresolved":false,"context_lines":[{"line_number":148,"context_line":"        try:"},{"line_number":149,"context_line":"            ig \u003d ig_obj.InstanceGroup.get_by_uuid(context, group_uuid)"},{"line_number":150,"context_line":"            ig.members +\u003d [instance_uuid]"},{"line_number":151,"context_line":"            ig.save()"},{"line_number":152,"context_line":"        except Exception as e:"},{"line_number":153,"context_line":"            LOG.warning(_(\"Adding member %(member)s to group %(group)s \""},{"line_number":154,"context_line":"                          \"failed: %(e)s\"),"}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAAVn%2F%2F2x8%3D","line":151,"updated":"2014-03-03 19:25:44.000000000","message":"With 2+ schedulers, this race will end up with corruption in the database.","commit_id":"fd651bd0430e229c26699e696318c203a99bb7fa"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"ae5a1b6728bd878c478cd8a7e5669d5967f90b0b","unresolved":false,"context_lines":[{"line_number":281,"context_line":"                update_group_hosts \u003d True"},{"line_number":282,"context_line":"                filter_properties.setdefault(\u0027group_hosts\u0027, set())"},{"line_number":283,"context_line":"                user_hosts \u003d filter_properties[\u0027group_hosts\u0027]"},{"line_number":284,"context_line":"                filter_properties[\u0027group_hosts\u0027] \u003d user_hosts | group_hosts"},{"line_number":285,"context_line":"                # Ensure that the \u0027affinity\u0027 and \u0027anti-affinity\u0027 filter do not"},{"line_number":286,"context_line":"                # contradict one another"},{"line_number":287,"context_line":"                if \u0027anti-affinity\u0027 in group[\u0027policies\u0027]:"}],"source_content_type":"text/x-python","patch_set":35,"id":"AAAAVn%2F%2Fqks%3D","line":284,"updated":"2014-03-04 19:24:26.000000000","message":"I don\u0027t think that group_hosts will be a set() with all RPC drivers, so better to make sure it\u0027s set()ified before this.","commit_id":"f0545a9e3da3c9de49debf6bb6f5a68cd292dee5"},{"author":{"_account_id":1561,"name":"Russell Bryant","email":"rbryant@redhat.com","username":"russellb"},"change_message_id":"2b620b9a25fb86f43fde3fd39c8af1de03a489bf","unresolved":false,"context_lines":[{"line_number":281,"context_line":"                update_group_hosts \u003d True"},{"line_number":282,"context_line":"                filter_properties.setdefault(\u0027group_hosts\u0027, set())"},{"line_number":283,"context_line":"                user_hosts \u003d filter_properties[\u0027group_hosts\u0027]"},{"line_number":284,"context_line":"                filter_properties[\u0027group_hosts\u0027] \u003d user_hosts | group_hosts"},{"line_number":285,"context_line":"                # Ensure that the \u0027affinity\u0027 and \u0027anti-affinity\u0027 filter do not"},{"line_number":286,"context_line":"                # contradict one another"},{"line_number":287,"context_line":"                if \u0027anti-affinity\u0027 in group[\u0027policies\u0027]:"}],"source_content_type":"text/x-python","patch_set":35,"id":"AAAAVn%2F%2Fqhg%3D","line":284,"in_reply_to":"AAAAVn%2F%2Fqks%3D","updated":"2014-03-04 20:50:08.000000000","message":"Done","commit_id":"f0545a9e3da3c9de49debf6bb6f5a68cd292dee5"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"ae5a1b6728bd878c478cd8a7e5669d5967f90b0b","unresolved":false,"context_lines":[{"line_number":284,"context_line":"                filter_properties[\u0027group_hosts\u0027] \u003d user_hosts | group_hosts"},{"line_number":285,"context_line":"                # Ensure that the \u0027affinity\u0027 and \u0027anti-affinity\u0027 filter do not"},{"line_number":286,"context_line":"                # contradict one another"},{"line_number":287,"context_line":"                if \u0027anti-affinity\u0027 in group[\u0027policies\u0027]:"},{"line_number":288,"context_line":"                    filter_properties[\u0027affinity_filter\u0027] \u003d \u0027anti-affinity\u0027"},{"line_number":289,"context_line":"                else:"},{"line_number":290,"context_line":"                    filter_properties[\u0027affinity_filter\u0027] \u003d \u0027affinity\u0027"}],"source_content_type":"text/x-python","patch_set":35,"id":"AAAAVn%2F%2Fqis%3D","line":287,"updated":"2014-03-04 19:24:26.000000000","message":"group is an object here, so you can avoid using dict notation I think.\n\nAlso, I\u0027m not sure what we\u0027re accomplishing here. On each schedule we confirm that the group is not defining conflicting policies, is that right? Shouldn\u0027t we do that when the group is created or modified? Or am I reading this wrong?","commit_id":"f0545a9e3da3c9de49debf6bb6f5a68cd292dee5"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"01c7b9967671b978acd57d29136047f9ae2097ed","unresolved":false,"context_lines":[{"line_number":284,"context_line":"                filter_properties[\u0027group_hosts\u0027] \u003d user_hosts | group_hosts"},{"line_number":285,"context_line":"                # Ensure that the \u0027affinity\u0027 and \u0027anti-affinity\u0027 filter do not"},{"line_number":286,"context_line":"                # contradict one another"},{"line_number":287,"context_line":"                if \u0027anti-affinity\u0027 in group[\u0027policies\u0027]:"},{"line_number":288,"context_line":"                    filter_properties[\u0027affinity_filter\u0027] \u003d \u0027anti-affinity\u0027"},{"line_number":289,"context_line":"                else:"},{"line_number":290,"context_line":"                    filter_properties[\u0027affinity_filter\u0027] \u003d \u0027affinity\u0027"}],"source_content_type":"text/x-python","patch_set":35,"id":"AAAAVn%2F%2Fpt8%3D","line":287,"in_reply_to":"AAAAVn%2F%2Fqg8%3D","updated":"2014-03-04 20:54:49.000000000","message":"the conflicting policies is checked when they are configured. this just ensures that the filters are not invoked. that is, if we have anti affinity configured we do not want the affinity filter to work.\n\nthe api validation patch can be seen at: https://review.openstack.org/#/c/77239/","commit_id":"f0545a9e3da3c9de49debf6bb6f5a68cd292dee5"},{"author":{"_account_id":1561,"name":"Russell Bryant","email":"rbryant@redhat.com","username":"russellb"},"change_message_id":"2b620b9a25fb86f43fde3fd39c8af1de03a489bf","unresolved":false,"context_lines":[{"line_number":284,"context_line":"                filter_properties[\u0027group_hosts\u0027] \u003d user_hosts | group_hosts"},{"line_number":285,"context_line":"                # Ensure that the \u0027affinity\u0027 and \u0027anti-affinity\u0027 filter do not"},{"line_number":286,"context_line":"                # contradict one another"},{"line_number":287,"context_line":"                if \u0027anti-affinity\u0027 in group[\u0027policies\u0027]:"},{"line_number":288,"context_line":"                    filter_properties[\u0027affinity_filter\u0027] \u003d \u0027anti-affinity\u0027"},{"line_number":289,"context_line":"                else:"},{"line_number":290,"context_line":"                    filter_properties[\u0027affinity_filter\u0027] \u003d \u0027affinity\u0027"}],"source_content_type":"text/x-python","patch_set":35,"id":"AAAAVn%2F%2Fqg8%3D","line":287,"in_reply_to":"AAAAVn%2F%2Fqis%3D","updated":"2014-03-04 20:50:08.000000000","message":"That\u0027s part of it.  It\u0027s also a signal to these filters that they should be enabled (or not).\n\nI totally agree on the validation bit.  That should be elsewhere.  That can be made more clear by just stashing the list of policies in the filter_properties.","commit_id":"f0545a9e3da3c9de49debf6bb6f5a68cd292dee5"},{"author":{"_account_id":6507,"name":"Shturm Svetlana","email":"svetlana.v.shturm@gmail.com","username":"sshturm"},"change_message_id":"107ddc7b78418c527006d0448a20e89b874b64b8","unresolved":false,"context_lines":[{"line_number":262,"context_line":"    def _setup_instance_group(context, filter_properties):"},{"line_number":263,"context_line":"        update_group_hosts \u003d False"},{"line_number":264,"context_line":"        scheduler_hints \u003d filter_properties.get(\u0027scheduler_hints\u0027) or {}"},{"line_number":265,"context_line":"        group_uuid \u003d scheduler_hints.get(\u0027group\u0027, None)"},{"line_number":266,"context_line":"        if group_uuid:"},{"line_number":267,"context_line":"            group \u003d instance_group_obj.InstanceGroup.get_by_uuid(context,"},{"line_number":268,"context_line":"                    group_uuid)"}],"source_content_type":"text/x-python","patch_set":36,"id":"AAAAVn%2F%2FjOw%3D","line":265,"updated":"2014-03-05 13:37:27.000000000","message":"In the multiple use of group hint we will have a list here. So the check for type of group (list or simple uuid) is missing here.","commit_id":"f828c76aeee7282252e9361d3dc1b18ad785cf4a"},{"author":{"_account_id":1561,"name":"Russell Bryant","email":"rbryant@redhat.com","username":"russellb"},"change_message_id":"a6fcb03e234cc4dbea6b535d1c98a3d6e0f73b2a","unresolved":false,"context_lines":[{"line_number":262,"context_line":"    def _setup_instance_group(context, filter_properties):"},{"line_number":263,"context_line":"        update_group_hosts \u003d False"},{"line_number":264,"context_line":"        scheduler_hints \u003d filter_properties.get(\u0027scheduler_hints\u0027) or {}"},{"line_number":265,"context_line":"        group_uuid \u003d scheduler_hints.get(\u0027group\u0027, None)"},{"line_number":266,"context_line":"        if group_uuid:"},{"line_number":267,"context_line":"            group \u003d instance_group_obj.InstanceGroup.get_by_uuid(context,"},{"line_number":268,"context_line":"                    group_uuid)"}],"source_content_type":"text/x-python","patch_set":36,"id":"AAAAVn%2F%2FgHk%3D","line":265,"in_reply_to":"AAAAVn%2F%2FjOw%3D","updated":"2014-03-05 18:35:21.000000000","message":"OK, since this is already approved let\u0027s fix that in a follow-up patch.","commit_id":"f828c76aeee7282252e9361d3dc1b18ad785cf4a"}],"nova/scheduler/filters/affinity_filter.py":[{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"31eba6aae9047a165a14dcd5f7179c4df6e22804","unresolved":false,"context_lines":[{"line_number":129,"context_line":"    def host_passes(self, host_state, filter_properties):"},{"line_number":130,"context_line":"        # Only invoke the filter is \u0027affinity\u0027 is configured"},{"line_number":131,"context_line":"        affinity_filter \u003d filter_properties.get(\u0027affinity-filter\u0027)"},{"line_number":132,"context_line":"        if affinity_filter !\u003d \u0027affinity\u0027:"},{"line_number":133,"context_line":"            LOG.debug(_(\"Group affinity: \u0027affinity\u0027 not set!\"))"},{"line_number":134,"context_line":"            return True"},{"line_number":135,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAAU3%2F%2Fb2Q%3D","line":132,"updated":"2014-02-26 16:56:25.000000000","message":"But this will not work atm - as the driver will never set this. If we land this patch we break affinity?","commit_id":"4c8ec34f91eeded07b4383fcd24e7974f4a6c167"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"1606025f0a3087b3347f8deb8c297346bf70bdf8","unresolved":false,"context_lines":[{"line_number":129,"context_line":"    def host_passes(self, host_state, filter_properties):"},{"line_number":130,"context_line":"        # Only invoke the filter is \u0027affinity\u0027 is configured"},{"line_number":131,"context_line":"        affinity_filter \u003d filter_properties.get(\u0027affinity-filter\u0027)"},{"line_number":132,"context_line":"        if affinity_filter !\u003d \u0027affinity\u0027:"},{"line_number":133,"context_line":"            LOG.debug(_(\"Group affinity: \u0027affinity\u0027 not set!\"))"},{"line_number":134,"context_line":"            return True"},{"line_number":135,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAAU3%2F%2Fbdc%3D","line":132,"in_reply_to":"AAAAU3%2F%2Fb2Q%3D","updated":"2014-02-27 10:06:12.000000000","message":"at the moment the group hosts are only set if the instance_group is set. i\u0027ll address this by posting a patch for the affinity support.\ni will also need to post one in the API to ensure that \u0027affinity\u0027 and \u0027anti-affinity\u0027 are not configured on the same instance group","commit_id":"4c8ec34f91eeded07b4383fcd24e7974f4a6c167"},{"author":{"_account_id":1561,"name":"Russell Bryant","email":"rbryant@redhat.com","username":"russellb"},"change_message_id":"12b2855b2cf1ce3b796bb92cdbba21217e090bf1","unresolved":false,"context_lines":[{"line_number":108,"context_line":"        # Only invoke the filter is \u0027anti-affinity\u0027 is configured"},{"line_number":109,"context_line":"        affinity_filter \u003d filter_properties.get(\u0027affinity-filter\u0027)"},{"line_number":110,"context_line":"        if affinity_filter !\u003d \u0027anti-affinity\u0027:"},{"line_number":111,"context_line":"            LOG.debug(_(\"Group anti affinity: \u0027anti-affinity\u0027 not set!\"))"},{"line_number":112,"context_line":"            return True"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"        group_hosts \u003d filter_properties.get(\u0027group_hosts\u0027) or []"}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAAVn%2F%2F3AA%3D","line":111,"updated":"2014-03-03 19:03:16.000000000","message":"I think we should remove these.  It\u0027s going to explode a debug log.","commit_id":"9bf82abc7f960ce74ff208fa3cd9b760ab9d190a"},{"author":{"_account_id":1561,"name":"Russell Bryant","email":"rbryant@redhat.com","username":"russellb"},"change_message_id":"12b2855b2cf1ce3b796bb92cdbba21217e090bf1","unresolved":false,"context_lines":[{"line_number":130,"context_line":"        # Only invoke the filter is \u0027affinity\u0027 is configured"},{"line_number":131,"context_line":"        affinity_filter \u003d filter_properties.get(\u0027affinity-filter\u0027)"},{"line_number":132,"context_line":"        if affinity_filter !\u003d \u0027affinity\u0027:"},{"line_number":133,"context_line":"            LOG.debug(_(\"Group affinity: \u0027affinity\u0027 not set!\"))"},{"line_number":134,"context_line":"            return True"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"        group_hosts \u003d filter_properties.get(\u0027group_hosts\u0027, [])"}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAAVn%2F%2F2%2F0%3D","line":133,"updated":"2014-03-03 19:03:16.000000000","message":"remove this one, too","commit_id":"9bf82abc7f960ce74ff208fa3cd9b760ab9d190a"}],"nova/tests/db/test_db_api.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"75b364f6d611866bf1bbb99b3cc1c703112350c8","unresolved":false,"context_lines":[{"line_number":1704,"context_line":"        # Make sure instance metadata is deleted as well"},{"line_number":1705,"context_line":"        self.assertEqual({}, instance_meta)"},{"line_number":1706,"context_line":""},{"line_number":1707,"context_line":"    def test_delete_instance_group_member_on_instance_destroy(self):"},{"line_number":1708,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":1709,"context_line":"        # create instance group"},{"line_number":1710,"context_line":"        values \u003d {\u0027name\u0027: \u0027fake_name\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAQ3%2F%2F%2FYU%3D","line":1707,"updated":"2013-08-11 16:19:31.000000000","message":"I think we need an add/remove or add/delete (whatever matches the other names in here) pair. Its silly only to have one.","commit_id":"53742dc304b3365907674433f9f61469f55022e9"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"2c36d99ed7307fc35a1820575128f8e91c3b56c8","unresolved":false,"context_lines":[{"line_number":1704,"context_line":"        # Make sure instance metadata is deleted as well"},{"line_number":1705,"context_line":"        self.assertEqual({}, instance_meta)"},{"line_number":1706,"context_line":""},{"line_number":1707,"context_line":"    def test_delete_instance_group_member_on_instance_destroy(self):"},{"line_number":1708,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":1709,"context_line":"        # create instance group"},{"line_number":1710,"context_line":"        values \u003d {\u0027name\u0027: \u0027fake_name\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAQ3%2F%2F45k%3D","line":1707,"in_reply_to":"AAAAQ3%2F%2F%2FYU%3D","updated":"2013-08-13 13:05:47.000000000","message":"Done","commit_id":"53742dc304b3365907674433f9f61469f55022e9"},{"author":{"_account_id":7494,"name":"Guangya Liu","email":"gyliu513@gmail.com","username":"JayLau"},"change_message_id":"c2d2d30b3df904865d6389c4c3cbc340ae75619a","unresolved":false,"context_lines":[{"line_number":1856,"context_line":"        # update instance group with the instance id"},{"line_number":1857,"context_line":"        db.instance_group_members_add(ctxt, ig[\u0027uuid\u0027], [instance[\u0027uuid\u0027]])"},{"line_number":1858,"context_line":"        members \u003d db.instance_group_members_get(ctxt, ig[\u0027uuid\u0027])"},{"line_number":1859,"context_line":"        self.assertEqual(members, [instance[\u0027uuid\u0027]])"},{"line_number":1860,"context_line":"        # delete the instance"},{"line_number":1861,"context_line":"        db.instance_destroy(ctxt, instance[\u0027uuid\u0027])"},{"line_number":1862,"context_line":"        # check that no member exists"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2FksE%3D","line":1859,"updated":"2014-02-12 09:11:16.000000000","message":"It is supposed to be assertEqual(expected, observed)","commit_id":"95deb625645bdfbec872733dc7bf3814531609b3"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"2ce58c7489050baf909d81e792ed976231c4bb20","unresolved":false,"context_lines":[{"line_number":1856,"context_line":"        # update instance group with the instance id"},{"line_number":1857,"context_line":"        db.instance_group_members_add(ctxt, ig[\u0027uuid\u0027], [instance[\u0027uuid\u0027]])"},{"line_number":1858,"context_line":"        members \u003d db.instance_group_members_get(ctxt, ig[\u0027uuid\u0027])"},{"line_number":1859,"context_line":"        self.assertEqual(members, [instance[\u0027uuid\u0027]])"},{"line_number":1860,"context_line":"        # delete the instance"},{"line_number":1861,"context_line":"        db.instance_destroy(ctxt, instance[\u0027uuid\u0027])"},{"line_number":1862,"context_line":"        # check that no member exists"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2FkXQ%3D","line":1859,"in_reply_to":"AAAAUX%2F%2FksE%3D","updated":"2014-02-12 09:43:27.000000000","message":"Done","commit_id":"95deb625645bdfbec872733dc7bf3814531609b3"},{"author":{"_account_id":7494,"name":"Guangya Liu","email":"gyliu513@gmail.com","username":"JayLau"},"change_message_id":"c2d2d30b3df904865d6389c4c3cbc340ae75619a","unresolved":false,"context_lines":[{"line_number":1863,"context_line":"        instance_meta \u003d db.instance_metadata_get(ctxt, instance[\u0027uuid\u0027])"},{"line_number":1864,"context_line":"        # Make sure instance metadata is deleted as well"},{"line_number":1865,"context_line":"        members \u003d db.instance_group_members_get(ctxt, ig[\u0027uuid\u0027])"},{"line_number":1866,"context_line":"        self.assertEqual(members, [])"},{"line_number":1867,"context_line":""},{"line_number":1868,"context_line":"    def test_delete_instance_with_instance_group_exception(self):"},{"line_number":1869,"context_line":"        ctxt \u003d context.get_admin_context()"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2FksY%3D","line":1866,"updated":"2014-02-12 09:11:16.000000000","message":"ditto","commit_id":"95deb625645bdfbec872733dc7bf3814531609b3"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"2ce58c7489050baf909d81e792ed976231c4bb20","unresolved":false,"context_lines":[{"line_number":1863,"context_line":"        instance_meta \u003d db.instance_metadata_get(ctxt, instance[\u0027uuid\u0027])"},{"line_number":1864,"context_line":"        # Make sure instance metadata is deleted as well"},{"line_number":1865,"context_line":"        members \u003d db.instance_group_members_get(ctxt, ig[\u0027uuid\u0027])"},{"line_number":1866,"context_line":"        self.assertEqual(members, [])"},{"line_number":1867,"context_line":""},{"line_number":1868,"context_line":"    def test_delete_instance_with_instance_group_exception(self):"},{"line_number":1869,"context_line":"        ctxt \u003d context.get_admin_context()"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2FkWg%3D","line":1866,"in_reply_to":"AAAAUX%2F%2FksY%3D","updated":"2014-02-12 09:43:27.000000000","message":"Done","commit_id":"95deb625645bdfbec872733dc7bf3814531609b3"}],"nova/tests/scheduler/test_scheduler.py":[{"author":{"_account_id":7629,"name":"Shawn Hartsock","email":"hartsock@acm.org","username":"hartsocks"},"change_message_id":"282b7fb611023df4f992c21e108e5d2408833284","unresolved":false,"context_lines":[{"line_number":607,"context_line":""},{"line_number":608,"context_line":"    def setUp(self):"},{"line_number":609,"context_line":"        super(SchedulerInstanceGroupData, self).setUp()"},{"line_number":610,"context_line":"        self.context \u003d context.RequestContext(\u0027fake_user\u0027, \u0027fake_project\u0027)"},{"line_number":611,"context_line":"        self.user_id \u003d \u0027fake_user\u0027"},{"line_number":612,"context_line":"        self.project_id \u003d \u0027fake_project\u0027"},{"line_number":613,"context_line":"        self.context \u003d context.RequestContext(self.user_id, self.project_id)"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F8p3c%3D","line":610,"updated":"2013-12-23 18:42:35.000000000","message":"I don\u0027t understand why you need to set up RequestContext twice, once here and once below.","commit_id":"fb581d497e378bdb7115cba9a16ca463215cc77b"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"39b57e91f3c9b921d3c3af483b46b6f3a492033b","unresolved":false,"context_lines":[{"line_number":607,"context_line":""},{"line_number":608,"context_line":"    def setUp(self):"},{"line_number":609,"context_line":"        super(SchedulerInstanceGroupData, self).setUp()"},{"line_number":610,"context_line":"        self.context \u003d context.RequestContext(\u0027fake_user\u0027, \u0027fake_project\u0027)"},{"line_number":611,"context_line":"        self.user_id \u003d \u0027fake_user\u0027"},{"line_number":612,"context_line":"        self.project_id \u003d \u0027fake_project\u0027"},{"line_number":613,"context_line":"        self.context \u003d context.RequestContext(self.user_id, self.project_id)"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAT3%2F%2F86s%3D","line":610,"in_reply_to":"AAAATn%2F8p3c%3D","updated":"2013-12-26 12:42:31.000000000","message":"fixed.","commit_id":"fb581d497e378bdb7115cba9a16ca463215cc77b"},{"author":{"_account_id":7629,"name":"Shawn Hartsock","email":"hartsock@acm.org","username":"hartsocks"},"change_message_id":"282b7fb611023df4f992c21e108e5d2408833284","unresolved":false,"context_lines":[{"line_number":643,"context_line":"        (ig, instances) \u003d self.driver.instance_group_data(self.context,"},{"line_number":644,"context_line":"                                                          db_res.uuid)"},{"line_number":645,"context_line":"        self.assertEqual(len(instances), 1)"},{"line_number":646,"context_line":"        self.assertEqual(ig.uuid, db_res.uuid)"},{"line_number":647,"context_line":""},{"line_number":648,"context_line":"    def test_instance_group_data_invalid(self):"},{"line_number":649,"context_line":"        members \u003d [\u0027fake_instance_id\u0027]"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F8pzw%3D","line":646,"updated":"2013-12-23 18:42:35.000000000","message":"would it be better to compare id.uuid to instance.uuid (or members[0].uuid) from above? that would assert that the method under _create_instance_group did not accidentally inject a new UUID.","commit_id":"fb581d497e378bdb7115cba9a16ca463215cc77b"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"39b57e91f3c9b921d3c3af483b46b6f3a492033b","unresolved":false,"context_lines":[{"line_number":643,"context_line":"        (ig, instances) \u003d self.driver.instance_group_data(self.context,"},{"line_number":644,"context_line":"                                                          db_res.uuid)"},{"line_number":645,"context_line":"        self.assertEqual(len(instances), 1)"},{"line_number":646,"context_line":"        self.assertEqual(ig.uuid, db_res.uuid)"},{"line_number":647,"context_line":""},{"line_number":648,"context_line":"    def test_instance_group_data_invalid(self):"},{"line_number":649,"context_line":"        members \u003d [\u0027fake_instance_id\u0027]"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAT3%2F%2F86c%3D","line":646,"in_reply_to":"AAAATn%2F8pzw%3D","updated":"2013-12-26 12:42:31.000000000","message":"the test here checks that the instance group uuid is the one that is returned from the self.driver.instance_group_data\ni have added a validation that the members contains the correct uuid.","commit_id":"fb581d497e378bdb7115cba9a16ca463215cc77b"},{"author":{"_account_id":7629,"name":"Shawn Hartsock","email":"hartsock@acm.org","username":"hartsocks"},"change_message_id":"a279ca5126732ef0418d9a27439a28ac06bde8ee","unresolved":false,"context_lines":[{"line_number":653,"context_line":"        (ig, instances) \u003d self.driver.instance_group_data(self.context,"},{"line_number":654,"context_line":"                                                          db_res.uuid)"},{"line_number":655,"context_line":"        self.assertEqual(len(instances), 0)"},{"line_number":656,"context_line":"        self.assertEqual(ig.uuid, db_res.uuid)"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAT3%2F%2F0x4%3D","line":656,"updated":"2013-12-30 18:00:09.000000000","message":"I would like to see two new tests here covering the case where the ig.members have missing members and where the db.instance_get_by_uuid(context, member) call returns None.","commit_id":"254636a51e67307514eacfc80a48cce66b1b2657"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"0f99e324c7f1804928d6ae8205ad7240da81cada","unresolved":false,"context_lines":[{"line_number":653,"context_line":"        (ig, instances) \u003d self.driver.instance_group_data(self.context,"},{"line_number":654,"context_line":"                                                          db_res.uuid)"},{"line_number":655,"context_line":"        self.assertEqual(len(instances), 0)"},{"line_number":656,"context_line":"        self.assertEqual(ig.uuid, db_res.uuid)"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAUH%2F%2F%2BuY%3D","line":656,"in_reply_to":"AAAAT3%2F%2F0x4%3D","updated":"2014-01-05 13:17:58.000000000","message":"i have checked and the instance_get_by_uuid( should not return None. This was my bad.\nThe test case here checks that the member is not equal to the configured instances","commit_id":"254636a51e67307514eacfc80a48cce66b1b2657"},{"author":{"_account_id":7494,"name":"Guangya Liu","email":"gyliu513@gmail.com","username":"JayLau"},"change_message_id":"87968cd34de7c0ec9c92979ed0dc09ee4836f6da","unresolved":false,"context_lines":[{"line_number":627,"context_line":"        db \u003d self._create_instance_group(self.context, values)"},{"line_number":628,"context_line":"        (ig, instances) \u003d self.driver.instance_group_data(self.context,"},{"line_number":629,"context_line":"                                                          db.uuid)"},{"line_number":630,"context_line":"        self.assertEqual(len(instances), 0)"},{"line_number":631,"context_line":"        self.assertEqual(ig.uuid, db.uuid)"},{"line_number":632,"context_line":""},{"line_number":633,"context_line":"    def test_instance_group_data_valid(self):"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUH%2F%2F8Mk%3D","line":630,"updated":"2014-01-06 14:13:47.000000000","message":"assertEqual(expected, observed).\n \nIt is better that we update all test cases to follow such style.","commit_id":"201a6c6707f749a4eb1156e6dea2faab5e23522f"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"245b7e9a11fbfeee5c1d3a877a6cda10d2f0914a","unresolved":false,"context_lines":[{"line_number":627,"context_line":"        db \u003d self._create_instance_group(self.context, values)"},{"line_number":628,"context_line":"        (ig, instances) \u003d self.driver.instance_group_data(self.context,"},{"line_number":629,"context_line":"                                                          db.uuid)"},{"line_number":630,"context_line":"        self.assertEqual(len(instances), 0)"},{"line_number":631,"context_line":"        self.assertEqual(ig.uuid, db.uuid)"},{"line_number":632,"context_line":""},{"line_number":633,"context_line":"    def test_instance_group_data_valid(self):"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUH%2F%2F8E4%3D","line":630,"in_reply_to":"AAAAUH%2F%2F8Mk%3D","updated":"2014-01-06 14:36:18.000000000","message":"Done","commit_id":"201a6c6707f749a4eb1156e6dea2faab5e23522f"}]}
