)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8415,"name":"Denis M.","email":"lildee1991@gmail.com","username":"dmakogon"},"change_message_id":"e704547793d3e9c43e65b8608b0c48b2daab56a4","unresolved":false,"context_lines":[{"line_number":11,"context_line":"dynamic parameters. In order to address this, 2 changes have been"},{"line_number":12,"context_line":"made:"},{"line_number":13,"context_line":"1. Return an error if a configuration-attach attempt is made to an"},{"line_number":14,"context_line":"instance that alreday has an attached configuration group"},{"line_number":15,"context_line":"2. Always set RESTART_REQUIRED on configuration-detach"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Change-Id: I35770eafdc2841ac58b770851efc953e0370c2cb"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"AAAAXH%2F%2FpPk%3D","line":14,"updated":"2014-04-18 15:12:51.000000000","message":". in the end of the line","commit_id":"489d0249eedc3a37d4d788369ca29b56dc31debb"},{"author":{"_account_id":8415,"name":"Denis M.","email":"lildee1991@gmail.com","username":"dmakogon"},"change_message_id":"e704547793d3e9c43e65b8608b0c48b2daab56a4","unresolved":false,"context_lines":[{"line_number":12,"context_line":"made:"},{"line_number":13,"context_line":"1. Return an error if a configuration-attach attempt is made to an"},{"line_number":14,"context_line":"instance that alreday has an attached configuration group"},{"line_number":15,"context_line":"2. Always set RESTART_REQUIRED on configuration-detach"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Change-Id: I35770eafdc2841ac58b770851efc953e0370c2cb"},{"line_number":18,"context_line":"Closes-Bug: #1301683"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"AAAAXH%2F%2FpPg%3D","line":15,"updated":"2014-04-18 15:12:51.000000000","message":". in the end of the line","commit_id":"489d0249eedc3a37d4d788369ca29b56dc31debb"},{"author":{"_account_id":9664,"name":"amrith","email":"amrith.kumar@gmail.com","username":"amrith"},"change_message_id":"3c1b75f59a6f307d72ca4255168abda4f66a1fa8","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Running configuration-attach with 2 different configuration groups"},{"line_number":10,"context_line":"against the same instance can result in unintended combinations of"},{"line_number":11,"context_line":"dynamic parameters. In order to address this, 2 changes have been"},{"line_number":12,"context_line":"made:"},{"line_number":13,"context_line":"1. Return an error if a configuration-attach attempt is made to an"},{"line_number":14,"context_line":"instance that alreday has an attached configuration group."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"AAAAXH%2F%2FWYM%3D","line":11,"updated":"2014-04-22 11:45:25.000000000","message":"you say 2, you list 3, the code does 4 (active tasks) ;)","commit_id":"daa119ead5e267c565ef69435e55de5983b34569"},{"author":{"_account_id":9746,"name":"Doug Shelley","email":"dougshelley66@gmail.com","username":"dougshelley"},"change_message_id":"552065032950de994a088c2b7aa55be950746a97","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Running configuration-attach with 2 different configuration groups"},{"line_number":10,"context_line":"against the same instance can result in unintended combinations of"},{"line_number":11,"context_line":"dynamic parameters. In order to address this, 2 changes have been"},{"line_number":12,"context_line":"made:"},{"line_number":13,"context_line":"1. Return an error if a configuration-attach attempt is made to an"},{"line_number":14,"context_line":"instance that alreday has an attached configuration group."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"AAAAXH%2F%2FVrI%3D","line":11,"in_reply_to":"AAAAXH%2F%2FWYM%3D","updated":"2014-04-22 12:39:52.000000000","message":"Done","commit_id":"daa119ead5e267c565ef69435e55de5983b34569"}],"trove/common/exception.py":[{"author":{"_account_id":2463,"name":"Florian Haas","email":"florian.haas@cleura.com","username":"fghaas"},"change_message_id":"ebb8530d312c604af9c29d0a12cd78c671775877","unresolved":false,"context_lines":[{"line_number":404,"context_line":""},{"line_number":405,"context_line":""},{"line_number":406,"context_line":"class ConfigurationAlreadyAssigned(TroveError):"},{"line_number":407,"context_line":"    message \u003d _(\"Instance %(instance_id)s is already assigned \""},{"line_number":408,"context_line":"                \"Configuration Group %(configuration_id)s.\")"},{"line_number":409,"context_line":""},{"line_number":410,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAXH%2F%2FXlI%3D","line":407,"updated":"2014-04-22 09:17:52.000000000","message":"The message here is worded a bit confusingly; perhaps change to \"Instance %(instance_id)s is already assigned a Configuration Group: %(configuration_id)s\"?","commit_id":"daa119ead5e267c565ef69435e55de5983b34569"},{"author":{"_account_id":9746,"name":"Doug Shelley","email":"dougshelley66@gmail.com","username":"dougshelley"},"change_message_id":"552065032950de994a088c2b7aa55be950746a97","unresolved":false,"context_lines":[{"line_number":404,"context_line":""},{"line_number":405,"context_line":""},{"line_number":406,"context_line":"class ConfigurationAlreadyAssigned(TroveError):"},{"line_number":407,"context_line":"    message \u003d _(\"Instance %(instance_id)s is already assigned \""},{"line_number":408,"context_line":"                \"Configuration Group %(configuration_id)s.\")"},{"line_number":409,"context_line":""},{"line_number":410,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAXH%2F%2FVrQ%3D","line":407,"in_reply_to":"AAAAXH%2F%2FXlI%3D","updated":"2014-04-22 12:39:52.000000000","message":"Done","commit_id":"daa119ead5e267c565ef69435e55de5983b34569"},{"author":{"_account_id":8214,"name":"Auston McReynolds","email":"amcreynolds@ebaysf.com","username":"amcreynolds"},"change_message_id":"f8d387ee68bbb84efac29481b4ee1134e74b27f1","unresolved":false,"context_lines":[{"line_number":403,"context_line":"                \" set as of %(parameter_deleted_at)s\")"},{"line_number":404,"context_line":""},{"line_number":405,"context_line":""},{"line_number":406,"context_line":"class ConfigurationAlreadyAssigned(TroveError):"},{"line_number":407,"context_line":"    message \u003d _(\"Instance %(instance_id)s is already assigned a \""},{"line_number":408,"context_line":"                \"Configuration Group: %(configuration_id)s.\")"},{"line_number":409,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAXX%2F%2F9l0%3D","line":406,"updated":"2014-04-25 00:56:07.000000000","message":"please rename to ConfigurationAlreadyAttached (see below)","commit_id":"6e8a092bdbd8fd83e4eca3516a9d10ad07efd70d"},{"author":{"_account_id":8214,"name":"Auston McReynolds","email":"amcreynolds@ebaysf.com","username":"amcreynolds"},"change_message_id":"f8d387ee68bbb84efac29481b4ee1134e74b27f1","unresolved":false,"context_lines":[{"line_number":405,"context_line":""},{"line_number":406,"context_line":"class ConfigurationAlreadyAssigned(TroveError):"},{"line_number":407,"context_line":"    message \u003d _(\"Instance %(instance_id)s is already assigned a \""},{"line_number":408,"context_line":"                \"Configuration Group: %(configuration_id)s.\")"},{"line_number":409,"context_line":""},{"line_number":410,"context_line":""},{"line_number":411,"context_line":"class InvalidInstanceState(TroveError):"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAXX%2F%2F9lc%3D","line":408,"updated":"2014-04-25 00:56:07.000000000","message":"please change to \"Instance %(instance_id)s already has a Configuration Group attached: %(configuration_id)s.\"\n\nreason: the term \u0027attach\u0027 is used consistently across all user-facing endpoints, so we don\u0027t want to introduce \u0027assign\u0027.","commit_id":"6e8a092bdbd8fd83e4eca3516a9d10ad07efd70d"},{"author":{"_account_id":8214,"name":"Auston McReynolds","email":"amcreynolds@ebaysf.com","username":"amcreynolds"},"change_message_id":"f8d387ee68bbb84efac29481b4ee1134e74b27f1","unresolved":false,"context_lines":[{"line_number":410,"context_line":""},{"line_number":411,"context_line":"class InvalidInstanceState(TroveError):"},{"line_number":412,"context_line":"    message \u003d _(\"Instance %(instance_id)s is in an invalid state \""},{"line_number":413,"context_line":"                \"%(status)s for this operation.\")"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAXX%2F%2F9kQ%3D","line":413,"updated":"2014-04-25 00:56:07.000000000","message":"this message is not very user friendly.\n\nex (after eval): \"Instance 1234 is in an invalid state BACKUP for this operation\"\n\nplease change to \"The operation you have requested cannot be executed because the instance status is currently: %(status)s\"\n\nex (after eval): \"The operation you have requested cannot be executed because the instance status is currently: BACKUP\".\n\nmuch better.","commit_id":"6e8a092bdbd8fd83e4eca3516a9d10ad07efd70d"}],"trove/instance/models.py":[{"author":{"_account_id":8415,"name":"Denis M.","email":"lildee1991@gmail.com","username":"dmakogon"},"change_message_id":"e704547793d3e9c43e65b8608b0c48b2daab56a4","unresolved":false,"context_lines":[{"line_number":821,"context_line":"            flavor \u003d self.get_flavor()"},{"line_number":822,"context_line":"            config_id \u003d self.configuration.id"},{"line_number":823,"context_line":"            LOG.debug(_(\"configuration being unassigned; marking restart required\"))"},{"line_number":824,"context_line":"            self.update_db(task_status\u003dInstanceTasks.RESTART_REQUIRED)"},{"line_number":825,"context_line":"            task_api.API(self.context).unassign_configuration(self.id,"},{"line_number":826,"context_line":"                                                              flavor,"},{"line_number":827,"context_line":"                                                              config_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAXH%2F%2FpNk%3D","line":824,"updated":"2014-04-18 15:12:51.000000000","message":"given bug describes an issue that happens every time when user attempting to assign the configuration to an instance that already has one\n\nbut this change follows anothe goal - each tine detach happens instance should be placed into the RESTART_REQUIRED status.","commit_id":"489d0249eedc3a37d4d788369ca29b56dc31debb"},{"author":{"_account_id":9746,"name":"Doug Shelley","email":"dougshelley66@gmail.com","username":"dougshelley"},"change_message_id":"9ebe42382e55be8b0757f1a42687dff7a0d51c2d","unresolved":false,"context_lines":[{"line_number":821,"context_line":"            flavor \u003d self.get_flavor()"},{"line_number":822,"context_line":"            config_id \u003d self.configuration.id"},{"line_number":823,"context_line":"            LOG.debug(_(\"configuration being unassigned; marking restart required\"))"},{"line_number":824,"context_line":"            self.update_db(task_status\u003dInstanceTasks.RESTART_REQUIRED)"},{"line_number":825,"context_line":"            task_api.API(self.context).unassign_configuration(self.id,"},{"line_number":826,"context_line":"                                                              flavor,"},{"line_number":827,"context_line":"                                                              config_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAXH%2F%2Fobw%3D","line":824,"in_reply_to":"AAAAXH%2F%2Folo%3D","updated":"2014-04-18 17:19:07.000000000","message":"The issue here is that an instance can be left in an inconsistent state due to attach or detach. This commit fixes that behaviour. To do that both changes are required.\n\nI will change the commit header.","commit_id":"489d0249eedc3a37d4d788369ca29b56dc31debb"},{"author":{"_account_id":8415,"name":"Denis M.","email":"lildee1991@gmail.com","username":"dmakogon"},"change_message_id":"fa89e7d6d5a7caa04653067d54bb5d53eedab1d9","unresolved":false,"context_lines":[{"line_number":821,"context_line":"            flavor \u003d self.get_flavor()"},{"line_number":822,"context_line":"            config_id \u003d self.configuration.id"},{"line_number":823,"context_line":"            LOG.debug(_(\"configuration being unassigned; marking restart required\"))"},{"line_number":824,"context_line":"            self.update_db(task_status\u003dInstanceTasks.RESTART_REQUIRED)"},{"line_number":825,"context_line":"            task_api.API(self.context).unassign_configuration(self.id,"},{"line_number":826,"context_line":"                                                              flavor,"},{"line_number":827,"context_line":"                                                              config_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAXH%2F%2Folo%3D","line":824,"in_reply_to":"AAAAXH%2F%2Foqs%3D","updated":"2014-04-18 16:43:17.000000000","message":"The _actual_ intent of the patch is (as said in commit message) - Disallow multiple configuration-attach \u003c--- and nothing else.\n\nI\u0027d suggest you to update the bug-report. If you don\u0027t, you would need to file another. Because OpenStack contribution flow expects to have one context per given change.","commit_id":"489d0249eedc3a37d4d788369ca29b56dc31debb"},{"author":{"_account_id":9746,"name":"Doug Shelley","email":"dougshelley66@gmail.com","username":"dougshelley"},"change_message_id":"0339e8b644a176d5ce81571fe3ef941b70864564","unresolved":false,"context_lines":[{"line_number":821,"context_line":"            flavor \u003d self.get_flavor()"},{"line_number":822,"context_line":"            config_id \u003d self.configuration.id"},{"line_number":823,"context_line":"            LOG.debug(_(\"configuration being unassigned; marking restart required\"))"},{"line_number":824,"context_line":"            self.update_db(task_status\u003dInstanceTasks.RESTART_REQUIRED)"},{"line_number":825,"context_line":"            task_api.API(self.context).unassign_configuration(self.id,"},{"line_number":826,"context_line":"                                                              flavor,"},{"line_number":827,"context_line":"                                                              config_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAXH%2F%2Foqs%3D","line":824,"in_reply_to":"AAAAXH%2F%2FpNk%3D","updated":"2014-04-18 16:34:07.000000000","message":"if the detach doesn\u0027t set RESTART_REQUIRED, then the user can still end up in an inconsistent state. The intent of this bug was that this doesn\u0027t happen in any scenario","commit_id":"489d0249eedc3a37d4d788369ca29b56dc31debb"},{"author":{"_account_id":8415,"name":"Denis M.","email":"lildee1991@gmail.com","username":"dmakogon"},"change_message_id":"e704547793d3e9c43e65b8608b0c48b2daab56a4","unresolved":false,"context_lines":[{"line_number":836,"context_line":"                message\u003d\u0027Configuration group id: %s could not be found\u0027"},{"line_number":837,"context_line":"                % configuration_id)"},{"line_number":838,"context_line":""},{"line_number":839,"context_line":"        if ( self.db_info.configuration_id is not None ):"},{"line_number":840,"context_line":"            raise exception.ConfigurationAlreadyAssigned("},{"line_number":841,"context_line":"                instance_id\u003dself.id,"},{"line_number":842,"context_line":"                configuration_id\u003dself.db_info.configuration_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAXH%2F%2FpQA%3D","line":839,"updated":"2014-04-18 15:12:51.000000000","message":"braces is not required","commit_id":"489d0249eedc3a37d4d788369ca29b56dc31debb"},{"author":{"_account_id":9782,"name":"Morgan Jones","email":"morgan@tesora.com","username":"vgnbkr"},"change_message_id":"d4ee6021f3420705429471de3a020f51a991fd05","unresolved":false,"context_lines":[{"line_number":857,"context_line":"                message\u003d\u0027Configuration group id: %s could not be found\u0027"},{"line_number":858,"context_line":"                % configuration_id)"},{"line_number":859,"context_line":""},{"line_number":860,"context_line":"        # check if the instance already has a configuration assigned"},{"line_number":861,"context_line":"        if self.db_info.configuration_id is not None:"},{"line_number":862,"context_line":"            raise exception.ConfigurationAlreadyAssigned("},{"line_number":863,"context_line":"                instance_id\u003dself.id,"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAXH%2F%2FdwU%3D","line":860,"updated":"2014-04-21 15:19:37.000000000","message":"Could this check be in validate_can_perform_assign()?","commit_id":"e935919bb9f07e311b7f27af881b3bf02fbee638"},{"author":{"_account_id":4240,"name":"Craig Vyvial","email":"cp16net@gmail.com","username":"cp16net"},"change_message_id":"d069472eb39590523f9a8248da208c56afb192e6","unresolved":false,"context_lines":[{"line_number":857,"context_line":"                message\u003d\u0027Configuration group id: %s could not be found\u0027"},{"line_number":858,"context_line":"                % configuration_id)"},{"line_number":859,"context_line":""},{"line_number":860,"context_line":"        # check if the instance already has a configuration assigned"},{"line_number":861,"context_line":"        if self.db_info.configuration_id is not None:"},{"line_number":862,"context_line":"            raise exception.ConfigurationAlreadyAssigned("},{"line_number":863,"context_line":"                instance_id\u003dself.id,"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAXH%2F%2FdF8%3D","line":860,"in_reply_to":"AAAAXH%2F%2FdwU%3D","updated":"2014-04-21 16:33:18.000000000","message":"Yeah i think thats a good idea.","commit_id":"e935919bb9f07e311b7f27af881b3bf02fbee638"},{"author":{"_account_id":6156,"name":"Justin Hopper","email":"justin.hopper@hp.com","username":"justin-hopper"},"change_message_id":"76b0790fdeb9e16953fb3577d9ad72db2bd1a37c","unresolved":false,"context_lines":[{"line_number":812,"context_line":"        LOG.error(msg)"},{"line_number":813,"context_line":"        raise exception.UnprocessableEntity(msg)"},{"line_number":814,"context_line":""},{"line_number":815,"context_line":"    def validate_can_perform_assign(self):"},{"line_number":816,"context_line":"        \"\"\""},{"line_number":817,"context_line":"        Raises exception if a configuration assign cannot"},{"line_number":818,"context_line":"        currently be performed"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAXX%2F%2F%2Fzc%3D","line":815,"updated":"2014-04-24 18:54:11.000000000","message":"this appears to be a private function so _ prefix would be useful designation","commit_id":"8f7a86e50772de16707add92a807c8b98f9da1a6"},{"author":{"_account_id":9746,"name":"Doug Shelley","email":"dougshelley66@gmail.com","username":"dougshelley"},"change_message_id":"c93d792fdcbb9e91f861cdf357183f2c14dee35c","unresolved":false,"context_lines":[{"line_number":812,"context_line":"        LOG.error(msg)"},{"line_number":813,"context_line":"        raise exception.UnprocessableEntity(msg)"},{"line_number":814,"context_line":""},{"line_number":815,"context_line":"    def validate_can_perform_assign(self):"},{"line_number":816,"context_line":"        \"\"\""},{"line_number":817,"context_line":"        Raises exception if a configuration assign cannot"},{"line_number":818,"context_line":"        currently be performed"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAXX%2F%2F958%3D","line":815,"in_reply_to":"AAAAXX%2F%2F%2Fzc%3D","updated":"2014-04-24 23:43:21.000000000","message":"Done","commit_id":"8f7a86e50772de16707add92a807c8b98f9da1a6"},{"author":{"_account_id":5390,"name":"Steve Leon","username":"steve-leon","inactive":true},"change_message_id":"0775a5ff97bb4415a5aa19b389e59695a2127eea","unresolved":false,"context_lines":[{"line_number":819,"context_line":"        \"\"\""},{"line_number":820,"context_line":""},{"line_number":821,"context_line":"        # check if the instance is not ACTIVE or has tasks"},{"line_number":822,"context_line":"        if self.db_info.server_status !\u003d InstanceStatus.ACTIVE:"},{"line_number":823,"context_line":"            status \u003d self.db_info.server_status"},{"line_number":824,"context_line":"        elif self.db_info.task_status !\u003d InstanceTasks.NONE:"},{"line_number":825,"context_line":"            status \u003d self.db_info.task_status.action"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAXH%2F%2FHaA%3D","line":822,"updated":"2014-04-23 22:20:07.000000000","message":"There is already a method that checks whether an action can be applied to the instance based on its status.\nThis is the validate_can_perform_action(). Use this one instead. A lot of the instance actions use this validation.","commit_id":"8f7a86e50772de16707add92a807c8b98f9da1a6"},{"author":{"_account_id":8415,"name":"Denis M.","email":"lildee1991@gmail.com","username":"dmakogon"},"change_message_id":"bc348c482beb1ccb051eb263b2acd34aee292412","unresolved":false,"context_lines":[{"line_number":819,"context_line":"        \"\"\""},{"line_number":820,"context_line":""},{"line_number":821,"context_line":"        # check if the instance is not ACTIVE or has tasks"},{"line_number":822,"context_line":"        if self.db_info.server_status !\u003d InstanceStatus.ACTIVE:"},{"line_number":823,"context_line":"            status \u003d self.db_info.server_status"},{"line_number":824,"context_line":"        elif self.db_info.task_status !\u003d InstanceTasks.NONE:"},{"line_number":825,"context_line":"            status \u003d self.db_info.task_status.action"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAXH%2F%2FAz4%3D","line":822,"in_reply_to":"AAAAXH%2F%2FBKE%3D","updated":"2014-04-24 16:58:29.000000000","message":"i guess that it also would work, because instance is ready to do any types of tasks only if instance status/task is ACTIVE/NONE - and it\u0027s only valid status i suppose.","commit_id":"8f7a86e50772de16707add92a807c8b98f9da1a6"},{"author":{"_account_id":9746,"name":"Doug Shelley","email":"dougshelley66@gmail.com","username":"dougshelley"},"change_message_id":"11aff63323e90ed7284841fa35e2da3c186b57cd","unresolved":false,"context_lines":[{"line_number":819,"context_line":"        \"\"\""},{"line_number":820,"context_line":""},{"line_number":821,"context_line":"        # check if the instance is not ACTIVE or has tasks"},{"line_number":822,"context_line":"        if self.db_info.server_status !\u003d InstanceStatus.ACTIVE:"},{"line_number":823,"context_line":"            status \u003d self.db_info.server_status"},{"line_number":824,"context_line":"        elif self.db_info.task_status !\u003d InstanceTasks.NONE:"},{"line_number":825,"context_line":"            status \u003d self.db_info.task_status.action"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAXH%2F%2FBKE%3D","line":822,"in_reply_to":"AAAAXH%2F%2FDDU%3D","updated":"2014-04-24 16:46:22.000000000","message":"But this logic doesn\u0027t yield the same result - the status doesn\u0027t get set properly such that the exception below would have bad information in it. Given that service status and task status are different, your code snippet above would only trace service status for the raised exception below.","commit_id":"8f7a86e50772de16707add92a807c8b98f9da1a6"},{"author":{"_account_id":5390,"name":"Steve Leon","username":"steve-leon","inactive":true},"change_message_id":"d83428ecc670f5c87a3b56a20d74d482b1bcab08","unresolved":false,"context_lines":[{"line_number":819,"context_line":"        \"\"\""},{"line_number":820,"context_line":""},{"line_number":821,"context_line":"        # check if the instance is not ACTIVE or has tasks"},{"line_number":822,"context_line":"        if self.db_info.server_status !\u003d InstanceStatus.ACTIVE:"},{"line_number":823,"context_line":"            status \u003d self.db_info.server_status"},{"line_number":824,"context_line":"        elif self.db_info.task_status !\u003d InstanceTasks.NONE:"},{"line_number":825,"context_line":"            status \u003d self.db_info.task_status.action"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAXH%2F%2FA%2Bc%3D","line":822,"in_reply_to":"AAAAXH%2F%2FDDU%3D","updated":"2014-04-24 16:42:19.000000000","message":"Yeah, i see your concern. And even if we try to incorporate this logic into the validate_can_perform_action(), it will make that function much more confusing with more \u0027if/else\u0027 statements than it needs and make it do too much. Ideally, we should the unassign_configuration() and assign_configuration() in the configuration model and not the instance model (similar to assigning security groups). But that is probably outside the scope for this bug fix","commit_id":"8f7a86e50772de16707add92a807c8b98f9da1a6"},{"author":{"_account_id":8415,"name":"Denis M.","email":"lildee1991@gmail.com","username":"dmakogon"},"change_message_id":"42d2470e9db7faec8223b59f33af6633c54734e4","unresolved":false,"context_lines":[{"line_number":819,"context_line":"        \"\"\""},{"line_number":820,"context_line":""},{"line_number":821,"context_line":"        # check if the instance is not ACTIVE or has tasks"},{"line_number":822,"context_line":"        if self.db_info.server_status !\u003d InstanceStatus.ACTIVE:"},{"line_number":823,"context_line":"            status \u003d self.db_info.server_status"},{"line_number":824,"context_line":"        elif self.db_info.task_status !\u003d InstanceTasks.NONE:"},{"line_number":825,"context_line":"            status \u003d self.db_info.task_status.action"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAXH%2F%2FDDU%3D","line":822,"in_reply_to":"AAAAXH%2F%2FGVI%3D","updated":"2014-04-24 11:50:19.000000000","message":"As for me, logic should look like:\nif instance is active and in stand-by mode (task status is NONE) then we could perform actions over instance.\n\nWhat if:\n\nif (self.db_info.server_status, self.db_info.task_status) not in (InstanceStatus.ACTIVE, InstanceTasks.NONE):\n      status \u003d self.db_info.server_status\nelif:\n    ----- last lines -----","commit_id":"8f7a86e50772de16707add92a807c8b98f9da1a6"},{"author":{"_account_id":9746,"name":"Doug Shelley","email":"dougshelley66@gmail.com","username":"dougshelley"},"change_message_id":"59bcb77add8b0b70c36528e9e94a609a6df71230","unresolved":false,"context_lines":[{"line_number":819,"context_line":"        \"\"\""},{"line_number":820,"context_line":""},{"line_number":821,"context_line":"        # check if the instance is not ACTIVE or has tasks"},{"line_number":822,"context_line":"        if self.db_info.server_status !\u003d InstanceStatus.ACTIVE:"},{"line_number":823,"context_line":"            status \u003d self.db_info.server_status"},{"line_number":824,"context_line":"        elif self.db_info.task_status !\u003d InstanceTasks.NONE:"},{"line_number":825,"context_line":"            status \u003d self.db_info.task_status.action"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAXH%2F%2FGVI%3D","line":822,"in_reply_to":"AAAAXH%2F%2FHVk%3D","updated":"2014-04-24 02:14:56.000000000","message":"I\u0027m not clear on how I can merge these methods together (I tried..) The existing method has this:\nself.db_info.task_status !\u003d InstanceTasks.RESTART_REQUIRED\nI explicity don\u0027t want that...thoughts?\n\nIt seemed like this way it is clear the methods are for different purposes.","commit_id":"8f7a86e50772de16707add92a807c8b98f9da1a6"},{"author":{"_account_id":5390,"name":"Steve Leon","username":"steve-leon","inactive":true},"change_message_id":"c78292fd7403c0e34062a2d7ded0283a95f2c4e5","unresolved":false,"context_lines":[{"line_number":819,"context_line":"        \"\"\""},{"line_number":820,"context_line":""},{"line_number":821,"context_line":"        # check if the instance is not ACTIVE or has tasks"},{"line_number":822,"context_line":"        if self.db_info.server_status !\u003d InstanceStatus.ACTIVE:"},{"line_number":823,"context_line":"            status \u003d self.db_info.server_status"},{"line_number":824,"context_line":"        elif self.db_info.task_status !\u003d InstanceTasks.NONE:"},{"line_number":825,"context_line":"            status \u003d self.db_info.task_status.action"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAXH%2F%2FHVk%3D","line":822,"in_reply_to":"AAAAXH%2F%2FHWM%3D","updated":"2014-04-23 22:28:09.000000000","message":"login\u003dlogic. Sorry about my bad typing","commit_id":"8f7a86e50772de16707add92a807c8b98f9da1a6"},{"author":{"_account_id":5390,"name":"Steve Leon","username":"steve-leon","inactive":true},"change_message_id":"b6766d00244df1e01c7653f5a69af8118a88b9f8","unresolved":false,"context_lines":[{"line_number":819,"context_line":"        \"\"\""},{"line_number":820,"context_line":""},{"line_number":821,"context_line":"        # check if the instance is not ACTIVE or has tasks"},{"line_number":822,"context_line":"        if self.db_info.server_status !\u003d InstanceStatus.ACTIVE:"},{"line_number":823,"context_line":"            status \u003d self.db_info.server_status"},{"line_number":824,"context_line":"        elif self.db_info.task_status !\u003d InstanceTasks.NONE:"},{"line_number":825,"context_line":"            status \u003d self.db_info.task_status.action"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAXH%2F%2FHWM%3D","line":822,"in_reply_to":"AAAAXH%2F%2FHaA%3D","updated":"2014-04-23 22:26:08.000000000","message":"Doh, i just realized that you probably knew about validate_can_perform_action() since it is the function above. However, maybe we should incorporate the \u0027configuration already assigned\u0027 login in that function since this new function is performing similar checks.","commit_id":"8f7a86e50772de16707add92a807c8b98f9da1a6"},{"author":{"_account_id":6156,"name":"Justin Hopper","email":"justin.hopper@hp.com","username":"justin-hopper"},"change_message_id":"76b0790fdeb9e16953fb3577d9ad72db2bd1a37c","unresolved":false,"context_lines":[{"line_number":833,"context_line":""},{"line_number":834,"context_line":"        raise exception.InvalidInstanceState("},{"line_number":835,"context_line":"            instance_id\u003dself.id,"},{"line_number":836,"context_line":"            status\u003dstatus)"},{"line_number":837,"context_line":""},{"line_number":838,"context_line":"    def unassign_configuration(self):"},{"line_number":839,"context_line":"        LOG.debug(_(\"Unassigning the configuration from the instance %s\")"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAXX%2F%2F%2Fyg%3D","line":836,"updated":"2014-04-24 18:54:11.000000000","message":"I know this logic is somewhat borrowed from above but I don\u0027t this the above is a good example.  Does the restructure below improve the readability.  One change is that the configuration is checked first.  However you could still move this block past the raise invalid status exception section\n\ndef _validate_can_perform_assign(self):\n        \"\"\"\n        Raises exception if a configuration assign cannot\n        currently be performed\n        \"\"\"\n        # check if the instance already has a configuration assigned\n        if self.db_info.configuration_id:\n            raise exception.ConfigurationAlreadyAssigned(\n                instance_id\u003dself.id,\n                configuration_id\u003dself.db_info.configuration_id)\n\n        # check if the instance is not ACTIVE or has tasks\n        status \u003d None\n        if self.db_info.server_status !\u003d InstanceStatus.ACTIVE:\n            status \u003d self.db_info.server_status\n        elif self.db_info.task_status !\u003d InstanceTasks.NONE:\n            status \u003d self.db_info.task_status.action\n\n        if status:\n            raise exception.InvalidInstanceState(instance_id\u003dself.id, \n                                                 status\u003dstatus)","commit_id":"8f7a86e50772de16707add92a807c8b98f9da1a6"},{"author":{"_account_id":9746,"name":"Doug Shelley","email":"dougshelley66@gmail.com","username":"dougshelley"},"change_message_id":"c93d792fdcbb9e91f861cdf357183f2c14dee35c","unresolved":false,"context_lines":[{"line_number":833,"context_line":""},{"line_number":834,"context_line":"        raise exception.InvalidInstanceState("},{"line_number":835,"context_line":"            instance_id\u003dself.id,"},{"line_number":836,"context_line":"            status\u003dstatus)"},{"line_number":837,"context_line":""},{"line_number":838,"context_line":"    def unassign_configuration(self):"},{"line_number":839,"context_line":"        LOG.debug(_(\"Unassigning the configuration from the instance %s\")"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAXX%2F%2F94A%3D","line":836,"in_reply_to":"AAAAXX%2F%2F%2Fyg%3D","updated":"2014-04-24 23:43:21.000000000","message":"Justin - thanks for the detailed feedback - I believe I have adjusted accordingly in the next patch set...definitely more readable.","commit_id":"8f7a86e50772de16707add92a807c8b98f9da1a6"},{"author":{"_account_id":5390,"name":"Steve Leon","username":"steve-leon","inactive":true},"change_message_id":"0775a5ff97bb4415a5aa19b389e59695a2127eea","unresolved":false,"context_lines":[{"line_number":845,"context_line":"            config_id \u003d self.configuration.id"},{"line_number":846,"context_line":"            LOG.debug(_(\"configuration being unassigned; \""},{"line_number":847,"context_line":"                        \"marking restart required\"))"},{"line_number":848,"context_line":"            self.update_db(task_status\u003dInstanceTasks.RESTART_REQUIRED)"},{"line_number":849,"context_line":"            task_api.API(self.context).unassign_configuration(self.id,"},{"line_number":850,"context_line":"                                                              flavor,"},{"line_number":851,"context_line":"                                                              config_id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAXH%2F%2FHYg%3D","line":848,"updated":"2014-04-23 22:20:07.000000000","message":"Instead of updating the status directly, use the InstanceServiceStatus.set_status.","commit_id":"8f7a86e50772de16707add92a807c8b98f9da1a6"},{"author":{"_account_id":5390,"name":"Steve Leon","username":"steve-leon","inactive":true},"change_message_id":"d83428ecc670f5c87a3b56a20d74d482b1bcab08","unresolved":false,"context_lines":[{"line_number":845,"context_line":"            config_id \u003d self.configuration.id"},{"line_number":846,"context_line":"            LOG.debug(_(\"configuration being unassigned; \""},{"line_number":847,"context_line":"                        \"marking restart required\"))"},{"line_number":848,"context_line":"            self.update_db(task_status\u003dInstanceTasks.RESTART_REQUIRED)"},{"line_number":849,"context_line":"            task_api.API(self.context).unassign_configuration(self.id,"},{"line_number":850,"context_line":"                                                              flavor,"},{"line_number":851,"context_line":"                                                              config_id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAXH%2F%2FA8k%3D","line":848,"in_reply_to":"AAAAXH%2F%2FGTY%3D","updated":"2014-04-24 16:42:19.000000000","message":"You are right. I thought it was sevicestatus.","commit_id":"8f7a86e50772de16707add92a807c8b98f9da1a6"},{"author":{"_account_id":9746,"name":"Doug Shelley","email":"dougshelley66@gmail.com","username":"dougshelley"},"change_message_id":"59bcb77add8b0b70c36528e9e94a609a6df71230","unresolved":false,"context_lines":[{"line_number":845,"context_line":"            config_id \u003d self.configuration.id"},{"line_number":846,"context_line":"            LOG.debug(_(\"configuration being unassigned; \""},{"line_number":847,"context_line":"                        \"marking restart required\"))"},{"line_number":848,"context_line":"            self.update_db(task_status\u003dInstanceTasks.RESTART_REQUIRED)"},{"line_number":849,"context_line":"            task_api.API(self.context).unassign_configuration(self.id,"},{"line_number":850,"context_line":"                                                              flavor,"},{"line_number":851,"context_line":"                                                              config_id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAXH%2F%2FGTY%3D","line":848,"in_reply_to":"AAAAXH%2F%2FHYg%3D","updated":"2014-04-24 02:14:56.000000000","message":"You are referring to the ServiceStatus - I believe I\u0027m trying to set the Task Status - aren\u0027t they different?","commit_id":"8f7a86e50772de16707add92a807c8b98f9da1a6"},{"author":{"_account_id":5390,"name":"Steve Leon","username":"steve-leon","inactive":true},"change_message_id":"e7fefc1cc2c49871914b733149c85b0c27d24f6e","unresolved":false,"context_lines":[{"line_number":832,"context_line":""},{"line_number":833,"context_line":"        if status:"},{"line_number":834,"context_line":"            raise exception.InvalidInstanceState(instance_id\u003dself.id,"},{"line_number":835,"context_line":"                                                 status\u003dstatus)"},{"line_number":836,"context_line":""},{"line_number":837,"context_line":"    def unassign_configuration(self):"},{"line_number":838,"context_line":"        LOG.debug(_(\"Unassigning the configuration from the instance %s\")"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAXX%2F%2F9uI%3D","line":835,"updated":"2014-04-25 00:24:55.000000000","message":"The indentation doesnt seem aligned. Does this pass pep8 tests?","commit_id":"6e8a092bdbd8fd83e4eca3516a9d10ad07efd70d"},{"author":{"_account_id":6156,"name":"Justin Hopper","email":"justin.hopper@hp.com","username":"justin-hopper"},"change_message_id":"843c82f078b281466208ea26117ce142277e33a4","unresolved":false,"context_lines":[{"line_number":832,"context_line":""},{"line_number":833,"context_line":"        if status:"},{"line_number":834,"context_line":"            raise exception.InvalidInstanceState(instance_id\u003dself.id,"},{"line_number":835,"context_line":"                                                 status\u003dstatus)"},{"line_number":836,"context_line":""},{"line_number":837,"context_line":"    def unassign_configuration(self):"},{"line_number":838,"context_line":"        LOG.debug(_(\"Unassigning the configuration from the instance %s\")"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAXX%2F%2F9ms%3D","line":835,"in_reply_to":"AAAAXX%2F%2F9rk%3D","updated":"2014-04-25 00:48:29.000000000","message":"i\u0027ve seen this before - perhaps there is a tab in there perhaps it\u0027s just gerrit being funky","commit_id":"6e8a092bdbd8fd83e4eca3516a9d10ad07efd70d"},{"author":{"_account_id":9746,"name":"Doug Shelley","email":"dougshelley66@gmail.com","username":"dougshelley"},"change_message_id":"1fd8e4b83e0b8e2a07e6b80a3a2d5d970b899f3e","unresolved":false,"context_lines":[{"line_number":832,"context_line":""},{"line_number":833,"context_line":"        if status:"},{"line_number":834,"context_line":"            raise exception.InvalidInstanceState(instance_id\u003dself.id,"},{"line_number":835,"context_line":"                                                 status\u003dstatus)"},{"line_number":836,"context_line":""},{"line_number":837,"context_line":"    def unassign_configuration(self):"},{"line_number":838,"context_line":"        LOG.debug(_(\"Unassigning the configuration from the instance %s\")"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAXX%2F%2F9rk%3D","line":835,"in_reply_to":"AAAAXX%2F%2F9uI%3D","updated":"2014-04-25 00:33:14.000000000","message":"I ran tox -epep8 before i pushed it up. When i look at that line in PyCharm it is lined up below the \"instance_id\u003d...\"","commit_id":"6e8a092bdbd8fd83e4eca3516a9d10ad07efd70d"},{"author":{"_account_id":9664,"name":"amrith","email":"amrith.kumar@gmail.com","username":"amrith"},"change_message_id":"6f44b173fc99146dabba017ea7cb2969a5600aec","unresolved":false,"context_lines":[{"line_number":812,"context_line":"        LOG.error(msg)"},{"line_number":813,"context_line":"        raise exception.UnprocessableEntity(msg)"},{"line_number":814,"context_line":""},{"line_number":815,"context_line":"    def _validate_can_perform_assign(self):"},{"line_number":816,"context_line":"        \"\"\""},{"line_number":817,"context_line":"        Raises exception if a configuration assign cannot"},{"line_number":818,"context_line":"        currently be performed"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAXX%2F%2FyAg%3D","line":815,"updated":"2014-04-27 21:50:40.000000000","message":"to be consistent with Auston\u0027s earlier comment, I\u0027d use the word attach here instead of assign. similar things for the comments below.","commit_id":"050b5528cd13046b36a3f27c8ab7904378de2000"},{"author":{"_account_id":6156,"name":"Justin Hopper","email":"justin.hopper@hp.com","username":"justin-hopper"},"change_message_id":"ee4d82af7856170a2b6a832410f6c7c2385989b8","unresolved":false,"context_lines":[{"line_number":812,"context_line":"        LOG.error(msg)"},{"line_number":813,"context_line":"        raise exception.UnprocessableEntity(msg)"},{"line_number":814,"context_line":""},{"line_number":815,"context_line":"    def _validate_can_perform_assign(self):"},{"line_number":816,"context_line":"        \"\"\""},{"line_number":817,"context_line":"        Raises exception if a configuration assign cannot"},{"line_number":818,"context_line":"        currently be performed"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAXX%2F%2FxqE%3D","line":815,"in_reply_to":"AAAAXX%2F%2FyAg%3D","updated":"2014-04-28 06:20:55.000000000","message":"to be fair - in that discussion auston said attach for publicly facing api and attach or assign internally.  since this is a private function it is ok as it is.","commit_id":"050b5528cd13046b36a3f27c8ab7904378de2000"}]}
