{"action":"created","issue":{"url":"https://api.github.com/repos/sampsyo/confuse/issues/32","repository_url":"https://api.github.com/repos/sampsyo/confuse","labels_url":"https://api.github.com/repos/sampsyo/confuse/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/sampsyo/confuse/issues/32/comments","events_url":"https://api.github.com/repos/sampsyo/confuse/issues/32/events","html_url":"https://github.com/sampsyo/confuse/issues/32","id":163580402,"number":32,"title":"Nested yaml element override via argparse","user":{"login":"Toure","id":306878,"avatar_url":"https://avatars.githubusercontent.com/u/306878?v=3","gravatar_id":"","url":"https://api.github.com/users/Toure","html_url":"https://github.com/Toure","followers_url":"https://api.github.com/users/Toure/followers","following_url":"https://api.github.com/users/Toure/following{/other_user}","gists_url":"https://api.github.com/users/Toure/gists{/gist_id}","starred_url":"https://api.github.com/users/Toure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Toure/subscriptions","organizations_url":"https://api.github.com/users/Toure/orgs","repos_url":"https://api.github.com/users/Toure/repos","events_url":"https://api.github.com/users/Toure/events{/privacy}","received_events_url":"https://api.github.com/users/Toure/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-07-03T21:20:20Z","updated_at":"2016-07-14T10:08:45Z","closed_at":null,"body":"I have run into a limitaion or misconfiguration with confuse in regards to nested element lookup within a yaml file when using the following structure:\r\n\r\nconfig.yaml\r\n\r\n```YAML\r\nlogging:\r\n  log_dir: '/tmp/foo'\r\n```\r\n\r\nconfig_test.py\r\n\r\n```Python\r\nconfig = confuse.Configuration('Cli_Test', config.__name__)\r\nparser = argparse.ArgumentParser()\r\nparser.add_argument(\"-lf\", \"--log_files\", dest='log_dir', help=\"Path specified for log files.\")\r\nargs = parser.parse_args()\r\nconfig.set_args(args)\r\nprint(config['logging']['log_dir'].get())  # <-- confuse can not find the second level element.\r\n```\r\n\r\nIs this a known issue or did I mis-use the config object?"},"comment":{"url":"https://api.github.com/repos/sampsyo/confuse/issues/comments/232623296","html_url":"https://github.com/sampsyo/confuse/issues/32#issuecomment-232623296","issue_url":"https://api.github.com/repos/sampsyo/confuse/issues/32","id":232623296,"user":{"login":"elehcim","id":1649109,"avatar_url":"https://avatars.githubusercontent.com/u/1649109?v=3","gravatar_id":"","url":"https://api.github.com/users/elehcim","html_url":"https://github.com/elehcim","followers_url":"https://api.github.com/users/elehcim/followers","following_url":"https://api.github.com/users/elehcim/following{/other_user}","gists_url":"https://api.github.com/users/elehcim/gists{/gist_id}","starred_url":"https://api.github.com/users/elehcim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elehcim/subscriptions","organizations_url":"https://api.github.com/users/elehcim/orgs","repos_url":"https://api.github.com/users/elehcim/repos","events_url":"https://api.github.com/users/elehcim/events{/privacy}","received_events_url":"https://api.github.com/users/elehcim/received_events","type":"User","site_admin":false},"created_at":"2016-07-14T10:08:45Z","updated_at":"2016-07-14T10:08:45Z","body":"For me it is working as @sampsyo suggested:\r\n```\r\nimport confuse\r\nimport argparse\r\n\r\nconfig = confuse.Configuration('Cli_Test')\r\n\r\nconfig.set_file(\"config.yaml\")  # <-- Did you add the correct config file?\r\n\r\nparser = argparse.ArgumentParser()\r\nparser.add_argument(\"-lf\", \"--log_files\", dest='log_dir', help=\"Path specified for log files.\")\r\nargs = parser.parse_args()\r\nconfig[\"logging\"].set_args(args)\r\n\r\nprint(config[\"logging\"]['log_dir'].get())\r\n```\r\n\r\n    $ python config_test.py\r\n    /tmp/foo\r\n"}}
{"actor":{"display_login":"elehcim"}}