{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/16294","labels_url":"https://api.github.com/repos/saltstack/salt/issues/16294/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/16294/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/16294/events","html_url":"https://github.com/saltstack/salt/issues/16294","id":44594323,"number":16294,"title":"ini_manage: simplify set_option for files without sections","user":{"login":"rominf","id":3449635,"avatar_url":"https://avatars.githubusercontent.com/u/3449635?v=3","gravatar_id":"","url":"https://api.github.com/users/rominf","html_url":"https://github.com/rominf","followers_url":"https://api.github.com/users/rominf/followers","following_url":"https://api.github.com/users/rominf/following{/other_user}","gists_url":"https://api.github.com/users/rominf/gists{/gist_id}","starred_url":"https://api.github.com/users/rominf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rominf/subscriptions","organizations_url":"https://api.github.com/users/rominf/orgs","repos_url":"https://api.github.com/users/rominf/repos","events_url":"https://api.github.com/users/rominf/events{/privacy}","received_events_url":"https://api.github.com/users/rominf/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/saltstack/salt/labels/Feature","name":"Feature","color":"009800"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/saltstack/salt/milestones/13","html_url":"https://github.com/saltstack/salt/milestones/Approved","labels_url":"https://api.github.com/repos/saltstack/salt/milestones/13/labels","id":9265,"number":13,"title":"Approved","description":"All issues that are ready to be worked on, both bugs and features.","creator":{"login":"thatch45","id":507599,"avatar_url":"https://avatars.githubusercontent.com/u/507599?v=3","gravatar_id":"","url":"https://api.github.com/users/thatch45","html_url":"https://github.com/thatch45","followers_url":"https://api.github.com/users/thatch45/followers","following_url":"https://api.github.com/users/thatch45/following{/other_user}","gists_url":"https://api.github.com/users/thatch45/gists{/gist_id}","starred_url":"https://api.github.com/users/thatch45/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thatch45/subscriptions","organizations_url":"https://api.github.com/users/thatch45/orgs","repos_url":"https://api.github.com/users/thatch45/repos","events_url":"https://api.github.com/users/thatch45/events{/privacy}","received_events_url":"https://api.github.com/users/thatch45/received_events","type":"User","site_admin":false},"open_issues":2485,"closed_issues":2516,"state":"open","created_at":"2011-05-14T04:00:56Z","updated_at":"2015-08-25T21:48:04Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2014-10-01T17:48:56Z","updated_at":"2015-08-25T21:48:04Z","closed_at":"2015-08-25T21:48:04Z","body":"I propose to change:\r\n```\r\nsalt '*' ini.set_option ./file/without/sections '{DEFAULT_IMPLICIT: {key: value}}'\r\n```\r\nto:\r\n```\r\nsalt '*' ini.set_option ./file/without/sections '{key: value}'\r\n```\r\n\r\nWhy? On the one hand \"explicit is better than implicit\" (as python zen states), on the other hand \"flat is better than nested\". Moreover, all ini files I've seen are either contain sections or not. That means that all values of a dictionary would be either strings or dictionaries. That's why I propose just try to parse the dictionary as a sections container, than, if it fails, add all key-value pairs to ini file."},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/134751423","html_url":"https://github.com/saltstack/salt/issues/16294#issuecomment-134751423","issue_url":"https://api.github.com/repos/saltstack/salt/issues/16294","id":134751423,"user":{"login":"basepi","id":702318,"avatar_url":"https://avatars.githubusercontent.com/u/702318?v=3","gravatar_id":"","url":"https://api.github.com/users/basepi","html_url":"https://github.com/basepi","followers_url":"https://api.github.com/users/basepi/followers","following_url":"https://api.github.com/users/basepi/following{/other_user}","gists_url":"https://api.github.com/users/basepi/gists{/gist_id}","starred_url":"https://api.github.com/users/basepi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basepi/subscriptions","organizations_url":"https://api.github.com/users/basepi/orgs","repos_url":"https://api.github.com/users/basepi/repos","events_url":"https://api.github.com/users/basepi/events{/privacy}","received_events_url":"https://api.github.com/users/basepi/received_events","type":"User","site_admin":false},"created_at":"2015-08-25T21:48:04Z","updated_at":"2015-08-25T21:48:04Z","body":"Fixed in #26359 "}}