)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"8769edd9e944b07c990b63b1c837b60fa2b75930","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"report an error for hw:numa_nodes\u003d0"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch throws an exception when booting an instance with a flavor which has NUMA nodes is set to 0 (hw:numa_nodes\u003d0)"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Change-Id: I20d1655c6e8b681e19a59d7a4b80b3f7d32b952a"},{"line_number":12,"context_line":"Closes-Bug: #1402709"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"3afb71cf_c41ac1c5","line":9,"updated":"2015-06-10 19:56:57.000000000","message":"Can you wrap the line here to max 72 characters.\n\nhttps://wiki.openstack.org/wiki/GitCommitMessages","commit_id":"2b21eeccdceb360edf31d7b87cb2c41dc36abb3c"}],"nova/exception.py":[{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"95536c3eb86050937b834cf26c0760373f9d61b7","unresolved":false,"context_lines":[{"line_number":1869,"context_line":""},{"line_number":1870,"context_line":""},{"line_number":1871,"context_line":"class InvalidNUMANodesNumber(Invalid):"},{"line_number":1872,"context_line":"    msg_fmt \u003d _(\"Image property \u0027hw_numa_nodes\u0027 cannot be  \u0027%(nodes)s\u0027\")"}],"source_content_type":"text/x-python","patch_set":6,"id":"3afb71cf_5b457940","line":1872,"updated":"2015-06-11 08:29:44.000000000","message":"s/cannot be  \u0027%(nodes)s\u0027/cannot be \u0027%(nodes)s\u0027\n\nYou have added two spaces, please remove one.","commit_id":"abccfa2e671077dce7144dea5b0722c29b8d197e"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"e89757c7b91614f414a7825f6dd0339e9ed989dd","unresolved":false,"context_lines":[{"line_number":1884,"context_line":"    msg_fmt \u003d _(\"Database migration failed: %(reason)s\")"},{"line_number":1885,"context_line":""},{"line_number":1886,"context_line":""},{"line_number":1887,"context_line":"class InvalidNUMANodesNumber(Invalid):"},{"line_number":1888,"context_line":"    msg_fmt \u003d _(\"Image property \u0027hw_numa_nodes\u0027 cannot be \u0027%(nodes)s\u0027\")"}],"source_content_type":"text/x-python","patch_set":15,"id":"fa32b979_333f0d27","line":1887,"updated":"2015-06-22 06:06:41.000000000","message":"It may be worthwhile putting this exception close to the other NUMA ones:\nhttps://github.com/openstack/nova/blob/master/nova/exception.py#L1740\n\nBut maybe that is too picky.","commit_id":"d5c8fdf8409e3ddeea82a6b87780f06102618dbf"}],"nova/tests/unit/virt/test_hardware.py":[{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"95536c3eb86050937b834cf26c0760373f9d61b7","unresolved":false,"context_lines":[{"line_number":844,"context_line":"                }),"},{"line_number":845,"context_line":"                \"image\": {"},{"line_number":846,"context_line":"                },"},{"line_number":847,"context_line":"                \"expect\": exception.InvalidNUMANodesNumber,"},{"line_number":848,"context_line":"            },"},{"line_number":849,"context_line":"            {"},{"line_number":850,"context_line":"                # vcpus is not a multiple of nodes, so it"}],"source_content_type":"text/x-python","patch_set":6,"id":"3afb71cf_1b2ca197","line":847,"updated":"2015-06-11 08:29:44.000000000","message":"This unit test. Thanks :)","commit_id":"abccfa2e671077dce7144dea5b0722c29b8d197e"}],"nova/virt/hardware.py":[{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"8769edd9e944b07c990b63b1c837b60fa2b75930","unresolved":false,"context_lines":[{"line_number":901,"context_line":"def _numa_get_constraints_auto(nodes, flavor, image_meta):"},{"line_number":902,"context_line":"    if ((flavor[\u0027vcpus\u0027] % nodes) \u003e 0 or"},{"line_number":903,"context_line":"        (flavor[\u0027memory_mb\u0027] % nodes) \u003e 0):"},{"line_number":904,"context_line":"        raise exception.ImageNUMATopologyAsymmetric()"},{"line_number":905,"context_line":""},{"line_number":906,"context_line":"    cells \u003d []"},{"line_number":907,"context_line":"    for node in range(nodes):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3afb71cf_04afb92a","side":"PARENT","line":904,"updated":"2015-06-10 19:56:57.000000000","message":"Looking at the message raised by this exception will not help user: http://git.openstack.org/cgit/openstack/nova/tree/nova/exception.py#n1738\n\nI guess you need to add new exception like ZeroNumaNodesForbidden. Also please add a unit test to verify that new condition.","commit_id":"5601ad025b215fce6e893058805c22382d5fcc35"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"8769edd9e944b07c990b63b1c837b60fa2b75930","unresolved":false,"context_lines":[{"line_number":899,"context_line":""},{"line_number":900,"context_line":""},{"line_number":901,"context_line":"def _numa_get_constraints_auto(nodes, flavor, image_meta):"},{"line_number":902,"context_line":"    if ((nodes \u003c 1 ) or (flavor[\u0027vcpus\u0027] % nodes) \u003e 0 or "},{"line_number":903,"context_line":"        (flavor[\u0027memory_mb\u0027] % nodes) \u003e 0):"},{"line_number":904,"context_line":"        raise exception.ImageNUMATopologyAsymmetric()"},{"line_number":905,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3afb71cf_846969fb","line":902,"updated":"2015-06-10 19:56:57.000000000","message":"A space that needs to be removed here.","commit_id":"2b21eeccdceb360edf31d7b87cb2c41dc36abb3c"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"95536c3eb86050937b834cf26c0760373f9d61b7","unresolved":false,"context_lines":[{"line_number":899,"context_line":""},{"line_number":900,"context_line":""},{"line_number":901,"context_line":"def _numa_get_constraints_auto(nodes, flavor, image_meta):"},{"line_number":902,"context_line":"    if nodes \u003c 1:"},{"line_number":903,"context_line":"        raise exception.InvalidNUMANodesNumber(nodes\u003dnodes)"},{"line_number":904,"context_line":"    if ((flavor[\u0027vcpus\u0027] % nodes) \u003e 0 or"},{"line_number":905,"context_line":"        (flavor[\u0027memory_mb\u0027] % nodes) \u003e 0):"}],"source_content_type":"text/x-python","patch_set":6,"id":"3afb71cf_3b3abd99","line":902,"updated":"2015-06-11 08:29:44.000000000","message":"Actually this check needs to be done in the method \"numa_get_contraints\". It is where we retrieve \"numa_nodes\" from flavor extra-spec and/or image_metadata.","commit_id":"abccfa2e671077dce7144dea5b0722c29b8d197e"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"3da7fb66f52a4b81a907834419ed08b0b5f8bb3a","unresolved":false,"context_lines":[{"line_number":975,"context_line":"    if nodes or pagesize:"},{"line_number":976,"context_line":"        nodes \u003d nodes and int(nodes) or 1"},{"line_number":977,"context_line":"        # We throw an exception if nodes is an invalid number"},{"line_number":978,"context_line":"        if nodes \u003c 1:"},{"line_number":979,"context_line":"            raise exception.InvalidNUMANodesNumber(nodes\u003dnodes)"},{"line_number":980,"context_line":"        # We\u0027ll pick what path to go down based on whether"},{"line_number":981,"context_line":"        # anything is set for the first node. Both paths"}],"source_content_type":"text/x-python","patch_set":7,"id":"3afb71cf_8624b80c","line":978,"updated":"2015-06-11 09:12:47.000000000","message":"Well the condition line 976 is not really good. _numa_get_flavor_or_image_prop will return None if \"numa_nodes\" is not initialized so nodes will be equal to 1. if numa_nodes return \"0\" it will also be converted to 1 so I believe the exception you have added will never be raised except for values \u003c 0.\n\nWe want to block the process is user set a value less or equal to 0 also for a non numeric value.\n\nI would recommend something like that but please add test for no-int value too:\n\n  if nodes or pagesize:\n    if nodes and not strutils.is_int_like(nodes) or int(nodes) \u003c 1:\n      raise exception....\n    nodes \u003d nodes and int(nodes) or 1\n    ...","commit_id":"5d87ecc16e845e087659e5f2f9476cdf238df5b9"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"c535274819a268fb05ec962bbbe947449f537eec","unresolved":false,"context_lines":[{"line_number":974,"context_line":""},{"line_number":975,"context_line":"    numa_topology \u003d None"},{"line_number":976,"context_line":"    if nodes or pagesize:"},{"line_number":977,"context_line":"        # We throw an exception if nodes is an invalid number"},{"line_number":978,"context_line":"        if nodes is not None and ( not strutils.is_int_like(nodes)"},{"line_number":979,"context_line":"           or int(nodes) \u003c 1 ):"},{"line_number":980,"context_line":"            raise exception.InvalidNUMANodesNumber(nodes\u003dnodes)"}],"source_content_type":"text/x-python","patch_set":11,"id":"3afb71cf_b9aea37f","line":977,"updated":"2015-06-11 16:03:50.000000000","message":"If we need a comment ,we need say invalid format or number \u003c 1, not invalid number","commit_id":"d3d7703a88c05f40207050d371d9c3c025118dbe"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"2f2db0f1a83f80dff586a0b36d78814743040a3e","unresolved":false,"context_lines":[{"line_number":974,"context_line":""},{"line_number":975,"context_line":"    numa_topology \u003d None"},{"line_number":976,"context_line":"    if nodes or pagesize:"},{"line_number":977,"context_line":"        # We throw an exception if nodes is an invalid number"},{"line_number":978,"context_line":"        if nodes is not None and ( not strutils.is_int_like(nodes)"},{"line_number":979,"context_line":"           or int(nodes) \u003c 1 ):"},{"line_number":980,"context_line":"            raise exception.InvalidNUMANodesNumber(nodes\u003dnodes)"}],"source_content_type":"text/x-python","patch_set":11,"id":"1af86dd1_fb1c0a79","line":977,"in_reply_to":"3afb71cf_b9aea37f","updated":"2015-06-12 06:54:51.000000000","message":"You may want fix the comment yes.","commit_id":"d3d7703a88c05f40207050d371d9c3c025118dbe"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"c535274819a268fb05ec962bbbe947449f537eec","unresolved":false,"context_lines":[{"line_number":978,"context_line":"        if nodes is not None and ( not strutils.is_int_like(nodes)"},{"line_number":979,"context_line":"           or int(nodes) \u003c 1 ):"},{"line_number":980,"context_line":"            raise exception.InvalidNUMANodesNumber(nodes\u003dnodes)"},{"line_number":981,"context_line":"        nodes \u003d nodes and int(nodes) or 1"},{"line_number":982,"context_line":"        # We\u0027ll pick what path to go down based on whether"},{"line_number":983,"context_line":"        # anything is set for the first node. Both paths"},{"line_number":984,"context_line":"        # have logic to cope with inconsistent property usage"}],"source_content_type":"text/x-python","patch_set":11,"id":"3afb71cf_d98b9f1d","line":981,"updated":"2015-06-11 16:03:50.000000000","message":"maybe a try : catch ValueError this line then \ncheck the int value ?","commit_id":"d3d7703a88c05f40207050d371d9c3c025118dbe"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"2f2db0f1a83f80dff586a0b36d78814743040a3e","unresolved":false,"context_lines":[{"line_number":978,"context_line":"        if nodes is not None and ( not strutils.is_int_like(nodes)"},{"line_number":979,"context_line":"           or int(nodes) \u003c 1 ):"},{"line_number":980,"context_line":"            raise exception.InvalidNUMANodesNumber(nodes\u003dnodes)"},{"line_number":981,"context_line":"        nodes \u003d nodes and int(nodes) or 1"},{"line_number":982,"context_line":"        # We\u0027ll pick what path to go down based on whether"},{"line_number":983,"context_line":"        # anything is set for the first node. Both paths"},{"line_number":984,"context_line":"        # have logic to cope with inconsistent property usage"}],"source_content_type":"text/x-python","patch_set":11,"id":"1af86dd1_96684dbc","line":981,"in_reply_to":"3afb71cf_d98b9f1d","updated":"2015-06-12 06:54:51.000000000","message":"Algo seems good and well tested I do not know if we really want to use try.. catch here.","commit_id":"d3d7703a88c05f40207050d371d9c3c025118dbe"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"eac65745b41af3f92717d31125edd26c222c6e5f","unresolved":false,"context_lines":[{"line_number":973,"context_line":""},{"line_number":974,"context_line":"    numa_topology \u003d None"},{"line_number":975,"context_line":"    if nodes or pagesize:"},{"line_number":976,"context_line":"        # We throw an exception if nodes is not a number"},{"line_number":977,"context_line":"        # or if number is less than 1"},{"line_number":978,"context_line":"        if nodes is not None:"},{"line_number":979,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":13,"id":"1af86dd1_983e37b7","line":976,"updated":"2015-06-12 08:33:20.000000000","message":"So you changed the algo.. Now you have the exception duplicated and the block is bigger. Actually I prefer the solution in PS12. I will wait to see what other contributors think about that. Thanks","commit_id":"1424c43ad51727a4e5d24b2ad98ff368ca6b34eb"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"b020a6efb0d556a70625e7737db5834c0f40fbae","unresolved":false,"context_lines":[{"line_number":982,"context_line":"                raise exception.InvalidNUMANodesNumber(nodes\u003dnodes)"},{"line_number":983,"context_line":"        else:"},{"line_number":984,"context_line":"            nodes \u003d 1"},{"line_number":985,"context_line":"        if nodes \u003c 1:"},{"line_number":986,"context_line":"            raise exception.InvalidNUMANodesNumber(nodes\u003dnodes)"},{"line_number":987,"context_line":"        # We\u0027ll pick what path to go down based on whether"},{"line_number":988,"context_line":"        # anything is set for the first node. Both paths"}],"source_content_type":"text/x-python","patch_set":15,"id":"fa32b979_2920fc48","line":985,"updated":"2015-06-22 07:39:11.000000000","message":"I prefer the code PS12 but if you still want to use try..except, can you move that condition line 980 and make it to raise a ValueError. By this way we will make the code concise.\n\n  ...\n  try:\n    nodes \u003d int(nodes)\n    if nodes \u003c 1:\n      raise ValueError\n  except ValueError:\n    raise exception.Invalid....\n  ...","commit_id":"d5c8fdf8409e3ddeea82a6b87780f06102618dbf"}]}
