)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"3784bc261d85151dfbcf291ef908be94056650b6","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Warn for duplicate host mappings during discover_hosts"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When the \u0027nova-manage cellv2 discover_hosts\u0027 command is run in parallel"},{"line_number":10,"context_line":"during a deployment, it results in simultaneous attempts to map the"},{"line_number":11,"context_line":"same compute or service hosts at the same time, resulting in"},{"line_number":12,"context_line":"tracebacks:"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"3fce034c_ea904e98","line":9,"range":{"start_line":9,"start_character":56,"end_line":9,"end_character":71},"updated":"2019-04-12 08:44:40.000000000","message":"oh this is because its also a periodic task in the scheduler (https://github.com/openstack/nova/blob/03322bb517925a9f5a04ebdb41c3fd31e7962440/nova/scheduler/manager.py#L66) so workers end up trampling each other.","commit_id":"c873d64d86ec99146edaf96018559c74530a54f2"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"759ad13e27c7a8224984b5fe93900f6b7a281832","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Warn for duplicate host mappings during discover_hosts"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When the \u0027nova-manage cellv2 discover_hosts\u0027 command is run in parallel"},{"line_number":10,"context_line":"during a deployment, it results in simultaneous attempts to map the"},{"line_number":11,"context_line":"same compute or service hosts at the same time, resulting in"},{"line_number":12,"context_line":"tracebacks:"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"3fce034c_6af0d791","line":9,"range":{"start_line":9,"start_character":56,"end_line":9,"end_character":71},"in_reply_to":"3fce034c_ea904e98","updated":"2019-04-12 15:43:50.000000000","message":"Correct, this can also happen if periodic tasks happen to collide. But in the wild (downstream), we saw it because deployment tasks were doing discover_hosts in parallel.","commit_id":"c873d64d86ec99146edaf96018559c74530a54f2"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"8f86cff29207cbc2c43817f85034ba70952a2ce1","unresolved":false,"context_lines":[{"line_number":26,"context_line":"This also adds a warning to the scheduler periodic task to recommend"},{"line_number":27,"context_line":"enabling the periodic on only one scheduler to prevent collisions."},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"We choose to warn and stop instead of ignoring DBDuplicateEntry because"},{"line_number":30,"context_line":"there could potentially be a large number of parallel tasks competing"},{"line_number":31,"context_line":"to insert duplicate records where only one can succeed. If we ignore"},{"line_number":32,"context_line":"and continue to the next record, the large number of tasks will"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"3fce034c_f3b1ed90","line":29,"updated":"2019-04-16 12:14:36.000000000","message":"++ thanks for clarifying :)","commit_id":"f1485edb99058ee2ac240f9f37ba7de481c39dc8"}],"doc/source/cli/nova-manage.rst":[{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"8f86cff29207cbc2c43817f85034ba70952a2ce1","unresolved":false,"context_lines":[{"line_number":262,"context_line":"    hosts which are not currently mapped. If a host is already mapped nothing"},{"line_number":263,"context_line":"    will be done. You need to re-run this command each time you add more"},{"line_number":264,"context_line":"    compute hosts to a cell (otherwise the scheduler will never place instances"},{"line_number":265,"context_line":"    there and the API will not list the new hosts). If the strict option is"},{"line_number":266,"context_line":"    provided the command will only be considered successful if an unmapped host"},{"line_number":267,"context_line":"    is discovered (exit code 0). Any other case is considered a failure (exit"},{"line_number":268,"context_line":"    code 1). If --by-service is specified, this command will look in the"},{"line_number":269,"context_line":"    appropriate cell(s) for any nova-compute services and ensure there are host"},{"line_number":270,"context_line":"    mappings for them. This is less efficient and is only necessary when using"},{"line_number":271,"context_line":"    compute drivers that may manage zero or more actual compute nodes at any"}],"source_content_type":"text/x-rst","patch_set":3,"id":"3fce034c_d1f8694a","line":268,"range":{"start_line":265,"start_character":52,"end_line":268,"end_character":12},"updated":"2019-04-16 12:14:36.000000000","message":"we should probably update this to include \n\n1) the exit code for strict\u003dFalse option case well and/or\n2) if strict\u003dTrue and we discovered an unmapped host  (in which case normally it should be a 0 exit code) but we encountered a race due to parallel running it would be an exit code of 1 from now.\n\nmaybe since the second point is a special case it can go into the new paragraph you have below.","commit_id":"f1485edb99058ee2ac240f9f37ba7de481c39dc8"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"f23e390ae0b5eb7d206a1cce0d1c3830db62d0d2","unresolved":false,"context_lines":[{"line_number":262,"context_line":"    hosts which are not currently mapped. If a host is already mapped nothing"},{"line_number":263,"context_line":"    will be done. You need to re-run this command each time you add more"},{"line_number":264,"context_line":"    compute hosts to a cell (otherwise the scheduler will never place instances"},{"line_number":265,"context_line":"    there and the API will not list the new hosts). If the strict option is"},{"line_number":266,"context_line":"    provided the command will only be considered successful if an unmapped host"},{"line_number":267,"context_line":"    is discovered (exit code 0). Any other case is considered a failure (exit"},{"line_number":268,"context_line":"    code 1). If --by-service is specified, this command will look in the"},{"line_number":269,"context_line":"    appropriate cell(s) for any nova-compute services and ensure there are host"},{"line_number":270,"context_line":"    mappings for them. This is less efficient and is only necessary when using"},{"line_number":271,"context_line":"    compute drivers that may manage zero or more actual compute nodes at any"}],"source_content_type":"text/x-rst","patch_set":3,"id":"3fce034c_71b06a44","line":268,"range":{"start_line":265,"start_character":52,"end_line":268,"end_character":12},"in_reply_to":"3fce034c_d1f8694a","updated":"2019-04-18 00:33:59.000000000","message":"Yeah, good idea. Will do in the next PS.","commit_id":"f1485edb99058ee2ac240f9f37ba7de481c39dc8"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"173a0b4953a730bbb9fd4c32d117b0e89b65b050","unresolved":false,"context_lines":[{"line_number":262,"context_line":"    hosts which are not currently mapped. If a host is already mapped, nothing"},{"line_number":263,"context_line":"    will be done. You need to re-run this command each time you add a batch of"},{"line_number":264,"context_line":"    compute hosts to a cell (otherwise the scheduler will never place instances"},{"line_number":265,"context_line":"    there and the API will not list the new hosts). If --strict is specified,"},{"line_number":266,"context_line":"    the command will only return 0 if an unmapped host was discovered and"},{"line_number":267,"context_line":"    mapped successfully. If --by-service is specified, this command will look"},{"line_number":268,"context_line":"    in the appropriate cell(s) for any nova-compute services and ensure there"}],"source_content_type":"text/x-rst","patch_set":5,"id":"9fb8cfa7_0e66542b","line":265,"range":{"start_line":265,"start_character":55,"end_line":265,"end_character":63},"updated":"2019-06-13 18:19:01.000000000","message":"``literal`` (throughout)","commit_id":"5c544c7e2a7e266d69a9d0f0bf3ee8a0c636202b"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"173a0b4953a730bbb9fd4c32d117b0e89b65b050","unresolved":false,"context_lines":[{"line_number":283,"context_line":"      discovered and mapped."},{"line_number":284,"context_line":"    * Returns 1 if --strict is specified and no unmapped hosts were found."},{"line_number":285,"context_line":"      Also returns 1 if an exception was raised while running."},{"line_number":286,"context_line":"    * Returns 2 if the command aborted because of a duplicate host mapping"},{"line_number":287,"context_line":"      found. This means the command collided with another running"},{"line_number":288,"context_line":"      discover_hosts command or scheduler periodic task and is safe to retry."},{"line_number":289,"context_line":""},{"line_number":290,"context_line":"``nova-manage cell_v2 list_cells [--verbose]``"}],"source_content_type":"text/x-rst","patch_set":5,"id":"9fb8cfa7_0902ce0a","line":287,"range":{"start_line":286,"start_character":39,"end_line":287,"end_character":11},"updated":"2019-06-13 18:19:01.000000000","message":"\"because a duplicate host mapping was found\" or \"due to a duplicate host mapping\"","commit_id":"5c544c7e2a7e266d69a9d0f0bf3ee8a0c636202b"}],"nova/cmd/manage.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"72cf7e26d31f7f522fbcef45be24718bed5d58ef","unresolved":false,"context_lines":[{"line_number":1473,"context_line":"                    \u0027run in parallel, the commands will collide with each \u0027"},{"line_number":1474,"context_line":"                    \u0027other trying to map the same hosts in the database at \u0027"},{"line_number":1475,"context_line":"                    \u0027the same time. Error: %s\u0027) % exp)"},{"line_number":1476,"context_line":"            return 1"},{"line_number":1477,"context_line":"        # discover_hosts will return an empty list if no hosts are discovered"},{"line_number":1478,"context_line":"        if strict:"},{"line_number":1479,"context_line":"            return int(not hosts)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fce034c_1be1729b","line":1476,"updated":"2019-04-12 00:51:27.000000000","message":"I wonder if this should only return 1 if strict is True - otherwise do we really need to return a non-0 code if there was nothing to do?","commit_id":"9b78701cf1c869f1e0f7fe19e7bf3e5d251ba86e"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"eba99fb07d7017f35a9a8a60023a4a06a386c6bf","unresolved":false,"context_lines":[{"line_number":1473,"context_line":"                    \u0027run in parallel, the commands will collide with each \u0027"},{"line_number":1474,"context_line":"                    \u0027other trying to map the same hosts in the database at \u0027"},{"line_number":1475,"context_line":"                    \u0027the same time. Error: %s\u0027) % exp)"},{"line_number":1476,"context_line":"            return 1"},{"line_number":1477,"context_line":"        # discover_hosts will return an empty list if no hosts are discovered"},{"line_number":1478,"context_line":"        if strict:"},{"line_number":1479,"context_line":"            return int(not hosts)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fce034c_5bae1a2f","line":1476,"in_reply_to":"3fce034c_1be1729b","updated":"2019-04-12 00:59:50.000000000","message":"Hm, I guess I wasn\u0027t thinking about it as necessarily having nothing to do. I was thinking, what if it failed on host1 but it still could have mapped host2? Is it safe to assume that some other colliding discover_hosts mapped host2? If someone can reassure me that, we can return 0 here.","commit_id":"9b78701cf1c869f1e0f7fe19e7bf3e5d251ba86e"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"759ad13e27c7a8224984b5fe93900f6b7a281832","unresolved":false,"context_lines":[{"line_number":1456,"context_line":"        This command should be run once after all compute hosts have been"},{"line_number":1457,"context_line":"        deployed and should not be run in parallel. When run in parallel,"},{"line_number":1458,"context_line":"        the commands will collide with each other trying to map the same hosts"},{"line_number":1459,"context_line":"        in the database at the same time."},{"line_number":1460,"context_line":"        \"\"\""},{"line_number":1461,"context_line":"        def status_fn(msg):"},{"line_number":1462,"context_line":"            if verbose:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fce034c_b78703d8","line":1459,"updated":"2019-04-12 15:43:50.000000000","message":"TODO: I need to add this info to the nova-manage docs. I had thought they get auto-generated from these docstrings a la novaclient, but they don\u0027t.","commit_id":"c873d64d86ec99146edaf96018559c74530a54f2"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"0bac7af44494c1651845faff935e3206d7f554ee","unresolved":false,"context_lines":[{"line_number":1473,"context_line":"                    \u0027run in parallel, the commands will collide with each \u0027"},{"line_number":1474,"context_line":"                    \u0027other trying to map the same hosts in the database at \u0027"},{"line_number":1475,"context_line":"                    \u0027the same time. Error: %s\u0027) % exp)"},{"line_number":1476,"context_line":"            return 1"},{"line_number":1477,"context_line":"        # discover_hosts will return an empty list if no hosts are discovered"},{"line_number":1478,"context_line":"        if strict:"},{"line_number":1479,"context_line":"            return int(not hosts)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fce034c_1e196078","line":1476,"range":{"start_line":1476,"start_character":12,"end_line":1476,"end_character":20},"updated":"2019-04-12 01:10:53.000000000","message":"Open question: would it be safe to return 1 only if strict\u003dTrue?\n\nDuplicate host error can happen if parallel discover_hosts commands are trying to map compute hosts at the same time. The command halts when a duplicate is detected. Is it safe to assume the remaining hosts need no mapping? Can we assume some other colliding discover_hosts mapped them successfully? I had thought not.\n\nAnd thinking from another angle, encountering a duplicate indicates misuse (unless scheduler periodics collide). Is it a good idea to hide that from users via a 0 return code?","commit_id":"c873d64d86ec99146edaf96018559c74530a54f2"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"3784bc261d85151dfbcf291ef908be94056650b6","unresolved":false,"context_lines":[{"line_number":1473,"context_line":"                    \u0027run in parallel, the commands will collide with each \u0027"},{"line_number":1474,"context_line":"                    \u0027other trying to map the same hosts in the database at \u0027"},{"line_number":1475,"context_line":"                    \u0027the same time. Error: %s\u0027) % exp)"},{"line_number":1476,"context_line":"            return 1"},{"line_number":1477,"context_line":"        # discover_hosts will return an empty list if no hosts are discovered"},{"line_number":1478,"context_line":"        if strict:"},{"line_number":1479,"context_line":"            return int(not hosts)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fce034c_cacb121c","line":1476,"range":{"start_line":1476,"start_character":12,"end_line":1476,"end_character":20},"in_reply_to":"3fce034c_1e196078","updated":"2019-04-12 08:44:40.000000000","message":"\u003e Open question: would it be safe to return 1 only if strict\u003dTrue?\n \u003e \n \u003e Duplicate host error can happen if parallel discover_hosts commands\n \u003e are trying to map compute hosts at the same time. The command halts\n \u003e when a duplicate is detected. Is it safe to assume the remaining\n \u003e hosts need no mapping? Can we assume some other colliding\n \u003e discover_hosts mapped them successfully? I had thought not.\n \u003e \n\nIMHO, we should not stop this because we got the DuplicateEntry error, since technically the command didn\u0027t fail right? I saw in the bug description why you chose to go ahead with \"warn and stop\" instead of \"warn and ignore\".\n\nI think we should go the \"warn and ignore\" way keeping it consistent with the map_instances where (https://github.com/openstack/nova/blob/03322bb517925a9f5a04ebdb41c3fd31e7962440/nova/cmd/manage.py#L1195) we skip the duplicate entry.\n\n \u003e And thinking from another angle, encountering a duplicate indicates\n \u003e misuse (unless scheduler periodics collide). Is it a good idea to\n \u003e hide that from users via a 0 return code?\n\nI think its okay to return 0 and we should continue with the running to ensure everything got mapped. We should warn the users however like you are doing above and from the logs/command output they can make out that they are mis-using it.","commit_id":"c873d64d86ec99146edaf96018559c74530a54f2"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"759ad13e27c7a8224984b5fe93900f6b7a281832","unresolved":false,"context_lines":[{"line_number":1473,"context_line":"                    \u0027run in parallel, the commands will collide with each \u0027"},{"line_number":1474,"context_line":"                    \u0027other trying to map the same hosts in the database at \u0027"},{"line_number":1475,"context_line":"                    \u0027the same time. Error: %s\u0027) % exp)"},{"line_number":1476,"context_line":"            return 1"},{"line_number":1477,"context_line":"        # discover_hosts will return an empty list if no hosts are discovered"},{"line_number":1478,"context_line":"        if strict:"},{"line_number":1479,"context_line":"            return int(not hosts)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fce034c_773bdb37","line":1476,"range":{"start_line":1476,"start_character":12,"end_line":1476,"end_character":20},"in_reply_to":"3fce034c_250a00d2","updated":"2019-04-12 15:43:50.000000000","message":"OK, we chatted about this on IRC [1] and have agreement to leave this part as-is, no change in behavior from today, just better info provided for humans.\n\n[1] http://eavesdrop.openstack.org/irclogs/%23openstack-nova/%23openstack-nova.2019-04-12.log.html#t2019-04-12T15:05:09","commit_id":"c873d64d86ec99146edaf96018559c74530a54f2"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"9555bfa6c2591f9212175ef0649494bc65c7b1ca","unresolved":false,"context_lines":[{"line_number":1473,"context_line":"                    \u0027run in parallel, the commands will collide with each \u0027"},{"line_number":1474,"context_line":"                    \u0027other trying to map the same hosts in the database at \u0027"},{"line_number":1475,"context_line":"                    \u0027the same time. Error: %s\u0027) % exp)"},{"line_number":1476,"context_line":"            return 1"},{"line_number":1477,"context_line":"        # discover_hosts will return an empty list if no hosts are discovered"},{"line_number":1478,"context_line":"        if strict:"},{"line_number":1479,"context_line":"            return int(not hosts)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fce034c_250a00d2","line":1476,"range":{"start_line":1476,"start_character":12,"end_line":1476,"end_character":20},"in_reply_to":"3fce034c_c57d3c6f","updated":"2019-04-12 14:49:44.000000000","message":"\u003e That won\u0027t happen in the patch as it is - since the discover_hosts\n \u003e code is raising an exception, we\u0027re stopping. I guess you\u0027re saying\n \u003e we should log the duplicate but continue processing other\n \u003e computes/services that maybe need mappings, and return 0 at the\n \u003e end.\n\nexactly, was just writing this down.","commit_id":"c873d64d86ec99146edaf96018559c74530a54f2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3cb0b1552de24266ad0ca24126e51e787e4eca8b","unresolved":false,"context_lines":[{"line_number":1473,"context_line":"                    \u0027run in parallel, the commands will collide with each \u0027"},{"line_number":1474,"context_line":"                    \u0027other trying to map the same hosts in the database at \u0027"},{"line_number":1475,"context_line":"                    \u0027the same time. Error: %s\u0027) % exp)"},{"line_number":1476,"context_line":"            return 1"},{"line_number":1477,"context_line":"        # discover_hosts will return an empty list if no hosts are discovered"},{"line_number":1478,"context_line":"        if strict:"},{"line_number":1479,"context_line":"            return int(not hosts)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fce034c_c559bcfe","line":1476,"range":{"start_line":1476,"start_character":12,"end_line":1476,"end_character":20},"in_reply_to":"3fce034c_c57d3c6f","updated":"2019-04-12 14:42:03.000000000","message":"Following onto what I said, if we\u0027re going to halt processing a list and raise an exception, then yeah it\u0027s probably non-zero, but I think I\u0027d rather gracefully handle the duplicate and continue processing all hosts that I can. Then it\u0027s a question of at the end, do you raise the duplicate or just ignore it and return 0? If you did that and no hosts were mapped, then the logic below will handle it (return non-zero if strict else 0), which is the same question asked above - do we return non-zero if strict and we hit a duplicate.","commit_id":"c873d64d86ec99146edaf96018559c74530a54f2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"cd14ca61a451474d309bdff9a03283df3a419b10","unresolved":false,"context_lines":[{"line_number":1473,"context_line":"                    \u0027run in parallel, the commands will collide with each \u0027"},{"line_number":1474,"context_line":"                    \u0027other trying to map the same hosts in the database at \u0027"},{"line_number":1475,"context_line":"                    \u0027the same time. Error: %s\u0027) % exp)"},{"line_number":1476,"context_line":"            return 1"},{"line_number":1477,"context_line":"        # discover_hosts will return an empty list if no hosts are discovered"},{"line_number":1478,"context_line":"        if strict:"},{"line_number":1479,"context_line":"            return int(not hosts)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fce034c_c57d3c6f","line":1476,"range":{"start_line":1476,"start_character":12,"end_line":1476,"end_character":20},"in_reply_to":"3fce034c_cacb121c","updated":"2019-04-12 14:39:19.000000000","message":"\u003e I think its okay to return 0 and we should continue with the running to ensure everything got mapped. We should warn the users however like you are doing above and from the logs/command output they can make out that they are mis-using it.\n\nThat won\u0027t happen in the patch as it is - since the discover_hosts code is raising an exception, we\u0027re stopping. I guess you\u0027re saying we should log the duplicate but continue processing other computes/services that maybe need mappings, and return 0 at the end.","commit_id":"c873d64d86ec99146edaf96018559c74530a54f2"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"2941ce0cf7a37ca3a0d07e824a7711de1ca8b21f","unresolved":false,"context_lines":[{"line_number":1473,"context_line":"                    \u0027run in parallel, the commands will collide with each \u0027"},{"line_number":1474,"context_line":"                    \u0027other trying to map the same hosts in the database at \u0027"},{"line_number":1475,"context_line":"                    \u0027the same time. Error: %s\u0027) % exp)"},{"line_number":1476,"context_line":"            return 1"},{"line_number":1477,"context_line":"        # discover_hosts will return an empty list if no hosts are discovered"},{"line_number":1478,"context_line":"        if strict:"},{"line_number":1479,"context_line":"            return int(not hosts)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fce034c_0a63531c","line":1476,"range":{"start_line":1476,"start_character":12,"end_line":1476,"end_character":20},"in_reply_to":"3fce034c_cacb121c","updated":"2019-04-12 14:32:08.000000000","message":"Right, zero means \"I did something and I finished\" I think. Nonzero means \"I didn\u0027t do anything\" with the implication that you couldn\u0027t do anything because there was nothing to do. In your duplicate case, you\u0027ve either done nothing, or done some things but not all the things. Since I think the nonzero case is likely to be used as \"we have no more to do\" I would think you need to return zero until you can run and find nothing to do.\n\nIf someone is running this with ansible, I would expect (if they know how this works, which may be unlikely from the poor existing docs) that they are running this, and if nonzero, running again. Since the two racing threads may have both done a part of the mapping, but stopped before finishing, you need to indicate that more could be needed, which means return zero to me.\n\nSurya, I think that\u0027s in line with what you\u0027re saying right?","commit_id":"c873d64d86ec99146edaf96018559c74530a54f2"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"8f86cff29207cbc2c43817f85034ba70952a2ce1","unresolved":false,"context_lines":[{"line_number":1473,"context_line":"                    \u0027run in parallel, the commands will collide with each \u0027"},{"line_number":1474,"context_line":"                    \u0027other trying to map the same hosts in the database at \u0027"},{"line_number":1475,"context_line":"                    \u0027the same time. Error: %s\u0027) % exp)"},{"line_number":1476,"context_line":"            return 1"},{"line_number":1477,"context_line":"        # discover_hosts will return an empty list if no hosts are discovered"},{"line_number":1478,"context_line":"        if strict:"},{"line_number":1479,"context_line":"            return int(not hosts)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fce034c_11235107","line":1476,"updated":"2019-04-16 12:14:36.000000000","message":"okay so from now on irrespective of \"strict\" option we start returning error code 1 for this case.","commit_id":"f1485edb99058ee2ac240f9f37ba7de481c39dc8"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"f23e390ae0b5eb7d206a1cce0d1c3830db62d0d2","unresolved":false,"context_lines":[{"line_number":1473,"context_line":"                    \u0027run in parallel, the commands will collide with each \u0027"},{"line_number":1474,"context_line":"                    \u0027other trying to map the same hosts in the database at \u0027"},{"line_number":1475,"context_line":"                    \u0027the same time. Error: %s\u0027) % exp)"},{"line_number":1476,"context_line":"            return 1"},{"line_number":1477,"context_line":"        # discover_hosts will return an empty list if no hosts are discovered"},{"line_number":1478,"context_line":"        if strict:"},{"line_number":1479,"context_line":"            return int(not hosts)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fce034c_318f4276","line":1476,"in_reply_to":"3fce034c_11235107","updated":"2019-04-18 00:33:59.000000000","message":"Based on mnaser\u0027s feedback, I\u0027m going to respin this with error code 2 because 1 will be returned for \"real failures\" like unhandled exceptions. That way, code 2 signals that it\u0027s OK to retry the command (not a permanent failure).","commit_id":"f1485edb99058ee2ac240f9f37ba7de481c39dc8"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"a90a2e0803aae8c5fc41a14870a424d13e1d0784","unresolved":false,"context_lines":[{"line_number":1473,"context_line":"                    \u0027run in parallel, the commands will collide with each \u0027"},{"line_number":1474,"context_line":"                    \u0027other trying to map the same hosts in the database at \u0027"},{"line_number":1475,"context_line":"                    \u0027the same time. Error: %s\u0027) % exp)"},{"line_number":1476,"context_line":"            return 1"},{"line_number":1477,"context_line":"        # discover_hosts will return an empty list if no hosts are discovered"},{"line_number":1478,"context_line":"        if strict:"},{"line_number":1479,"context_line":"            return int(not hosts)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fce034c_bce466e1","line":1476,"in_reply_to":"3fce034c_318f4276","updated":"2019-04-18 08:46:57.000000000","message":"ah yea good idea, makes sense to have a new error code.","commit_id":"f1485edb99058ee2ac240f9f37ba7de481c39dc8"}],"nova/objects/host_mapping.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"72cf7e26d31f7f522fbcef45be24718bed5d58ef","unresolved":false,"context_lines":[{"line_number":196,"context_line":"            except db_exc.DBDuplicateEntry:"},{"line_number":197,"context_line":"                msg \u003d _(\"ERROR: Duplicate host mapping for compute host \""},{"line_number":198,"context_line":"                        \"\u0027%(host)s\u0027 exists\") % {\u0027host\u0027: compute.host}"},{"line_number":199,"context_line":"                status_fn(msg)"},{"line_number":200,"context_line":"                raise exception.HostMappingExists(name\u003dcompute.host)"},{"line_number":201,"context_line":"            host_mappings.append(host_mapping)"},{"line_number":202,"context_line":"            compute.mapped \u003d 1"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fce034c_dbf44a5e","line":199,"updated":"2019-04-12 00:51:27.000000000","message":"The CLI is going to already give an output - do we need it twice?","commit_id":"9b78701cf1c869f1e0f7fe19e7bf3e5d251ba86e"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"eba99fb07d7017f35a9a8a60023a4a06a386c6bf","unresolved":false,"context_lines":[{"line_number":196,"context_line":"            except db_exc.DBDuplicateEntry:"},{"line_number":197,"context_line":"                msg \u003d _(\"ERROR: Duplicate host mapping for compute host \""},{"line_number":198,"context_line":"                        \"\u0027%(host)s\u0027 exists\") % {\u0027host\u0027: compute.host}"},{"line_number":199,"context_line":"                status_fn(msg)"},{"line_number":200,"context_line":"                raise exception.HostMappingExists(name\u003dcompute.host)"},{"line_number":201,"context_line":"            host_mappings.append(host_mapping)"},{"line_number":202,"context_line":"            compute.mapped \u003d 1"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fce034c_3b76aeda","line":199,"in_reply_to":"3fce034c_dbf44a5e","updated":"2019-04-12 00:59:50.000000000","message":"Yeah, I guess not. I wrote this first before writing the last message and was thinking \"what if we give more info if they chose --verbose\". But the way this landed, it\u0027s saying basically the same thing so could remove this.","commit_id":"9b78701cf1c869f1e0f7fe19e7bf3e5d251ba86e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"93c706c42c18069dc816d213afd892c5c9e625aa","unresolved":false,"context_lines":[{"line_number":215,"context_line":"            host_mapping \u003d HostMapping("},{"line_number":216,"context_line":"                ctxt, host\u003dservice.host,"},{"line_number":217,"context_line":"                cell_mapping\u003dcm)"},{"line_number":218,"context_line":"            try:"},{"line_number":219,"context_line":"                host_mapping.create()"},{"line_number":220,"context_line":"            except db_exc.DBDuplicateEntry:"},{"line_number":221,"context_line":"                msg \u003d _(\"ERROR: Duplicate host mapping for service host \""}],"source_content_type":"text/x-python","patch_set":1,"id":"3fce034c_7bd0b6ca","line":218,"updated":"2019-04-12 00:49:03.000000000","message":"You could DRY this up by pulling the HM.create into a private method where the host is passed in and then you only need to deal with the duplicate entry in that one private method. You\u0027d have to make the error message more generic.","commit_id":"9b78701cf1c869f1e0f7fe19e7bf3e5d251ba86e"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"3489d9877ed226ff259409b626f7753de007f36d","unresolved":false,"context_lines":[{"line_number":215,"context_line":"            host_mapping \u003d HostMapping("},{"line_number":216,"context_line":"                ctxt, host\u003dservice.host,"},{"line_number":217,"context_line":"                cell_mapping\u003dcm)"},{"line_number":218,"context_line":"            try:"},{"line_number":219,"context_line":"                host_mapping.create()"},{"line_number":220,"context_line":"            except db_exc.DBDuplicateEntry:"},{"line_number":221,"context_line":"                msg \u003d _(\"ERROR: Duplicate host mapping for service host \""}],"source_content_type":"text/x-python","patch_set":1,"id":"3fce034c_bbeffe85","line":218,"in_reply_to":"3fce034c_7bd0b6ca","updated":"2019-04-12 00:51:31.000000000","message":"Yeah, probably worth it. I thought it was repetitive but then my brain was like mush and said meh. I\u0027ll respin since you pointed it out.","commit_id":"9b78701cf1c869f1e0f7fe19e7bf3e5d251ba86e"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"9555bfa6c2591f9212175ef0649494bc65c7b1ca","unresolved":false,"context_lines":[{"line_number":180,"context_line":"    try:"},{"line_number":181,"context_line":"        host_mapping.create()"},{"line_number":182,"context_line":"    except db_exc.DBDuplicateEntry:"},{"line_number":183,"context_line":"        raise exception.HostMappingExists(name\u003dhost_mapping.host)"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"def _check_and_create_node_host_mappings(ctxt, cm, compute_nodes, status_fn):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fce034c_85217450","line":183,"updated":"2019-04-12 14:49:44.000000000","message":"At this point we log it and pass onto the next compute_node. I feel if while mapping we encountered a duplicate error, its okay to proceed without raising - meaning we should map if there are other unmapped ones.","commit_id":"c873d64d86ec99146edaf96018559c74530a54f2"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"759ad13e27c7a8224984b5fe93900f6b7a281832","unresolved":false,"context_lines":[{"line_number":180,"context_line":"    try:"},{"line_number":181,"context_line":"        host_mapping.create()"},{"line_number":182,"context_line":"    except db_exc.DBDuplicateEntry:"},{"line_number":183,"context_line":"        raise exception.HostMappingExists(name\u003dhost_mapping.host)"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"def _check_and_create_node_host_mappings(ctxt, cm, compute_nodes, status_fn):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fce034c_5727bf13","line":183,"in_reply_to":"3fce034c_85217450","updated":"2019-04-12 15:43:50.000000000","message":"TODO: I need to catch this and log a warning for the scheduler periodic that says, \"This should only be enabled for one scheduler process...\"","commit_id":"c873d64d86ec99146edaf96018559c74530a54f2"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"8680c8e37f7665c1ade625d5b356dd9dcc170601","unresolved":false,"context_lines":[{"line_number":180,"context_line":"    try:"},{"line_number":181,"context_line":"        host_mapping.create()"},{"line_number":182,"context_line":"    except db_exc.DBDuplicateEntry:"},{"line_number":183,"context_line":"        raise exception.HostMappingExists(name\u003dhost_mapping.host)"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"def _check_and_create_node_host_mappings(ctxt, cm, compute_nodes, status_fn):"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fb8cfa7_dd5a3481","line":183,"updated":"2019-06-13 15:47:29.000000000","message":"I get that this is technically DRYer, but it\u0027s the same number of lines and probably not what *I* would consider to be worthwhile :D","commit_id":"09a4a0e28864a32251e2ea725507549225e601ce"}],"nova/scheduler/manager.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"8680c8e37f7665c1ade625d5b356dd9dcc170601","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        except exception.HostMappingExists as exp:"},{"line_number":80,"context_line":"            LOG.warning(\u0027This periodic task should only be enabled on a \u0027"},{"line_number":81,"context_line":"                        \u0027single scheduler to prevent collisions between \u0027"},{"line_number":82,"context_line":"                        \u0027multiple schedulers. Error: %s\u0027, six.text_type(exp))"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    @periodic_task.periodic_task(spacing\u003dCONF.scheduler.periodic_task_interval,"},{"line_number":85,"context_line":"                                 run_immediately\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fb8cfa7_9d627c09","line":82,"updated":"2019-06-13 15:47:29.000000000","message":"I think we discussed this already, but it\u0027s been a while so I don\u0027t remember the details.\n\nI definitely agree that it should only be on one scheduler at a time, but I also wonder if maybe logging at warning is too heavy here. Let\u0027s say you have a deployment tool that is inflexible and opinionated and will configure all schedulers the same because reasons (can\u0027t imagine WHAT vendor would do that :P). It shouldn\u0027t really be too hurtful to have multiple schedulers doing the same thing, especially given we use the mapped flag to do the lookup. It\u0027s not super efficient to have them stepping on each other, but not terribly bad.\n\nSo, point being.. I wonder if we should just log this as debug, or maybe once at warning/info and then at debug after that, just to be kind to the _users_ of such a deployment tool.\n\nThoughts?","commit_id":"09a4a0e28864a32251e2ea725507549225e601ce"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"76759ae5bb362edd0a17912c7508337ff356b978","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        except exception.HostMappingExists as exp:"},{"line_number":80,"context_line":"            LOG.warning(\u0027This periodic task should only be enabled on a \u0027"},{"line_number":81,"context_line":"                        \u0027single scheduler to prevent collisions between \u0027"},{"line_number":82,"context_line":"                        \u0027multiple schedulers. Error: %s\u0027, six.text_type(exp))"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    @periodic_task.periodic_task(spacing\u003dCONF.scheduler.periodic_task_interval,"},{"line_number":85,"context_line":"                                 run_immediately\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fb8cfa7_731579e4","line":82,"in_reply_to":"9fb8cfa7_70280f96","updated":"2019-06-13 16:41:11.000000000","message":"\u003e I think the log once at warning and then debug after that sounds\n \u003e OK. I\u0027ve heard a number of times from operators that they won\u0027t\n \u003e notice anything logged at below (above?) warning level, so I think\n \u003e it\u0027s probably worth having one log at warning. Else I suspect no\n \u003e one would ever notice this message.\n\nYep, sounds fair.\n\n \u003e I\u0027m also wondering if I should omit the word \"Error\" in the\n \u003e message.\n\nAgree.","commit_id":"09a4a0e28864a32251e2ea725507549225e601ce"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"d2b249cc30fa910ec411736763dc54bb6cd659ac","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        except exception.HostMappingExists as exp:"},{"line_number":80,"context_line":"            LOG.warning(\u0027This periodic task should only be enabled on a \u0027"},{"line_number":81,"context_line":"                        \u0027single scheduler to prevent collisions between \u0027"},{"line_number":82,"context_line":"                        \u0027multiple schedulers. Error: %s\u0027, six.text_type(exp))"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    @periodic_task.periodic_task(spacing\u003dCONF.scheduler.periodic_task_interval,"},{"line_number":85,"context_line":"                                 run_immediately\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fb8cfa7_70280f96","line":82,"in_reply_to":"9fb8cfa7_9d627c09","updated":"2019-06-13 16:21:27.000000000","message":"I think the log once at warning and then debug after that sounds OK. I\u0027ve heard a number of times from operators that they won\u0027t notice anything logged at below (above?) warning level, so I think it\u0027s probably worth having one log at warning. Else I suspect no one would ever notice this message.\n\nI\u0027m also wondering if I should omit the word \"Error\" in the message.","commit_id":"09a4a0e28864a32251e2ea725507549225e601ce"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"173a0b4953a730bbb9fd4c32d117b0e89b65b050","unresolved":false,"context_lines":[{"line_number":81,"context_line":"                                             for hm in host_mappings])})"},{"line_number":82,"context_line":"        except exception.HostMappingExists as exp:"},{"line_number":83,"context_line":"            msg \u003d (\u0027This periodic task should only be enabled on a single \u0027"},{"line_number":84,"context_line":"                   \u0027scheduler to prevent collisions between multiple \u0027"},{"line_number":85,"context_line":"                   \u0027schedulers: %s\u0027 % six.text_type(exp))"},{"line_number":86,"context_line":"            if not HOST_MAPPING_EXISTS_WARNING:"},{"line_number":87,"context_line":"                LOG.warning(msg)"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fb8cfa7_4949a65d","line":84,"range":{"start_line":84,"start_character":52,"end_line":84,"end_character":59},"updated":"2019-06-13 18:19:01.000000000","message":"among","commit_id":"5c544c7e2a7e266d69a9d0f0bf3ee8a0c636202b"}],"nova/tests/unit/objects/test_host_mapping.py":[{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"8f86cff29207cbc2c43817f85034ba70952a2ce1","unresolved":false,"context_lines":[{"line_number":327,"context_line":"        mock_hm_create.side_effect \u003d db_exc.DBDuplicateEntry()"},{"line_number":328,"context_line":""},{"line_number":329,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":330,"context_line":"        try:"},{"line_number":331,"context_line":"            host_mapping.discover_hosts(ctxt)"},{"line_number":332,"context_line":"            self.fail()"},{"line_number":333,"context_line":"        except exception.HostMappingExists as exp:"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fce034c_31b8cd74","line":330,"updated":"2019-04-16 12:14:36.000000000","message":"nit: we could change this block to using assertRaises and assertIn but I am okay with the current approach as well.","commit_id":"f1485edb99058ee2ac240f9f37ba7de481c39dc8"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"f23e390ae0b5eb7d206a1cce0d1c3830db62d0d2","unresolved":false,"context_lines":[{"line_number":327,"context_line":"        mock_hm_create.side_effect \u003d db_exc.DBDuplicateEntry()"},{"line_number":328,"context_line":""},{"line_number":329,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":330,"context_line":"        try:"},{"line_number":331,"context_line":"            host_mapping.discover_hosts(ctxt)"},{"line_number":332,"context_line":"            self.fail()"},{"line_number":333,"context_line":"        except exception.HostMappingExists as exp:"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fce034c_f1853a5b","line":330,"in_reply_to":"3fce034c_31b8cd74","updated":"2019-04-18 00:33:59.000000000","message":"Orly? I didn\u0027t know I could get access to the exception object if I used assertRaises. I will change it once I find how to do it.","commit_id":"f1485edb99058ee2ac240f9f37ba7de481c39dc8"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"4626110063fa43fccea52b99caa45c44ea9b0434","unresolved":false,"context_lines":[{"line_number":327,"context_line":"        mock_hm_create.side_effect \u003d db_exc.DBDuplicateEntry()"},{"line_number":328,"context_line":""},{"line_number":329,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":330,"context_line":"        try:"},{"line_number":331,"context_line":"            host_mapping.discover_hosts(ctxt)"},{"line_number":332,"context_line":"            self.fail()"},{"line_number":333,"context_line":"        except exception.HostMappingExists as exp:"}],"source_content_type":"text/x-python","patch_set":3,"id":"ffb9cba7_0b38f69d","line":330,"in_reply_to":"3fce034c_bcaf867b","updated":"2019-04-25 19:28:10.000000000","message":"Whoa, thanks! I never knew this.","commit_id":"f1485edb99058ee2ac240f9f37ba7de481c39dc8"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"a90a2e0803aae8c5fc41a14870a424d13e1d0784","unresolved":false,"context_lines":[{"line_number":327,"context_line":"        mock_hm_create.side_effect \u003d db_exc.DBDuplicateEntry()"},{"line_number":328,"context_line":""},{"line_number":329,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":330,"context_line":"        try:"},{"line_number":331,"context_line":"            host_mapping.discover_hosts(ctxt)"},{"line_number":332,"context_line":"            self.fail()"},{"line_number":333,"context_line":"        except exception.HostMappingExists as exp:"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fce034c_bcaf867b","line":330,"in_reply_to":"3fce034c_f1853a5b","updated":"2019-04-18 08:46:57.000000000","message":"\u003e Orly? I didn\u0027t know I could get access to the exception object if I\n \u003e used assertRaises. I will change it once I find how to do it.\n\nmaybe this will help: https://github.com/openstack/nova/blob/6ac15734b9678bfb876e7dfa6502a13d1fe2ee40/nova/tests/unit/compute/test_instance_list.py#L215","commit_id":"f1485edb99058ee2ac240f9f37ba7de481c39dc8"}],"nova/tests/unit/test_nova_manage.py":[{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"8f86cff29207cbc2c43817f85034ba70952a2ce1","unresolved":false,"context_lines":[{"line_number":1767,"context_line":"        self.assertEqual(self.commands.discover_hosts(strict\u003dTrue), 1)"},{"line_number":1768,"context_line":""},{"line_number":1769,"context_line":"        # Check the return when strict\u003dFalse"},{"line_number":1770,"context_line":"        self.assertIsNone(self.commands.discover_hosts())"},{"line_number":1771,"context_line":""},{"line_number":1772,"context_line":"    @mock.patch(\u0027nova.objects.host_mapping.discover_hosts\u0027)"},{"line_number":1773,"context_line":"    def test_discover_hosts_by_service(self, mock_discover_hosts):"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fce034c_11d6f1c4","line":1770,"updated":"2019-04-16 12:14:36.000000000","message":"okay so for normal situations strict\u003dFalse will never have a return code.","commit_id":"f1485edb99058ee2ac240f9f37ba7de481c39dc8"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"f23e390ae0b5eb7d206a1cce0d1c3830db62d0d2","unresolved":false,"context_lines":[{"line_number":1767,"context_line":"        self.assertEqual(self.commands.discover_hosts(strict\u003dTrue), 1)"},{"line_number":1768,"context_line":""},{"line_number":1769,"context_line":"        # Check the return when strict\u003dFalse"},{"line_number":1770,"context_line":"        self.assertIsNone(self.commands.discover_hosts())"},{"line_number":1771,"context_line":""},{"line_number":1772,"context_line":"    @mock.patch(\u0027nova.objects.host_mapping.discover_hosts\u0027)"},{"line_number":1773,"context_line":"    def test_discover_hosts_by_service(self, mock_discover_hosts):"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fce034c_b17b3279","line":1770,"in_reply_to":"3fce034c_11d6f1c4","updated":"2019-04-18 00:33:59.000000000","message":"This must mean that the CLI will always have exit code 0 if strict\u003dFalse.","commit_id":"f1485edb99058ee2ac240f9f37ba7de481c39dc8"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"a90a2e0803aae8c5fc41a14870a424d13e1d0784","unresolved":false,"context_lines":[{"line_number":1767,"context_line":"        self.assertEqual(self.commands.discover_hosts(strict\u003dTrue), 1)"},{"line_number":1768,"context_line":""},{"line_number":1769,"context_line":"        # Check the return when strict\u003dFalse"},{"line_number":1770,"context_line":"        self.assertIsNone(self.commands.discover_hosts())"},{"line_number":1771,"context_line":""},{"line_number":1772,"context_line":"    @mock.patch(\u0027nova.objects.host_mapping.discover_hosts\u0027)"},{"line_number":1773,"context_line":"    def test_discover_hosts_by_service(self, mock_discover_hosts):"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fce034c_f711a705","line":1770,"in_reply_to":"3fce034c_b17b3279","updated":"2019-04-18 08:46:57.000000000","message":"oh does it ? then shouldn\u0027t this be an assertEqual with a 0 ?","commit_id":"f1485edb99058ee2ac240f9f37ba7de481c39dc8"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"8f86cff29207cbc2c43817f85034ba70952a2ce1","unresolved":false,"context_lines":[{"line_number":1782,"context_line":"    def test_discover_hosts_mapping_exists(self, mock_discover_hosts):"},{"line_number":1783,"context_line":"        mock_discover_hosts.side_effect \u003d exception.HostMappingExists("},{"line_number":1784,"context_line":"            name\u003d\u0027fake\u0027)"},{"line_number":1785,"context_line":"        ret \u003d self.commands.discover_hosts()"},{"line_number":1786,"context_line":"        output \u003d self.output.getvalue().strip()"},{"line_number":1787,"context_line":"        self.assertEqual(1, ret)"},{"line_number":1788,"context_line":"        expected \u003d (\"ERROR: Duplicate host mapping was encountered. This \""}],"source_content_type":"text/x-python","patch_set":3,"id":"3fce034c_b1e4bdad","line":1785,"updated":"2019-04-16 12:14:36.000000000","message":"and this is again strict\u003dFalse case for which we will have 1 as a return code for this special case.","commit_id":"f1485edb99058ee2ac240f9f37ba7de481c39dc8"}]}
