)]}'
{"tests/test_inventory.py":[{"author":{"_account_id":12892,"name":"Nolan Brubaker","email":"nolan.brubaker@rackspace.com","username":"nrb"},"change_message_id":"757018182ca310bb4c03c1e2990a6fd67da45bff","unresolved":false,"context_lines":[{"line_number":14,"context_line":""},{"line_number":15,"context_line":"# We\u0027ll use the test directory, and have tox do the cd command for us."},{"line_number":16,"context_line":"TARGET_DIR \u003d path.join(os.getcwd(), \u0027inventory\u0027)"},{"line_number":17,"context_line":"USER_CONFGI_FILE \u003d path.join(TARGET_DIR, \"openstack_user_config.yml\")"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"# These files will be placed in TARGET_DIR by INV_SCRIPT."},{"line_number":20,"context_line":"# They should be cleaned up between each test."}],"source_content_type":"text/x-python","patch_set":1,"id":"5aef4532_181a986e","line":17,"range":{"start_line":17,"start_character":5,"end_line":17,"end_character":11},"updated":"2016-03-08 21:53:35.000000000","message":"*CONFIG\n\nAll other references should probably be updated, too.","commit_id":"1ad8b38cff3ee293dbb9d1ec8bce7c7cfa5c8714"},{"author":{"_account_id":12892,"name":"Nolan Brubaker","email":"nolan.brubaker@rackspace.com","username":"nrb"},"change_message_id":"757018182ca310bb4c03c1e2990a6fd67da45bff","unresolved":false,"context_lines":[{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def test_provider_networks_check(self):"},{"line_number":83,"context_line":"        overrides \u003d self.user_defined_config.get(\u0027global_overrides\u0027)"},{"line_number":84,"context_line":"        # delete provider networns"},{"line_number":85,"context_line":"        del overrides[\u0027provider_networks\u0027]"},{"line_number":86,"context_line":"        # rename temporarily our user_config_file so we can use the new one"},{"line_number":87,"context_line":"        os.rename(USER_CONFGI_FILE, USER_CONFGI_FILE + \".tmp\")"}],"source_content_type":"text/x-python","patch_set":1,"id":"5aef4532_c545e970","line":84,"range":{"start_line":84,"start_character":26,"end_line":84,"end_character":34},"updated":"2016-03-08 21:53:35.000000000","message":"networks*","commit_id":"1ad8b38cff3ee293dbb9d1ec8bce7c7cfa5c8714"},{"author":{"_account_id":12892,"name":"Nolan Brubaker","email":"nolan.brubaker@rackspace.com","username":"nrb"},"change_message_id":"757018182ca310bb4c03c1e2990a6fd67da45bff","unresolved":false,"context_lines":[{"line_number":80,"context_line":"            self.user_defined_config.update(yaml.safe_load(f.read()) or {})"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def test_provider_networks_check(self):"},{"line_number":83,"context_line":"        overrides \u003d self.user_defined_config.get(\u0027global_overrides\u0027)"},{"line_number":84,"context_line":"        # delete provider networns"},{"line_number":85,"context_line":"        del overrides[\u0027provider_networks\u0027]"},{"line_number":86,"context_line":"        # rename temporarily our user_config_file so we can use the new one"},{"line_number":87,"context_line":"        os.rename(USER_CONFGI_FILE, USER_CONFGI_FILE + \".tmp\")"},{"line_number":88,"context_line":"        # Save new user_config_file"},{"line_number":89,"context_line":"        with open(USER_CONFGI_FILE, \u0027wb\u0027) as f:"},{"line_number":90,"context_line":"            f.write(yaml.dump(self.user_defined_config))"},{"line_number":91,"context_line":"        # check if provider networks absence is Caught"},{"line_number":92,"context_line":"        with self.assertRaises(subprocess.CalledProcessError) as context:"},{"line_number":93,"context_line":"            get_inventory()"}],"source_content_type":"text/x-python","patch_set":1,"id":"5aef4532_651cd577","line":90,"range":{"start_line":83,"start_character":4,"end_line":90,"end_character":56},"updated":"2016-03-08 21:53:35.000000000","message":"Could some of this be factored out into a helper function? Perhaps one that takes the overrides and a key to delete, then does this work, so that it\u0027s less repetition in the test itself.","commit_id":"1ad8b38cff3ee293dbb9d1ec8bce7c7cfa5c8714"},{"author":{"_account_id":12892,"name":"Nolan Brubaker","email":"nolan.brubaker@rackspace.com","username":"nrb"},"change_message_id":"7abc18d911fa2190ff51fcf815e335374165630f","unresolved":false,"context_lines":[{"line_number":84,"context_line":"        elif key in user_defined_config[\u0027global_overrides\u0027]:"},{"line_number":85,"context_line":"            del user_defined_config[\u0027global_overrides\u0027][key]"},{"line_number":86,"context_line":"        else:"},{"line_number":87,"context_line":"            raise SystemExit(\"can\u0027t find specified key in user config\")"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"        # rename temporarily our user_config_file so we can use the new one"},{"line_number":90,"context_line":"        os.rename(USER_CONFIG_FILE, USER_CONFIG_FILE + \".tmp\")"}],"source_content_type":"text/x-python","patch_set":3,"id":"5aef4532_3a259108","line":87,"updated":"2016-03-09 17:14:20.000000000","message":"I think I would suggest raising a KeyError exception here rather than SystemExit; it\u0027s more specific to the intent. The previous `del` lines will produce a KeyError when they don\u0027t find the key in the dict, and I think this is providing basically that same functionality.","commit_id":"0c88a18125f1f4336698ea1758a13553ac89ad95"},{"author":{"_account_id":12892,"name":"Nolan Brubaker","email":"nolan.brubaker@rackspace.com","username":"nrb"},"change_message_id":"a936b6dc822652a48fcbaed43c20e13cdc8a4f5a","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        self.setup_config_file(self.user_defined_config, \u0027provider_networks\u0027)"},{"line_number":98,"context_line":"        # check if provider networks absence is Caught"},{"line_number":99,"context_line":"        with self.assertRaises(subprocess.CalledProcessError) as context:"},{"line_number":100,"context_line":"            get_inventory()"},{"line_number":101,"context_line":"        expectedLog \u003d \"provider networks can\u0027t be found under global_overrides\""},{"line_number":102,"context_line":"        self.assertTrue(expectedLog in context.exception.output)"},{"line_number":103,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5aef4532_c0959c33","line":100,"updated":"2016-03-09 17:32:45.000000000","message":"Testing the whole inventory function here might be too big - ideally, the test would only run against _check_config_settings. That way, a whole new temp file wouldn\u0027t be necessary. Instead, the self.user_defined_config dictionary could be passed in directly.\n\nIt would, however, require that the cidr_networks and container skeleton get populated from the existing config file.","commit_id":"0c88a18125f1f4336698ea1758a13553ac89ad95"},{"author":{"_account_id":12892,"name":"Nolan Brubaker","email":"nolan.brubaker@rackspace.com","username":"nrb"},"change_message_id":"17a6fbda0abeb5d3b6dba56867e6009e3fbf05b7","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        self.setup_config_file(self.user_defined_config, \u0027provider_networks\u0027)"},{"line_number":98,"context_line":"        # check if provider networks absence is Caught"},{"line_number":99,"context_line":"        with self.assertRaises(subprocess.CalledProcessError) as context:"},{"line_number":100,"context_line":"            get_inventory()"},{"line_number":101,"context_line":"        expectedLog \u003d \"provider networks can\u0027t be found under global_overrides\""},{"line_number":102,"context_line":"        self.assertTrue(expectedLog in context.exception.output)"},{"line_number":103,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5aef4532_80f71458","line":100,"in_reply_to":"5aef4532_c0959c33","updated":"2016-03-09 17:36:17.000000000","message":"Ah, right - a lot of that logic is in the main function of the dynamic inventory, I forgot.\n\nI still think what I said in the previous comment would be ideal, but that\u0027s probably for a future refactor where more of the inventory logic is split up.","commit_id":"0c88a18125f1f4336698ea1758a13553ac89ad95"},{"author":{"_account_id":12892,"name":"Nolan Brubaker","email":"nolan.brubaker@rackspace.com","username":"nrb"},"change_message_id":"6cb92ba1a5fd072dbf4e09e9e55865fc9d4ef393","unresolved":false,"context_lines":[{"line_number":113,"context_line":"    def tearDown(self):"},{"line_number":114,"context_line":"        # get back our initial user config file"},{"line_number":115,"context_line":"        os.remove(USER_CONFIG_FILE)"},{"line_number":116,"context_line":"        os.rename(USER_CONFIG_FILE + \".tmp\", USER_CONFIG_FILE)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"if __name__ \u003d\u003d \u0027__main__\u0027:"}],"source_content_type":"text/x-python","patch_set":3,"id":"5aef4532_40406c34","line":116,"updated":"2016-03-09 17:29:12.000000000","message":"Testing out the missing key portion above, tearDown will throw an OSError if the SystemExit is triggered beofre the tmp file is made.\n\nMaybe this line should be wrapped in a try/except.","commit_id":"0c88a18125f1f4336698ea1758a13553ac89ad95"}]}
