{"action":"opened","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/40052","repository_url":"https://api.github.com/repos/saltstack/salt","labels_url":"https://api.github.com/repos/saltstack/salt/issues/40052/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/40052/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/40052/events","html_url":"https://github.com/saltstack/salt/issues/40052","id":214460404,"number":40052,"title":"grains.set Not able to remove sub key","user":{"login":"Maudite","id":1878498,"avatar_url":"https://avatars2.githubusercontent.com/u/1878498?v=3","gravatar_id":"","url":"https://api.github.com/users/Maudite","html_url":"https://github.com/Maudite","followers_url":"https://api.github.com/users/Maudite/followers","following_url":"https://api.github.com/users/Maudite/following{/other_user}","gists_url":"https://api.github.com/users/Maudite/gists{/gist_id}","starred_url":"https://api.github.com/users/Maudite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Maudite/subscriptions","organizations_url":"https://api.github.com/users/Maudite/orgs","repos_url":"https://api.github.com/users/Maudite/repos","events_url":"https://api.github.com/users/Maudite/events{/privacy}","received_events_url":"https://api.github.com/users/Maudite/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-03-15T17:06:30Z","updated_at":"2017-03-15T17:06:30Z","closed_at":null,"body":"### Description of Issue/Question\r\nTrying to remove grain sub key with grains.set destructive=True, but it will only remove the value.\r\n\r\n### Setup\r\nAs per [https://github.com/saltstack/salt/issues/23446](url) it states\r\n\r\n> if level exists and is a dictionary:\r\nupdate existing key or create it\r\nif value is None and destructive=True: remove the key\r\n\r\n### Steps to Reproduce Issue\r\nI'm trying to delete a dictionary grain key (I'm still new, not sure I'm saying this correctly), but seems as though the grains.set destructive=True is not removing the key. It will remove the value, but not the key.\r\n\r\n`psHost01.lab.local:\r\n    ----------\r\n    TC:\r\n        ----------\r\n        environment:\r\n            Devt\r\n        infraHosting:\r\n            EPiC\r\n        serverRoles:\r\n            IaaS\r\n`\r\n\r\n`[root@salt-cloud02 powershell]# salt 'psHost*' grains.set TC:serverRoles destructive=True\r\npsHost01.lab.local:\r\n    ----------\r\n    changes:\r\n        ----------\r\n        TC:\r\n            ----------\r\n            environment:\r\n                Devt\r\n            infraHosting:\r\n                EPiC\r\n            serverRoles:\r\n    comment:\r\n    result:\r\n        True\r\n`\r\n\r\nYou can see with the destructive command, it will remove the value, but not the key. do I have my syntax incorrect? Or is this not working as expected.\r\n\r\n\r\n\r\n### Versions Report\r\n[root@salt-cloud02 powershell]# salt --version\r\nsalt 2016.11.3 (Carbon)\r\n"}}
{"actor":{"display_login":"Maudite"}}