)]}'
{"openstack/tests/functional/instance_ha/test_host.py":[{"author":{"_account_id":2,"name":"Monty Taylor","email":"mordred@inaugust.com","username":"mordred"},"change_message_id":"46e444b97b8e0123724cb8cca88b85731c63ac81","unresolved":false,"context_lines":[{"line_number":34,"context_line":"class TestHost(base.BaseFunctionalTest):"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    @classmethod"},{"line_number":37,"context_line":"    @testtools.skipIf(not hypervisors(),"},{"line_number":38,"context_line":"                      \"Skip TestHost as there are no hypervisors configured \""},{"line_number":39,"context_line":"                      \"in nova\")"},{"line_number":40,"context_line":"    def setUpClass(cls):"},{"line_number":41,"context_line":"        pass"},{"line_number":42,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_9692ba9f","line":39,"range":{"start_line":37,"start_character":0,"end_line":39,"end_character":32},"updated":"2018-11-06 14:17:23.000000000","message":"Let\u0027s move this to the setUp method and get rid of setUpClass. Also - instead of @testtools.skipIf - you can just do:\n\n  if not hypervisors():\n    self.skipTest(\"Skipping as there are no hypervisors\")\n\nThis also allows writing hypervisors as a method on the class that has access to self.conn already.\n\nWe should also add another skipTest:\n\n  if not self.conn.has_service(\u0027instance-ha\u0027):\n    self.skipTest(\u0027Skipping as there is no instance-ha servce\u0027)","commit_id":"92b4159c5c78d7f7064d7c9c31b122db5a410a90"},{"author":{"_account_id":2,"name":"Monty Taylor","email":"mordred@inaugust.com","username":"mordred"},"change_message_id":"7477f052bb3bb0f14463a522264d83c41925907a","unresolved":false,"context_lines":[{"line_number":34,"context_line":"class TestHost(base.BaseFunctionalTest):"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    @classmethod"},{"line_number":37,"context_line":"    @testtools.skipIf(not hypervisors(),"},{"line_number":38,"context_line":"                      \"Skip TestHost as there are no hypervisors configured \""},{"line_number":39,"context_line":"                      \"in nova\")"},{"line_number":40,"context_line":"    def setUpClass(cls):"},{"line_number":41,"context_line":"        pass"},{"line_number":42,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_961cfa14","line":39,"range":{"start_line":37,"start_character":0,"end_line":39,"end_character":32},"in_reply_to":"3f79a3b5_9692ba9f","updated":"2018-11-06 14:21:07.000000000","message":"Or even, instead of that:\n\n  self.require_service(\u0027instance-ha\u0027)","commit_id":"92b4159c5c78d7f7064d7c9c31b122db5a410a90"},{"author":{"_account_id":2,"name":"Monty Taylor","email":"mordred@inaugust.com","username":"mordred"},"change_message_id":"46e444b97b8e0123724cb8cca88b85731c63ac81","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        super(TestHost, self).setUp()"},{"line_number":45,"context_line":"        self.NAME \u003d self.getUniqueString()"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        self.conn \u003d connection.from_config("},{"line_number":48,"context_line":"            cloud_name\u003dbase.TEST_CLOUD_NAME)"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"        # Create segment"},{"line_number":51,"context_line":"        self.segment \u003d self.conn.ha.create_segment("}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_16e46a41","line":48,"range":{"start_line":47,"start_character":0,"end_line":48,"end_character":44},"updated":"2018-11-06 14:17:23.000000000","message":"This is already taken care of in the base class - no need to do it here.","commit_id":"92b4159c5c78d7f7064d7c9c31b122db5a410a90"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"6fea6e8dcddb0ca5662f4710f293a78ace79c042","unresolved":false,"context_lines":[{"line_number":25,"context_line":"    global HYPERVISORS"},{"line_number":26,"context_line":"    HYPERVISORS \u003d _OpenStackCloudMixin.list_hypervisors("},{"line_number":27,"context_line":"        connection.from_config(cloud_name\u003dbase.TEST_CLOUD_NAME))"},{"line_number":28,"context_line":"    if HYPERVISORS:"},{"line_number":29,"context_line":"        return True"},{"line_number":30,"context_line":"    return False"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_dcccc160","line":29,"range":{"start_line":28,"start_character":4,"end_line":29,"end_character":19},"updated":"2018-11-23 09:45:52.000000000","message":"this can be moved above L26, then You will list_hypervisors only if list is empty and use cached list if it was already taken from server","commit_id":"63f7b638ea3bcd1902b2ba642ca5fd9025d91f90"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"c55ee05ec9295905975f9be749c97383e95a7473","unresolved":false,"context_lines":[{"line_number":25,"context_line":"    global HYPERVISORS"},{"line_number":26,"context_line":"    HYPERVISORS \u003d _OpenStackCloudMixin.list_hypervisors("},{"line_number":27,"context_line":"        connection.from_config(cloud_name\u003dbase.TEST_CLOUD_NAME))"},{"line_number":28,"context_line":"    if HYPERVISORS:"},{"line_number":29,"context_line":"        return True"},{"line_number":30,"context_line":"    return False"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_f790b699","line":29,"range":{"start_line":28,"start_character":4,"end_line":29,"end_character":19},"in_reply_to":"3f79a3b5_dcccc160","updated":"2018-11-23 10:09:31.000000000","message":"You can do something like:\n\n    def hypervisors():\n        global HYPERVISORS\n        if HYPERVISORS:\n            return True\n        HYPERVISORS \u003d _OpenStackCloudMixin.list_hypervisors(\n            connection.from_config(cloud_name\u003dbase.TEST_CLOUD_NAME))\n        return bool(HYPERVISORS)","commit_id":"63f7b638ea3bcd1902b2ba642ca5fd9025d91f90"}],"openstack/tests/functional/instance_ha/test_segment.py":[{"author":{"_account_id":2,"name":"Monty Taylor","email":"mordred@inaugust.com","username":"mordred"},"change_message_id":"46e444b97b8e0123724cb8cca88b85731c63ac81","unresolved":false,"context_lines":[{"line_number":22,"context_line":"    def setUp(self):"},{"line_number":23,"context_line":"        super(TestSegment, self).setUp()"},{"line_number":24,"context_line":"        self.NAME \u003d self.getUniqueString()"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"        self.conn \u003d connection.from_config("},{"line_number":27,"context_line":"            cloud_name\u003dbase.TEST_CLOUD_NAME)"},{"line_number":28,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_76da7e76","line":25,"updated":"2018-11-06 14:17:23.000000000","message":"Should add a skipTest for not having instance-ha service.","commit_id":"92b4159c5c78d7f7064d7c9c31b122db5a410a90"},{"author":{"_account_id":2,"name":"Monty Taylor","email":"mordred@inaugust.com","username":"mordred"},"change_message_id":"7477f052bb3bb0f14463a522264d83c41925907a","unresolved":false,"context_lines":[{"line_number":22,"context_line":"    def setUp(self):"},{"line_number":23,"context_line":"        super(TestSegment, self).setUp()"},{"line_number":24,"context_line":"        self.NAME \u003d self.getUniqueString()"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"        self.conn \u003d connection.from_config("},{"line_number":27,"context_line":"            cloud_name\u003dbase.TEST_CLOUD_NAME)"},{"line_number":28,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_5612e2ff","line":25,"in_reply_to":"3f79a3b5_76da7e76","updated":"2018-11-06 14:21:07.000000000","message":"Or even, instead of that:\n\n  self.require_service(\u0027instance-ha\u0027)","commit_id":"92b4159c5c78d7f7064d7c9c31b122db5a410a90"},{"author":{"_account_id":2,"name":"Monty Taylor","email":"mordred@inaugust.com","username":"mordred"},"change_message_id":"46e444b97b8e0123724cb8cca88b85731c63ac81","unresolved":false,"context_lines":[{"line_number":23,"context_line":"        super(TestSegment, self).setUp()"},{"line_number":24,"context_line":"        self.NAME \u003d self.getUniqueString()"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"        self.conn \u003d connection.from_config("},{"line_number":27,"context_line":"            cloud_name\u003dbase.TEST_CLOUD_NAME)"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"        # Create segment"},{"line_number":30,"context_line":"        self.segment \u003d self.conn.ha.create_segment("}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_d6e91218","line":27,"range":{"start_line":26,"start_character":0,"end_line":27,"end_character":44},"updated":"2018-11-06 14:17:23.000000000","message":"No need for this.","commit_id":"92b4159c5c78d7f7064d7c9c31b122db5a410a90"}]}
