)]}'
{"watcher/common/nova_helper.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a899569317156f2aa555c4ae59e2997a5c821f64","unresolved":false,"context_lines":[{"line_number":48,"context_line":"    def get_compute_node_list(self):"},{"line_number":49,"context_line":"        return self.nova.hypervisors.list()"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def get_compute_node_by_id(self, node_id):"},{"line_number":52,"context_line":"        \"\"\"Get compute node by ID (*not* UUID)\"\"\""},{"line_number":53,"context_line":"        # We need to pass an object with an \u0027id\u0027 attribute to make it work"},{"line_number":54,"context_line":"        return self.nova.hypervisors.get(utils.Struct(id\u003dnode_id))"}],"source_content_type":"text/x-python","patch_set":1,"id":"bfb3d3c7_6243b7b0","line":51,"updated":"2019-05-24 14:58:12.000000000","message":"Note that I\u0027m removing this method in this change since it\u0027s no longer used:\n\nhttps://review.opendev.org/#/c/661121/2/watcher/common/nova_helper.py\n\nDo you need to get a hypervisor (compute node) by id for something in the grafana proxy datasource series?","commit_id":"dc32633111821148e3f7bdb7917ac9705afbbbcc"},{"author":{"_account_id":29911,"name":"Dantali0n","email":"info@dantalion.nl","username":"Dantali0n"},"change_message_id":"1aba326ce90d11a3236dbfdd0d90a3a12c759d85","unresolved":false,"context_lines":[{"line_number":48,"context_line":"    def get_compute_node_list(self):"},{"line_number":49,"context_line":"        return self.nova.hypervisors.list()"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def get_compute_node_by_id(self, node_id):"},{"line_number":52,"context_line":"        \"\"\"Get compute node by ID (*not* UUID)\"\"\""},{"line_number":53,"context_line":"        # We need to pass an object with an \u0027id\u0027 attribute to make it work"},{"line_number":54,"context_line":"        return self.nova.hypervisors.get(utils.Struct(id\u003dnode_id))"}],"source_content_type":"text/x-python","patch_set":1,"id":"bfb3d3c7_628df7d1","line":51,"in_reply_to":"bfb3d3c7_6243b7b0","updated":"2019-05-24 15:08:18.000000000","message":"Yes the Grafana datasource will need it until the new datasource interface is merged as it passes the entire hypervisor / instance objects to the translator because the uuid is very likely not the key that is used to store it with in Grafana. With the new datasource interface merged the entire object will be passed and the object no longer needs to be retrieved.","commit_id":"dc32633111821148e3f7bdb7917ac9705afbbbcc"},{"author":{"_account_id":29911,"name":"Dantali0n","email":"info@dantalion.nl","username":"Dantali0n"},"change_message_id":"f5e3ea8c411f46df85a77cb3de8b67359f9e10bc","unresolved":false,"context_lines":[{"line_number":48,"context_line":"    def get_compute_node_list(self):"},{"line_number":49,"context_line":"        return self.nova.hypervisors.list()"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def get_compute_node_by_id(self, node_id):"},{"line_number":52,"context_line":"        \"\"\"Get compute node by ID (*not* UUID)\"\"\""},{"line_number":53,"context_line":"        # We need to pass an object with an \u0027id\u0027 attribute to make it work"},{"line_number":54,"context_line":"        return self.nova.hypervisors.get(utils.Struct(id\u003dnode_id))"}],"source_content_type":"text/x-python","patch_set":1,"id":"bfb3d3c7_b5da4748","line":51,"in_reply_to":"bfb3d3c7_628df7d1","updated":"2019-05-29 06:20:52.000000000","message":"Turns out in the end I made Grafana call nova.hypervisors.get without the helper since it no longer going to be necessary anymore anyway once the datasource interface merges.","commit_id":"dc32633111821148e3f7bdb7917ac9705afbbbcc"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6dc19ced7c18cba253ef746098652b0359c81561","unresolved":false,"context_lines":[{"line_number":48,"context_line":"    def get_compute_node_list(self):"},{"line_number":49,"context_line":"        return self.nova.hypervisors.list()"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def get_compute_node_by_id(self, node_id):"},{"line_number":52,"context_line":"        \"\"\"Get compute node by ID (*not* UUID)\"\"\""},{"line_number":53,"context_line":"        # We need to pass an object with an \u0027id\u0027 attribute to make it work"},{"line_number":54,"context_line":"        return self.nova.hypervisors.get(utils.Struct(id\u003dnode_id))"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"    def get_compute_node_by_uuid(self, node_uuid):"},{"line_number":57,"context_line":"        \"\"\"Get compute node by UUID\"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"bfb3d3c7_220dbfa0","line":54,"range":{"start_line":51,"start_character":4,"end_line":54,"end_character":66},"updated":"2019-05-24 14:56:43.000000000","message":"This is actually the same thing despite the docstring. When you\u0027ve gotten a Hypervisor object using microversion \u003e\u003d 2.53 (which we\u0027re doing by default because nova_client.api_version defaults to 2.56 and soon will be the minimum required version), the Hypervisor.id is a uuid:\n\nhttps://developer.openstack.org/api-ref/compute/?expanded\u003dlist-hypervisors-detail#list-hypervisors\n\nSo you can just use this method rather than add a new one.\n\nAlso note that Struct thing above isn\u0027t necessary either, the novaclient code will handle passing an id attribute or the full object:\n\nhttps://github.com/openstack/python-novaclient/blob/14.0.0/novaclient/v2/hypervisors.py#L108\n\nhttps://github.com/openstack/python-novaclient/blob/14.0.0/novaclient/base.py#L38","commit_id":"dc32633111821148e3f7bdb7917ac9705afbbbcc"},{"author":{"_account_id":29911,"name":"Dantali0n","email":"info@dantalion.nl","username":"Dantali0n"},"change_message_id":"1aba326ce90d11a3236dbfdd0d90a3a12c759d85","unresolved":false,"context_lines":[{"line_number":48,"context_line":"    def get_compute_node_list(self):"},{"line_number":49,"context_line":"        return self.nova.hypervisors.list()"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def get_compute_node_by_id(self, node_id):"},{"line_number":52,"context_line":"        \"\"\"Get compute node by ID (*not* UUID)\"\"\""},{"line_number":53,"context_line":"        # We need to pass an object with an \u0027id\u0027 attribute to make it work"},{"line_number":54,"context_line":"        return self.nova.hypervisors.get(utils.Struct(id\u003dnode_id))"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"    def get_compute_node_by_uuid(self, node_uuid):"},{"line_number":57,"context_line":"        \"\"\"Get compute node by UUID\"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"bfb3d3c7_a25e8f41","line":54,"range":{"start_line":51,"start_character":4,"end_line":54,"end_character":66},"in_reply_to":"bfb3d3c7_220dbfa0","updated":"2019-05-24 15:08:18.000000000","message":"I\u0027ll update Grafana to use the other method.","commit_id":"dc32633111821148e3f7bdb7917ac9705afbbbcc"}]}
