)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"a5c3fe49f5ffc20537e26e0a7e50d052f2c7b53b","unresolved":false,"context_lines":[{"line_number":9,"context_line":"The state of a node should only be considered when calculating"},{"line_number":10,"context_line":"resources, not when determining availability.  This makes the driver"},{"line_number":11,"context_line":"consider any node that exists in the node inventory as available, and"},{"line_number":12,"context_line":"takes into account its state when determining available resources. Nodes"},{"line_number":13,"context_line":"that do not have an instance association but are in maintenance mode"},{"line_number":14,"context_line":"or powered on will be available to Nova, but present zero resources."},{"line_number":15,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"AAAAXH%2F%2FEmQ%3D","line":12,"updated":"2014-04-24 09:07:35.000000000","message":"maybe s/takes/take/ (i.e. makes the driver consider.... and take...)","commit_id":"962fec6aa940b777ffaf9a6437af4b0c8061fd34"}],"etc/ironic/ironic.conf.sample":[{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"241f3567f09056928942d33904faec4fd1afec1e","unresolved":false,"context_lines":[{"line_number":678,"context_line":"# Options defined in keystoneclient.middleware.auth_token"},{"line_number":679,"context_line":"#"},{"line_number":680,"context_line":""},{"line_number":681,"context_line":"# Prefix to prepend at the beginning of the path. Deprecated,"},{"line_number":682,"context_line":"# use identity_uri. (string value)"},{"line_number":683,"context_line":"#auth_admin_prefix\u003d"},{"line_number":684,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":1,"id":"AAAAXH%2F%2Frsw%3D","side":"PARENT","line":681,"updated":"2014-04-18 09:10:13.000000000","message":"This conf is already fixed in trunk and not related to this change","commit_id":"6dd05db304789a434d83d74b944251bd78d81552"}],"ironic/nova/tests/virt/ironic/test_driver.py":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"a5c3fe49f5ffc20537e26e0a7e50d052f2c7b53b","unresolved":false,"context_lines":[{"line_number":253,"context_line":"        mock_unavail \u003d mock.patch.object(self.driver, \u0027_node_unavailable\u0027)"},{"line_number":254,"context_line":"        mock_unavail \u003d mock_unavail.start()"},{"line_number":255,"context_line":"        mock_unavail.return_value \u003d True"},{"line_number":256,"context_line":"        self.addCleanup(mock_unavail.stop)"},{"line_number":257,"context_line":""},{"line_number":258,"context_line":"        result \u003d self.driver._node_resource(node)"},{"line_number":259,"context_line":"        self.assertEqual(0, result[\u0027vcpus\u0027])"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAXH%2F%2FEWw%3D","line":256,"updated":"2014-04-24 09:07:35.000000000","message":"Please use either decorator (preferred) or context manager here","commit_id":"962fec6aa940b777ffaf9a6437af4b0c8061fd34"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"5c94db8a9b3921f2fae82f80f1b68ecdb1851b57","unresolved":false,"context_lines":[{"line_number":253,"context_line":"        mock_unavail \u003d mock.patch.object(self.driver, \u0027_node_unavailable\u0027)"},{"line_number":254,"context_line":"        mock_unavail \u003d mock_unavail.start()"},{"line_number":255,"context_line":"        mock_unavail.return_value \u003d True"},{"line_number":256,"context_line":"        self.addCleanup(mock_unavail.stop)"},{"line_number":257,"context_line":""},{"line_number":258,"context_line":"        result \u003d self.driver._node_resource(node)"},{"line_number":259,"context_line":"        self.assertEqual(0, result[\u0027vcpus\u0027])"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAXH%2F%2FD%2FI%3D","line":256,"in_reply_to":"AAAAXH%2F%2FEL8%3D","updated":"2014-04-24 09:42:52.000000000","message":"@mock.patch.object(ironic_driver.IronicDriver, ...)\n\nworks in 99% cases. And maybe I\u0027m biased, but I really against using 4 vague lines instead of 1-2 explicit.","commit_id":"962fec6aa940b777ffaf9a6437af4b0c8061fd34"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"ee3130949b433fa22d03a8cc5c7319c1c6ce0c79","unresolved":false,"context_lines":[{"line_number":253,"context_line":"        mock_unavail \u003d mock.patch.object(self.driver, \u0027_node_unavailable\u0027)"},{"line_number":254,"context_line":"        mock_unavail \u003d mock_unavail.start()"},{"line_number":255,"context_line":"        mock_unavail.return_value \u003d True"},{"line_number":256,"context_line":"        self.addCleanup(mock_unavail.stop)"},{"line_number":257,"context_line":""},{"line_number":258,"context_line":"        result \u003d self.driver._node_resource(node)"},{"line_number":259,"context_line":"        self.assertEqual(0, result[\u0027vcpus\u0027])"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAXH%2F%2FEL8%3D","line":256,"in_reply_to":"AAAAXH%2F%2FEWw%3D","updated":"2014-04-24 09:20:15.000000000","message":"I don\u0027t think it\u0027s possible to decorate self.driver, cause the evaluation of the decorator will happen before the variable self.driver is created.\n\nNow using:\n\nwith mock.patch.object(self.driver,  \u0027_node_unavailable\u0027) as mock_unavail:\n   ....\n\nWould do be preferable imo. But I wouldn\u0027t -1 for it.","commit_id":"962fec6aa940b777ffaf9a6437af4b0c8061fd34"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"a5c3fe49f5ffc20537e26e0a7e50d052f2c7b53b","unresolved":false,"context_lines":[{"line_number":324,"context_line":""},{"line_number":325,"context_line":"    def test__node_unavailable(self):"},{"line_number":326,"context_line":"        node_dicts \u003d ["},{"line_number":327,"context_line":"            # a node /w no instance and power ON"},{"line_number":328,"context_line":"            {\u0027uuid\u0027: uuidutils.generate_uuid(),"},{"line_number":329,"context_line":"             \u0027instance_uuid\u0027: uuidutils.generate_uuid(),"},{"line_number":330,"context_line":"             \u0027power_state\u0027: ironic_states.POWER_ON},"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAXH%2F%2FEV0%3D","line":327,"updated":"2014-04-24 09:07:35.000000000","message":"This comments says \"no instance\", but instance uuid is assigned on line 329. Your probably wanted \"with instance and POWER_OFF\" actually.","commit_id":"962fec6aa940b777ffaf9a6437af4b0c8061fd34"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"a5c3fe49f5ffc20537e26e0a7e50d052f2c7b53b","unresolved":false,"context_lines":[{"line_number":386,"context_line":"        expected \u003d [n.uuid for n in nodes if n.power_state]"},{"line_number":387,"context_line":"        available_nodes \u003d self.driver.get_available_nodes()"},{"line_number":388,"context_line":"        self.assertEqual(sorted(expected), sorted(available_nodes))"},{"line_number":389,"context_line":"        self.assertEqual(len(expected), len(available_nodes))"},{"line_number":390,"context_line":""},{"line_number":391,"context_line":"    def test_get_available_resource(self):"},{"line_number":392,"context_line":"        node \u003d ironic_utils.get_test_node()"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAXH%2F%2FEUw%3D","line":389,"updated":"2014-04-24 09:07:35.000000000","message":"Why having this check? Check on line 388 should be enough","commit_id":"962fec6aa940b777ffaf9a6437af4b0c8061fd34"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"919811a05224b33502651fe7a72de88cc63f21ae","unresolved":false,"context_lines":[{"line_number":329,"context_line":"            {\u0027uuid\u0027: uuidutils.generate_uuid(),"},{"line_number":330,"context_line":"             \u0027maintenance\u0027: True,"},{"line_number":331,"context_line":"             \u0027power_state\u0027: ironic_states.POWER_OFF},"},{"line_number":332,"context_line":"            # a node in maintenance /w no instance and power ON"},{"line_number":333,"context_line":"            {\u0027uuid\u0027: uuidutils.generate_uuid(),"},{"line_number":334,"context_line":"             \u0027maintenance\u0027: True,"},{"line_number":335,"context_line":"             \u0027power_state\u0027: ironic_states.POWER_ON},"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAXX%2F%2F5gU%3D","line":332,"updated":"2014-04-25 13:11:41.000000000","message":"If node is in maintenance, it will be unavailable, no matter what power state. Maybe you meant \"no maintenance, no instance, power ON\" here?","commit_id":"6bf4571d87bd603613fa859de70c2e086c2c457d"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"be500e7a05ddfee4cb43625173ac5a96330c3c3a","unresolved":false,"context_lines":[{"line_number":326,"context_line":"            {\u0027uuid\u0027: uuidutils.generate_uuid(),"},{"line_number":327,"context_line":"             \u0027maintenance\u0027: True,"},{"line_number":328,"context_line":"             \u0027power_state\u0027: ironic_states.POWER_OFF},"},{"line_number":329,"context_line":"            # a node in maintenance /w no instance and ERROR power state"},{"line_number":330,"context_line":"            {\u0027uuid\u0027: uuidutils.generate_uuid(),"},{"line_number":331,"context_line":"             \u0027maintenance\u0027: True,"},{"line_number":332,"context_line":"             \u0027power_state\u0027: ironic_states.ERROR},"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad9bd40_c2acc438","line":329,"updated":"2014-04-29 23:30:28.000000000","message":"I think it might be worth testing a node that is NOT in maintenance with a bad power state. Eg, change this or add another one: \n{\u0027uuid\u0027: uuidutils.generate_uuid(),\n \u0027maintenance\u0027: False,\n \u0027power_state\u0027: ironic_states.NOSTATE}","commit_id":"a147feadd8f8136efb9969241dbc2ca7bb8e437e"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"be500e7a05ddfee4cb43625173ac5a96330c3c3a","unresolved":false,"context_lines":[{"line_number":342,"context_line":"    @mock.patch.object(FAKE_CLIENT.node, \u0027list\u0027)"},{"line_number":343,"context_line":"    def test_get_available_nodes(self, mock_list):"},{"line_number":344,"context_line":"        node_uuids \u003d [uuidutils.generate_uuid() for i in range(0, 5)]"},{"line_number":345,"context_line":"        nodes \u003d [ironic_utils.get_test_node(uuid\u003du) for u in node_uuids]"},{"line_number":346,"context_line":"        mock_list.return_value \u003d nodes"},{"line_number":347,"context_line":"        available_nodes \u003d self.driver.get_available_nodes()"},{"line_number":348,"context_line":"        self.assertEqual(sorted(node_uuids), sorted(available_nodes))"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad9bd40_4236f404","line":345,"updated":"2014-04-29 23:30:28.000000000","message":"It might be useful to use nodes that are similar to the original test. Ie, nodes in different maintenance and power states, to show that regardless of that, they are returned.\n\nuseful \u003d\u003d if someone changes the code later to only return some of them, this would fail ;)","commit_id":"a147feadd8f8136efb9969241dbc2ca7bb8e437e"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"0614a813fbde818aa5423ffe8c2e053db9b35bda","unresolved":false,"context_lines":[{"line_number":333,"context_line":"             \u0027power_state\u0027: ironic_states.ERROR},"},{"line_number":334,"context_line":"            # a node not in maintenance /w no instance and bad power state"},{"line_number":335,"context_line":"            {\u0027uuid\u0027: uuidutils.generate_uuid(),"},{"line_number":336,"context_line":"             \u0027maintenance\u0027: True,"},{"line_number":337,"context_line":"             \u0027power_state\u0027: ironic_states.NOSTATE},"},{"line_number":338,"context_line":"        ]"},{"line_number":339,"context_line":"        for n in node_dicts:"}],"source_content_type":"text/x-python","patch_set":7,"id":"9ad9bd40_91ed6428","line":336,"updated":"2014-05-02 12:42:39.000000000","message":"comment says `not in maintenance`, but `\u0027maintenance\u0027: True`","commit_id":"b6dd31256167fdc6f91f1b23f993810dd9800d52"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"0614a813fbde818aa5423ffe8c2e053db9b35bda","unresolved":false,"context_lines":[{"line_number":357,"context_line":"             \u0027power_state\u0027: ironic_states.POWER_ON},"},{"line_number":358,"context_line":"            # a node not in maintenance /w no instance and bad power state"},{"line_number":359,"context_line":"            {\u0027uuid\u0027: uuidutils.generate_uuid(),"},{"line_number":360,"context_line":"             \u0027maintenance\u0027: True,"},{"line_number":361,"context_line":"             \u0027power_state\u0027: ironic_states.ERROR},"},{"line_number":362,"context_line":"        ]"},{"line_number":363,"context_line":"        nodes \u003d [ironic_utils.get_test_node(**n) for n in node_dicts]"}],"source_content_type":"text/x-python","patch_set":7,"id":"9ad9bd40_d1f7ecf3","line":360,"updated":"2014-05-02 12:42:39.000000000","message":"ditto","commit_id":"b6dd31256167fdc6f91f1b23f993810dd9800d52"}],"ironic/nova/virt/ironic/driver.py":[{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"241f3567f09056928942d33904faec4fd1afec1e","unresolved":false,"context_lines":[{"line_number":200,"context_line":""},{"line_number":201,"context_line":"    def _node_unavailable(self, node_obj):"},{"line_number":202,"context_line":"        return (node_obj.maintenance or"},{"line_number":203,"context_line":"                node_obj.power_state \u003d\u003d ironic_states.POWER_ON)"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"    def _node_resource(self, node):"},{"line_number":206,"context_line":"        \"\"\"Helper method to create resource dict from node stats.\"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAXH%2F%2FrtA%3D","line":203,"updated":"2014-04-18 09:10:13.000000000","message":"I think we need to check for ERROR state as well, we probably don\u0027t want to say a node is available if it does have an ERROR power state.\n\nreturn (node_obj.maintenance or\n          node_obj.power_state not in (ironic_states.POWER_ON,\n                                                    ironic_states.ERROR))","commit_id":"9b9e04b529b07b3d12262c644e8ab9ae8bd2984f"},{"author":{"_account_id":1420,"name":"Adam Gandelman","email":"adamg@ubuntu.com","username":"gandelman-a"},"change_message_id":"1211c10d5a1a24e0b20ddc25bd5a08f2195ce81f","unresolved":false,"context_lines":[{"line_number":200,"context_line":""},{"line_number":201,"context_line":"    def _node_unavailable(self, node_obj):"},{"line_number":202,"context_line":"        return (node_obj.maintenance or"},{"line_number":203,"context_line":"                node_obj.power_state \u003d\u003d ironic_states.POWER_ON)"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"    def _node_resource(self, node):"},{"line_number":206,"context_line":"        \"\"\"Helper method to create resource dict from node stats.\"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAXH%2F%2Fn3U%3D","line":203,"in_reply_to":"AAAAXH%2F%2FoW0%3D","updated":"2014-04-18 19:08:53.000000000","message":"Should nodes /w ironic_states.POWER_ON be ready for use by Nova in all cases, or only when the agent is in use?  Would it even be possible to do the following from the nova driver side?\n\nbad_states \u003d [ironic_states.NOSTATE, ironic_states.ERROR]\nif not using_agent():\n    bad_states.append(ironic_states.POWER_ON)","commit_id":"9b9e04b529b07b3d12262c644e8ab9ae8bd2984f"},{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"14a62469cbd014351006d4ad0f0f02def336a6fd","unresolved":false,"context_lines":[{"line_number":200,"context_line":""},{"line_number":201,"context_line":"    def _node_unavailable(self, node_obj):"},{"line_number":202,"context_line":"        return (node_obj.maintenance or"},{"line_number":203,"context_line":"                node_obj.power_state \u003d\u003d ironic_states.POWER_ON)"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"    def _node_resource(self, node):"},{"line_number":206,"context_line":"        \"\"\"Helper method to create resource dict from node stats.\"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAXH%2F%2FoW0%3D","line":203,"in_reply_to":"AAAAXH%2F%2FrtA%3D","updated":"2014-04-18 17:29:20.000000000","message":"Lucas, I believe your comment should read \"power state in (...)\", since this method returns True if the node is UNavailable.\n\nHowever, given the ironic-python-agent work, which relies on keeping nodes powered on even while undeployed, we shouldn\u0027t add a check for that here. What we should check for is unknown and error state. Eg,\n\n  bad_states \u003d [ironic_states.NOSTATE, ironic_states.ERROR]\n  return (node_obj.maintenace or node_obj.power_state in bad_states)","commit_id":"9b9e04b529b07b3d12262c644e8ab9ae8bd2984f"},{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"14a62469cbd014351006d4ad0f0f02def336a6fd","unresolved":false,"context_lines":[{"line_number":222,"context_line":"            local_gb_used \u003d local_gb"},{"line_number":223,"context_line":"        elif self._node_unavailable(node):"},{"line_number":224,"context_line":"            vcpus \u003d 0"},{"line_number":225,"context_line":"            memory_mb \u003d 0"},{"line_number":226,"context_line":"            local_gb \u003d 0"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"        dic \u003d {\u0027node\u0027: str(node.uuid),"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAXH%2F%2FoWE%3D","line":225,"updated":"2014-04-18 17:29:20.000000000","message":"I\u0027d like to get someone from nova to weigh in regarding the implications of zero\u0027ing out the resources -- rather than consuming them -- for unavailable nodes.","commit_id":"9b9e04b529b07b3d12262c644e8ab9ae8bd2984f"},{"author":{"_account_id":1420,"name":"Adam Gandelman","email":"adamg@ubuntu.com","username":"gandelman-a"},"change_message_id":"1211c10d5a1a24e0b20ddc25bd5a08f2195ce81f","unresolved":false,"context_lines":[{"line_number":222,"context_line":"            local_gb_used \u003d local_gb"},{"line_number":223,"context_line":"        elif self._node_unavailable(node):"},{"line_number":224,"context_line":"            vcpus \u003d 0"},{"line_number":225,"context_line":"            memory_mb \u003d 0"},{"line_number":226,"context_line":"            local_gb \u003d 0"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"        dic \u003d {\u0027node\u0027: str(node.uuid),"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAXH%2F%2Fnpw%3D","line":225,"in_reply_to":"AAAAXH%2F%2FoWE%3D","updated":"2014-04-18 19:08:53.000000000","message":"I\u0027d love for someone to chime in.  IMO its accurate to report the node as existing but presenting 0 available resources vs. pretending to be fully utilized.","commit_id":"9b9e04b529b07b3d12262c644e8ab9ae8bd2984f"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"5849cc8fef1274dd51d4ac59261c36b7f5a66eb9","unresolved":false,"context_lines":[{"line_number":322,"context_line":"        try:"},{"line_number":323,"context_line":"            node \u003d icli.node.get(nodename)"},{"line_number":324,"context_line":"            return True"},{"line_number":325,"context_line":"        except ironic_exception.NotFound:"},{"line_number":326,"context_line":"            return False"},{"line_number":327,"context_line":""},{"line_number":328,"context_line":"    def get_available_nodes(self, refresh\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAXH%2F%2FpBM%3D","line":325,"updated":"2014-04-18 15:37:57.000000000","message":"nit: NotFound is marked as deprecated[1], please use HTTPNotFound\n\n[1] https://github.com/openstack/python-ironicclient/blob/master/ironicclient/exc.py#L100-L102","commit_id":"9b9e04b529b07b3d12262c644e8ab9ae8bd2984f"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"241f3567f09056928942d33904faec4fd1afec1e","unresolved":false,"context_lines":[{"line_number":328,"context_line":"    def get_available_nodes(self, refresh\u003dFalse):"},{"line_number":329,"context_line":"        icli \u003d self._get_client()"},{"line_number":330,"context_line":"        n_list \u003d icli.node.list()"},{"line_number":331,"context_line":"        nodes \u003d [n.uuid for n in n_list if n.power_state is not None]"},{"line_number":332,"context_line":"        LOG.debug(\"Returning Nodes: %s\" % nodes)"},{"line_number":333,"context_line":"        return nodes"},{"line_number":334,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAXH%2F%2Fruk%3D","line":331,"updated":"2014-04-18 09:10:13.000000000","message":"nit: I think it\u0027s better to use the ironic_states when doing the checks, for clarity\n\nnodes \u003d [n.uuid for n in n_list if n.power_state !\u003d ironic_states.NOSTATE]","commit_id":"9b9e04b529b07b3d12262c644e8ab9ae8bd2984f"},{"author":{"_account_id":1420,"name":"Adam Gandelman","email":"adamg@ubuntu.com","username":"gandelman-a"},"change_message_id":"1211c10d5a1a24e0b20ddc25bd5a08f2195ce81f","unresolved":false,"context_lines":[{"line_number":328,"context_line":"    def get_available_nodes(self, refresh\u003dFalse):"},{"line_number":329,"context_line":"        icli \u003d self._get_client()"},{"line_number":330,"context_line":"        n_list \u003d icli.node.list()"},{"line_number":331,"context_line":"        nodes \u003d [n.uuid for n in n_list if n.power_state is not None]"},{"line_number":332,"context_line":"        LOG.debug(\"Returning Nodes: %s\" % nodes)"},{"line_number":333,"context_line":"        return nodes"},{"line_number":334,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAXH%2F%2Fnz0%3D","line":331,"in_reply_to":"AAAAXH%2F%2FoVo%3D","updated":"2014-04-18 19:08:53.000000000","message":"I think it makes sense to keep nodes with errored power states in the Nova compute node inventory. The error may be caused by any number of things, and may not happen until an instance is cast to that node or some other time after its been enrolled in nova.compute_nodes for the first time.   Removing them from the list returned from this function means they are marked orphaned and \u0027deleted\u0027 from the nova database.  I don\u0027t know what the implications of that kinda database churn is in Nova, Ceilometer.  IMO I\u0027d prefer ERROR power states lead to an ERRORed instances and a red flag to admin to fix it.","commit_id":"9b9e04b529b07b3d12262c644e8ab9ae8bd2984f"},{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"14a62469cbd014351006d4ad0f0f02def336a6fd","unresolved":false,"context_lines":[{"line_number":328,"context_line":"    def get_available_nodes(self, refresh\u003dFalse):"},{"line_number":329,"context_line":"        icli \u003d self._get_client()"},{"line_number":330,"context_line":"        n_list \u003d icli.node.list()"},{"line_number":331,"context_line":"        nodes \u003d [n.uuid for n in n_list if n.power_state is not None]"},{"line_number":332,"context_line":"        LOG.debug(\"Returning Nodes: %s\" % nodes)"},{"line_number":333,"context_line":"        return nodes"},{"line_number":334,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAXH%2F%2FoVo%3D","line":331,"in_reply_to":"AAAAXH%2F%2Fruk%3D","updated":"2014-04-18 17:29:20.000000000","message":"is there a reason this is this hiding nodes with no power state, but including nodes with an errored power state?","commit_id":"9b9e04b529b07b3d12262c644e8ab9ae8bd2984f"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"919811a05224b33502651fe7a72de88cc63f21ae","unresolved":false,"context_lines":[{"line_number":159,"context_line":"        self.extra_specs \u003d extra_specs"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"    def _node_unavailable(self, node_obj):"},{"line_number":162,"context_line":"        bad_states \u003d [ironic_states.POWER_ON, ironic_states.ERROR]"},{"line_number":163,"context_line":"        return (node_obj.maintenance or"},{"line_number":164,"context_line":"                node_obj.power_state in bad_states)"},{"line_number":165,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAXX%2F%2F5h0%3D","line":162,"updated":"2014-04-25 13:11:41.000000000","message":"Maybe make this a constant outside (e.g. on a module level)?","commit_id":"6bf4571d87bd603613fa859de70c2e086c2c457d"},{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"0431564b4f2c47064109339db98ad504699d5029","unresolved":false,"context_lines":[{"line_number":159,"context_line":"        self.extra_specs \u003d extra_specs"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"    def _node_unavailable(self, node_obj):"},{"line_number":162,"context_line":"        bad_states \u003d [ironic_states.POWER_ON, ironic_states.ERROR]"},{"line_number":163,"context_line":"        return (node_obj.maintenance or"},{"line_number":164,"context_line":"                node_obj.power_state in bad_states)"},{"line_number":165,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAXX%2F%2F1xQ%3D","line":162,"in_reply_to":"AAAAXX%2F%2F1zA%3D","updated":"2014-04-25 21:03:26.000000000","message":"+1 to what deva said.","commit_id":"6bf4571d87bd603613fa859de70c2e086c2c457d"},{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"3c62ab57eda11bdcbe71349bb049d83c07937c0c","unresolved":false,"context_lines":[{"line_number":159,"context_line":"        self.extra_specs \u003d extra_specs"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"    def _node_unavailable(self, node_obj):"},{"line_number":162,"context_line":"        bad_states \u003d [ironic_states.POWER_ON, ironic_states.ERROR]"},{"line_number":163,"context_line":"        return (node_obj.maintenance or"},{"line_number":164,"context_line":"                node_obj.power_state in bad_states)"},{"line_number":165,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAXX%2F%2F1zA%3D","line":162,"in_reply_to":"AAAAXX%2F%2F5h0%3D","updated":"2014-04-25 20:58:54.000000000","message":"including POWER_ON here is going to preclude some functionality which the ironic-agent team is planning. \n\nThere\u0027s also no a priori reason why a powered-on node couldn\u0027t be rebooted just the same, during provisioning. It\u0027s just that the current PXE driver doesn\u0027t implement it that way.\n\nI would, however, add NOSTATE, as I suggested on rev.1","commit_id":"6bf4571d87bd603613fa859de70c2e086c2c457d"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"919811a05224b33502651fe7a72de88cc63f21ae","unresolved":false,"context_lines":[{"line_number":288,"context_line":"        icli \u003d client_wrapper.IronicClientWrapper()"},{"line_number":289,"context_line":"        node_list \u003d icli.call(\"node.list\")"},{"line_number":290,"context_line":"        nodes \u003d [n.uuid for n in node_list"},{"line_number":291,"context_line":"                 if n.power_state is not ironic_states.NOSTATE]"},{"line_number":292,"context_line":"        LOG.debug(\"Returning Nodes: %s\" % nodes)"},{"line_number":293,"context_line":"        return nodes"},{"line_number":294,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAXX%2F%2F5ig%3D","line":291,"updated":"2014-04-25 13:11:41.000000000","message":"Comparison \"is not\" makes explicit assumption that NOSTATE is None. While it\u0027s the case, by using constant we want to hide this detail and make possible to change, I think.","commit_id":"6bf4571d87bd603613fa859de70c2e086c2c457d"},{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"0431564b4f2c47064109339db98ad504699d5029","unresolved":false,"context_lines":[{"line_number":288,"context_line":"        icli \u003d client_wrapper.IronicClientWrapper()"},{"line_number":289,"context_line":"        node_list \u003d icli.call(\"node.list\")"},{"line_number":290,"context_line":"        nodes \u003d [n.uuid for n in node_list"},{"line_number":291,"context_line":"                 if n.power_state is not ironic_states.NOSTATE]"},{"line_number":292,"context_line":"        LOG.debug(\"Returning Nodes: %s\" % nodes)"},{"line_number":293,"context_line":"        return nodes"},{"line_number":294,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAXX%2F%2F1wo%3D","line":291,"in_reply_to":"AAAAXX%2F%2F5ig%3D","updated":"2014-04-25 21:03:26.000000000","message":"Yeah, \u0027is\u0027 (and \u0027is not\u0027) actually compares the python object ids.... not the actual object contents (the strings).\n\nBut should this even filter out NOSTATE at all?  What if a node happened to go to NOSTATE after being used. To nova, it would appear as though it disappeared.  Maybe it\u0027s there, but just broken.  The get_available_resources() will take care of making sure nova doesn\u0027t schedule to it.","commit_id":"6bf4571d87bd603613fa859de70c2e086c2c457d"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"be500e7a05ddfee4cb43625173ac5a96330c3c3a","unresolved":false,"context_lines":[{"line_number":276,"context_line":"        instances \u003d [i for i in node_list if i.instance_uuid]"},{"line_number":277,"context_line":"        return instances"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"    def node_is_available(self, nodename):"},{"line_number":280,"context_line":"        icli \u003d client_wrapper.IronicClientWrapper()"},{"line_number":281,"context_line":"        try:"},{"line_number":282,"context_line":"            icli.call(\"node.get\", nodename)"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad9bd40_3fbbc7c5","line":279,"updated":"2014-04-29 23:30:28.000000000","message":"This could be confusing to someone that reads the code. I think some comments would help. There is a _node_unavailable() method yet it isn\u0027t being called here or in get_available_nodes(). Nor should it be, but it just looks like it should be. [Want to prevent future readers from thinking it is a bug that _node_unavailable() isn\u0027t being called here.]\n\nI\u0027m not sure where/how much comments to add, but I think it would be useful.  Eg, \u0027nova needs to know which nodes are available, where \u0027available\u0027 means \"nodes that exist\".\n\nAnd for _node_unavailable(), these are nodes that ironic doesn\u0027t want nova to use for provisioning. Or something like that.","commit_id":"a147feadd8f8136efb9969241dbc2ca7bb8e437e"},{"author":{"_account_id":1420,"name":"Adam Gandelman","email":"adamg@ubuntu.com","username":"gandelman-a"},"change_message_id":"dd4cfcd10de2a348b79d9552a95970edc5a6afa6","unresolved":false,"context_lines":[{"line_number":276,"context_line":"        instances \u003d [i for i in node_list if i.instance_uuid]"},{"line_number":277,"context_line":"        return instances"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"    def node_is_available(self, nodename):"},{"line_number":280,"context_line":"        icli \u003d client_wrapper.IronicClientWrapper()"},{"line_number":281,"context_line":"        try:"},{"line_number":282,"context_line":"            icli.call(\"node.get\", nodename)"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad9bd40_022756b7","line":279,"in_reply_to":"9ad9bd40_3fbbc7c5","updated":"2014-05-01 19:48:38.000000000","message":"Will do. this is especially confusing because node_is_available() is a method defined in the nova ComputeDriver base class.  Nova\u0027s concept of a \u0027node\u0027 overlaps with Ironic\u0027s here.","commit_id":"a147feadd8f8136efb9969241dbc2ca7bb8e437e"}]}
