)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":23811,"name":"Oliver Walsh","email":"owalsh@redhat.com","username":"owalsh"},"change_message_id":"28b5f88043b5a9e7924e872e13a6f8fc7651e32d","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"DNM/WIP: Add multistack support to tripleo-ansible-inventory"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"If tripleo-ansible-inventory is called with \u0027--stack foo,bar\u0027,"},{"line_number":10,"context_line":"then build an inventory for stack foo and stack bar; then"},{"line_number":11,"context_line":"merge the two inventories into one before writing it out to"},{"line_number":12,"context_line":"an inventory file."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"7faddb67_72bf21aa","line":9,"range":{"start_line":9,"start_character":3,"end_line":9,"end_character":28},"updated":"2019-08-13 16:14:42.000000000","message":"should we move this to tripleo-ansible?","commit_id":"aa2663601a08cb8d17742e9ab2b9a441a85e5d84"},{"author":{"_account_id":18002,"name":"John Fulton","email":"fulton@redhat.com","username":"fultonj"},"change_message_id":"91859b6c61373025c15e7f4e29a67e2bc3f48b5f","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"DNM/WIP: Add multistack support to tripleo-ansible-inventory"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"If tripleo-ansible-inventory is called with \u0027--stack foo,bar\u0027,"},{"line_number":10,"context_line":"then build an inventory for stack foo and stack bar; then"},{"line_number":11,"context_line":"merge the two inventories into one before writing it out to"},{"line_number":12,"context_line":"an inventory file."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"7faddb67_df063c86","line":9,"range":{"start_line":9,"start_character":3,"end_line":9,"end_character":28},"in_reply_to":"7faddb67_72bf21aa","updated":"2019-08-27 15:20:27.000000000","message":"I was going to write the inventory merging code into this script for now but once it was working I was going to move it to tripleo-common and then modify this calling script to import that library.\n\ntripleo-ansible doesn\u0027t seem to have any CLI tools at the moment AFAICT. I could move it there though. Or maybe this calling script should go in tripleo-common? Do we want the ability to backport it to versions which preceded tripleo-ansible?","commit_id":"aa2663601a08cb8d17742e9ab2b9a441a85e5d84"}],"scripts/tripleo-ansible-inventory":[{"author":{"_account_id":23811,"name":"Oliver Walsh","email":"owalsh@redhat.com","username":"owalsh"},"change_message_id":"a1705584cd8ba3829199ad5a5b615ad0ee428617","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    cfg.StrOpt(\u0027project-name\u0027, default\u003dos.environ.get("},{"line_number":47,"context_line":"        \u0027OS_PROJECT_NAME\u0027, os.environ.get(\u0027OS_TENANT_NAME\u0027))),"},{"line_number":48,"context_line":"    cfg.StrOpt(\u0027cacert\u0027, default\u003dos.environ.get(\u0027OS_CACERT\u0027)),"},{"line_number":49,"context_line":"    cfg.StrOpt(\u0027plan\u0027, default\u003dos.environ.get(\u0027TRIPLEO_PLAN_NAME\u0027),"},{"line_number":50,"context_line":"               help\u003d(\u0027stack name(s) to use for generating the \u0027"},{"line_number":51,"context_line":"                     \u0027inventory data. If a comma delimited list \u0027"},{"line_number":52,"context_line":"                     \u0027of stacks is passed, the inventory will \u0027"}],"source_content_type":"application/octet-stream","patch_set":1,"id":"9fb8cfa7_7fdf9765","line":49,"range":{"start_line":49,"start_character":4,"end_line":49,"end_character":14},"updated":"2019-06-27 14:37:56.000000000","message":"maybe change this to a MultiStrOpt or ListOpt instead of splitting it below","commit_id":"aa2663601a08cb8d17742e9ab2b9a441a85e5d84"},{"author":{"_account_id":18002,"name":"John Fulton","email":"fulton@redhat.com","username":"fultonj"},"change_message_id":"91859b6c61373025c15e7f4e29a67e2bc3f48b5f","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    cfg.StrOpt(\u0027project-name\u0027, default\u003dos.environ.get("},{"line_number":47,"context_line":"        \u0027OS_PROJECT_NAME\u0027, os.environ.get(\u0027OS_TENANT_NAME\u0027))),"},{"line_number":48,"context_line":"    cfg.StrOpt(\u0027cacert\u0027, default\u003dos.environ.get(\u0027OS_CACERT\u0027)),"},{"line_number":49,"context_line":"    cfg.StrOpt(\u0027plan\u0027, default\u003dos.environ.get(\u0027TRIPLEO_PLAN_NAME\u0027),"},{"line_number":50,"context_line":"               help\u003d(\u0027stack name(s) to use for generating the \u0027"},{"line_number":51,"context_line":"                     \u0027inventory data. If a comma delimited list \u0027"},{"line_number":52,"context_line":"                     \u0027of stacks is passed, the inventory will \u0027"}],"source_content_type":"application/octet-stream","patch_set":1,"id":"7faddb67_7ab5d67d","line":49,"range":{"start_line":49,"start_character":4,"end_line":49,"end_character":14},"in_reply_to":"9fb8cfa7_7fdf9765","updated":"2019-08-27 15:20:27.000000000","message":"Done","commit_id":"aa2663601a08cb8d17742e9ab2b9a441a85e5d84"},{"author":{"_account_id":18002,"name":"John Fulton","email":"fulton@redhat.com","username":"fultonj"},"change_message_id":"8dd336b1e4d323391c08ad728506625992fa747e","unresolved":false,"context_lines":[{"line_number":126,"context_line":"        return invs[invs.keys()[0]]"},{"line_number":127,"context_line":"    ret \u003d OrderedDict()"},{"line_number":128,"context_line":"    for stack, inv_obj in invs.items():"},{"line_number":129,"context_line":"        inv \u003d inv_obj.list()"},{"line_number":130,"context_line":"        #print(stack, \" --\u003e\", json.dumps(inv, indent\u003d2))"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"        # only want one undercloud, shouldn\u0027t matter which"}],"source_content_type":"application/octet-stream","patch_set":5,"id":"7faddb67_5e578e27","line":129,"range":{"start_line":129,"start_character":14,"end_line":129,"end_character":28},"updated":"2019-08-29 03:05:48.000000000","message":"If I call the list() function [1] inside of this merge code, then I get something very close to the data structure I had in mind [2].\n\nHowever, I need to move things around because the list() function isn\u0027t really called much until [3].\n\n\n[1] https://opendev.org/openstack/tripleo-common/src/branch/master/tripleo_common/inventory.py#L156\n\n[2] http://paste.openstack.org/show/766655/\n\n[3] https://opendev.org/openstack/tripleo-common/src/branch/master/tripleo_common/inventory.py#L358","commit_id":"c8e2ba6f71aabcfe9bcb09c46ef78f1ce61cd245"},{"author":{"_account_id":18002,"name":"John Fulton","email":"fulton@redhat.com","username":"fultonj"},"change_message_id":"8dd336b1e4d323391c08ad728506625992fa747e","unresolved":false,"context_lines":[{"line_number":188,"context_line":"            undercloud_key_file\u003dconfigs.undercloud_key_file,"},{"line_number":189,"context_line":"            host_network\u003dconfigs.ssh_network,"},{"line_number":190,"context_line":"            serial\u003dconfigs.serial)"},{"line_number":191,"context_line":"    inventory \u003d inventory_merge(inventories)"},{"line_number":192,"context_line":""},{"line_number":193,"context_line":"    if configs.list:"},{"line_number":194,"context_line":"        try:"}],"source_content_type":"application/octet-stream","patch_set":5,"id":"7faddb67_fe143a4f","line":191,"range":{"start_line":191,"start_character":4,"end_line":191,"end_character":13},"updated":"2019-08-29 03:05:48.000000000","message":"If the inventory_merge function above is going to work as implied here, then it would need to work without calling the inventory object list() method.","commit_id":"c8e2ba6f71aabcfe9bcb09c46ef78f1ce61cd245"},{"author":{"_account_id":18002,"name":"John Fulton","email":"fulton@redhat.com","username":"fultonj"},"change_message_id":"8dd336b1e4d323391c08ad728506625992fa747e","unresolved":false,"context_lines":[{"line_number":202,"context_line":"            sys.exit(1)"},{"line_number":203,"context_line":"    elif configs.static_yaml_inventory:"},{"line_number":204,"context_line":"        try:"},{"line_number":205,"context_line":"            inventory.write_static_inventory(configs.static_yaml_inventory)"},{"line_number":206,"context_line":"        except Exception as e:"},{"line_number":207,"context_line":"            print(\"Error creating static inventory: {}\".format(e),"},{"line_number":208,"context_line":"                  file\u003dsys.stderr)"},{"line_number":209,"context_line":"            if configs.debug:"},{"line_number":210,"context_line":"                traceback.print_exc()"},{"line_number":211,"context_line":"            sys.exit(1)"}],"source_content_type":"application/octet-stream","patch_set":5,"id":"7faddb67_803e00b7","line":208,"range":{"start_line":205,"start_character":0,"end_line":208,"end_character":34},"updated":"2019-08-29 03:05:48.000000000","message":"With the updated inventory from the new inventory_merge() function, I\u0027m hitting this exception [1]. Need to reorganize and think of how to merge from within the inventory object\u0027s write_static_inventory method. Will probably need to depends-on a patch to triple-common next.\n\n[1]\n(undercloud) [stack@undercloud tripleo-validations]$ ./scripts/tripleo-ansible-inventory --static-yaml-inventory inventory.yaml --stack central,edge0 \nError creating static inventory: \u0027OrderedDict\u0027 object has no attribute \u0027write_static_inventory\u0027\n(undercloud) [stack@undercloud tripleo-validations]$ \n\n[2] https://opendev.org/openstack/tripleo-common/src/branch/master/tripleo_common/inventory.py#L358","commit_id":"c8e2ba6f71aabcfe9bcb09c46ef78f1ce61cd245"},{"author":{"_account_id":23811,"name":"Oliver Walsh","email":"owalsh@redhat.com","username":"owalsh"},"change_message_id":"2131ba83776da7a5e24299b28373a641dfa6f314","unresolved":false,"context_lines":[{"line_number":161,"context_line":""},{"line_number":162,"context_line":"    if configs.list:"},{"line_number":163,"context_line":"        try:"},{"line_number":164,"context_line":"            inventory_list \u003d inventory.list()"},{"line_number":165,"context_line":"            print(json.dumps(inventory_list))"},{"line_number":166,"context_line":"        except Exception as e:"},{"line_number":167,"context_line":"            print(\"ERROR: Error creating inventory: {}\".format(e),"}],"source_content_type":"application/octet-stream","patch_set":8,"id":"7faddb67_570e4c32","line":164,"range":{"start_line":164,"start_character":29,"end_line":164,"end_character":45},"updated":"2019-09-03 15:10:20.000000000","message":"this will fail when len \u003e 1","commit_id":"6a2c791476125a02142983f4551bf04a54657d02"},{"author":{"_account_id":18002,"name":"John Fulton","email":"fulton@redhat.com","username":"fultonj"},"change_message_id":"9b24b8715904e3eb78da5e06d3b7005ee39222c5","unresolved":false,"context_lines":[{"line_number":161,"context_line":""},{"line_number":162,"context_line":"    if configs.list:"},{"line_number":163,"context_line":"        try:"},{"line_number":164,"context_line":"            inventory_list \u003d inventory.list()"},{"line_number":165,"context_line":"            print(json.dumps(inventory_list))"},{"line_number":166,"context_line":"        except Exception as e:"},{"line_number":167,"context_line":"            print(\"ERROR: Error creating inventory: {}\".format(e),"}],"source_content_type":"application/octet-stream","patch_set":8,"id":"7faddb67_9e7615d8","line":164,"range":{"start_line":164,"start_character":29,"end_line":164,"end_character":45},"in_reply_to":"7faddb67_570e4c32","updated":"2019-09-04 04:46:01.000000000","message":"Done","commit_id":"6a2c791476125a02142983f4551bf04a54657d02"},{"author":{"_account_id":23811,"name":"Oliver Walsh","email":"owalsh@redhat.com","username":"owalsh"},"change_message_id":"bdc6fafccf5c628c39c6fcb8d06e4e7fb31cc5aa","unresolved":false,"context_lines":[{"line_number":182,"context_line":"                traceback.print_exc()"},{"line_number":183,"context_line":"            sys.exit(1)"},{"line_number":184,"context_line":"    elif configs.host:"},{"line_number":185,"context_line":"        print(json.dumps(inventory.host()))"},{"line_number":186,"context_line":"    sys.exit(0)"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":8,"id":"7faddb67_b774609d","line":185,"range":{"start_line":185,"start_character":25,"end_line":185,"end_character":34},"updated":"2019-09-03 15:10:51.000000000","message":"here too","commit_id":"6a2c791476125a02142983f4551bf04a54657d02"},{"author":{"_account_id":18002,"name":"John Fulton","email":"fulton@redhat.com","username":"fultonj"},"change_message_id":"9b24b8715904e3eb78da5e06d3b7005ee39222c5","unresolved":false,"context_lines":[{"line_number":182,"context_line":"                traceback.print_exc()"},{"line_number":183,"context_line":"            sys.exit(1)"},{"line_number":184,"context_line":"    elif configs.host:"},{"line_number":185,"context_line":"        print(json.dumps(inventory.host()))"},{"line_number":186,"context_line":"    sys.exit(0)"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":8,"id":"7faddb67_be7191e0","line":185,"range":{"start_line":185,"start_character":25,"end_line":185,"end_character":34},"in_reply_to":"7faddb67_b774609d","updated":"2019-09-04 04:46:01.000000000","message":"Done","commit_id":"6a2c791476125a02142983f4551bf04a54657d02"},{"author":{"_account_id":14985,"name":"Alex Schultz","email":"aschultz@next-development.com","username":"mwhahaha"},"change_message_id":"c7f92fe528a4c38ff9c7697e56c39e5bc366c9c2","unresolved":false,"context_lines":[{"line_number":152,"context_line":"            host_network\u003dconfigs.ssh_network,"},{"line_number":153,"context_line":"            serial\u003dconfigs.serial)"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"    if len(inventory_map.keys()) \u003d\u003d 1:"},{"line_number":156,"context_line":"        inventory \u003d inventory_map[inventory_map.keys()[0]]"},{"line_number":157,"context_line":"    else:"},{"line_number":158,"context_line":"        inventories \u003d invs.TripleoInventories(inventory_map)"}],"source_content_type":"application/octet-stream","patch_set":11,"id":"7faddb67_91d82252","line":155,"range":{"start_line":155,"start_character":7,"end_line":155,"end_character":37},"updated":"2019-09-05 13:55:00.000000000","message":"why not use a var for this rather than calling .keys 3 different times","commit_id":"3ac2b3333e46e3013f47ff8f7f3a2d49b7c2fc32"},{"author":{"_account_id":18002,"name":"John Fulton","email":"fulton@redhat.com","username":"fultonj"},"change_message_id":"8d25fd79656112b0e5a9769a8f74a2b2d94055c7","unresolved":false,"context_lines":[{"line_number":152,"context_line":"            host_network\u003dconfigs.ssh_network,"},{"line_number":153,"context_line":"            serial\u003dconfigs.serial)"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"    if len(inventory_map.keys()) \u003d\u003d 1:"},{"line_number":156,"context_line":"        inventory \u003d inventory_map[inventory_map.keys()[0]]"},{"line_number":157,"context_line":"    else:"},{"line_number":158,"context_line":"        inventories \u003d invs.TripleoInventories(inventory_map)"}],"source_content_type":"application/octet-stream","patch_set":11,"id":"7faddb67_4ce1acfb","line":155,"range":{"start_line":155,"start_character":7,"end_line":155,"end_character":37},"in_reply_to":"7faddb67_91d82252","updated":"2019-09-05 16:20:52.000000000","message":"Done","commit_id":"3ac2b3333e46e3013f47ff8f7f3a2d49b7c2fc32"},{"author":{"_account_id":14985,"name":"Alex Schultz","email":"aschultz@next-development.com","username":"mwhahaha"},"change_message_id":"c7f92fe528a4c38ff9c7697e56c39e5bc366c9c2","unresolved":false,"context_lines":[{"line_number":160,"context_line":""},{"line_number":161,"context_line":"    if configs.list:"},{"line_number":162,"context_line":"        try:"},{"line_number":163,"context_line":"            if len(inventory_map.keys()) \u003d\u003d 1:"},{"line_number":164,"context_line":"                inventory_list \u003d inventory.list()"},{"line_number":165,"context_line":"                print(json.dumps(inventory_list))"},{"line_number":166,"context_line":"            else:"},{"line_number":167,"context_line":"                print(json.dumps(inventories.inventory))"},{"line_number":168,"context_line":"        except Exception as e:"},{"line_number":169,"context_line":"            print(\"ERROR: Error creating inventory: {}\".format(e),"},{"line_number":170,"context_line":"                  file\u003dsys.stderr)"}],"source_content_type":"application/octet-stream","patch_set":11,"id":"7faddb67_91b10204","line":167,"range":{"start_line":163,"start_character":0,"end_line":167,"end_character":56},"updated":"2019-09-05 13:55:00.000000000","message":"Since this is the only one where the call is different, it think perhaps we should just set inventory always and then just do a different bit of logic here depending on if .keys() is \u003e 1","commit_id":"3ac2b3333e46e3013f47ff8f7f3a2d49b7c2fc32"},{"author":{"_account_id":18002,"name":"John Fulton","email":"fulton@redhat.com","username":"fultonj"},"change_message_id":"8d25fd79656112b0e5a9769a8f74a2b2d94055c7","unresolved":false,"context_lines":[{"line_number":160,"context_line":""},{"line_number":161,"context_line":"    if configs.list:"},{"line_number":162,"context_line":"        try:"},{"line_number":163,"context_line":"            if len(inventory_map.keys()) \u003d\u003d 1:"},{"line_number":164,"context_line":"                inventory_list \u003d inventory.list()"},{"line_number":165,"context_line":"                print(json.dumps(inventory_list))"},{"line_number":166,"context_line":"            else:"},{"line_number":167,"context_line":"                print(json.dumps(inventories.inventory))"},{"line_number":168,"context_line":"        except Exception as e:"},{"line_number":169,"context_line":"            print(\"ERROR: Error creating inventory: {}\".format(e),"},{"line_number":170,"context_line":"                  file\u003dsys.stderr)"}],"source_content_type":"application/octet-stream","patch_set":11,"id":"7faddb67_ecebb8d9","line":167,"range":{"start_line":163,"start_character":0,"end_line":167,"end_character":56},"in_reply_to":"7faddb67_91b10204","updated":"2019-09-05 16:20:52.000000000","message":"Done","commit_id":"3ac2b3333e46e3013f47ff8f7f3a2d49b7c2fc32"},{"author":{"_account_id":18002,"name":"John Fulton","email":"fulton@redhat.com","username":"fultonj"},"change_message_id":"8d25fd79656112b0e5a9769a8f74a2b2d94055c7","unresolved":false,"context_lines":[{"line_number":160,"context_line":"    if configs.list:"},{"line_number":161,"context_line":"        try:"},{"line_number":162,"context_line":"            if len(inventory_keys) \u003d\u003d 1:"},{"line_number":163,"context_line":"                inventory_list \u003d inventory.list()"},{"line_number":164,"context_line":"            else:"},{"line_number":165,"context_line":"                inventory_list \u003d inventory.inventory"},{"line_number":166,"context_line":"            print(json.dumps(inventory_list))"}],"source_content_type":"application/octet-stream","patch_set":12,"id":"7faddb67_acd2a032","line":163,"range":{"start_line":163,"start_character":16,"end_line":163,"end_character":49},"updated":"2019-09-05 16:20:52.000000000","message":"I thought of moving this under line 156 but only wanted to call the inventory.list() method if the user passed the --list option. The len() call for a second check here is O(1) so it seemed more efficient to have the second check.","commit_id":"35f3d60dcf0b1bb903543c28506928ec1c765b63"},{"author":{"_account_id":14985,"name":"Alex Schultz","email":"aschultz@next-development.com","username":"mwhahaha"},"change_message_id":"dce023703a44d3bb44484c56a22c3fe33694c563","unresolved":false,"context_lines":[{"line_number":160,"context_line":"    if configs.list:"},{"line_number":161,"context_line":"        try:"},{"line_number":162,"context_line":"            if len(inventory_keys) \u003d\u003d 1:"},{"line_number":163,"context_line":"                inventory_list \u003d inventory.list()"},{"line_number":164,"context_line":"            else:"},{"line_number":165,"context_line":"                inventory_list \u003d inventory.inventory"},{"line_number":166,"context_line":"            print(json.dumps(inventory_list))"}],"source_content_type":"application/octet-stream","patch_set":12,"id":"7faddb67_2ca2309b","line":163,"range":{"start_line":163,"start_character":16,"end_line":163,"end_character":49},"in_reply_to":"7faddb67_acd2a032","updated":"2019-09-05 16:24:57.000000000","message":"Yea this is fine. It was really the multiple .keys calls that we didn\u0027t need to be doing","commit_id":"35f3d60dcf0b1bb903543c28506928ec1c765b63"}]}
