{"action":"opened","number":28435,"pull_request":{"url":"https://api.github.com/repos/saltstack/salt/pulls/28435","id":49258448,"html_url":"https://github.com/saltstack/salt/pull/28435","diff_url":"https://github.com/saltstack/salt/pull/28435.diff","patch_url":"https://github.com/saltstack/salt/pull/28435.patch","issue_url":"https://api.github.com/repos/saltstack/salt/issues/28435","number":28435,"state":"open","locked":false,"title":"Fix pillar.json serialisation for salt-ssh.","user":{"login":"bryce-gibson","id":7877411,"avatar_url":"https://avatars.githubusercontent.com/u/7877411?v=3","gravatar_id":"","url":"https://api.github.com/users/bryce-gibson","html_url":"https://github.com/bryce-gibson","followers_url":"https://api.github.com/users/bryce-gibson/followers","following_url":"https://api.github.com/users/bryce-gibson/following{/other_user}","gists_url":"https://api.github.com/users/bryce-gibson/gists{/gist_id}","starred_url":"https://api.github.com/users/bryce-gibson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bryce-gibson/subscriptions","organizations_url":"https://api.github.com/users/bryce-gibson/orgs","repos_url":"https://api.github.com/users/bryce-gibson/repos","events_url":"https://api.github.com/users/bryce-gibson/events{/privacy}","received_events_url":"https://api.github.com/users/bryce-gibson/received_events","type":"User","site_admin":false},"body":"I was getting squify results from salt-ssh (pillar data wasn't loading in jinja templates) and tracked it down to pillar.json only containing `{}` in the state tar.\r\n\r\nAfter much `print`-ing :-p I tracked it down to the `NamespacedDictWrapper` used in the salt ssh wrapper not `json.dumps`-ing correctly (eg `print(json.dumps(__pillar__))` was `{}`, but `print(json.dumps(__pillar__['some-key']))` worked (iirc).\r\n\r\nLooking at NamespacedDictWrapper I saw the `_dict()` method which returns a real dict, which then serialises correctly.\r\n\r\nQuick python eg:\r\n\r\n```\r\n> python2                                                                                                                                                                      \r\nPython 2.7.10 (default, Sep  7 2015, 13:51:49) \r\n[GCC 5.2.0] on linux2\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> from salt.utils.context import NamespacedDictWrapper\r\n>>> a = NamespacedDictWrapper({\"pillar\": { \"asd\": \"dsa\" }}, 'pillar')\r\n>>> import json\r\n>>> json.dumps(a)\r\n'{}'\r\n>>> json.dumps(a._dict())\r\n'{\"asd\": \"dsa\"}'\r\n>>> \r\n```\r\n\r\nThis patch fixes this issue for me? :-s (not really sure what I'm doing :-p so I may be way off base :-) (and sorry for the noise if I am :-) ))","created_at":"2015-10-30T11:30:15Z","updated_at":"2015-10-30T11:30:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/saltstack/salt/pulls/28435/commits","review_comments_url":"https://api.github.com/repos/saltstack/salt/pulls/28435/comments","review_comment_url":"https://api.github.com/repos/saltstack/salt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/28435/comments","statuses_url":"https://api.github.com/repos/saltstack/salt/statuses/f2e52a86d5e359e8c3cc7e6bad3ef4fc16a84939","head":{"label":"bryce-gibson:salt-ssh-pillar","ref":"salt-ssh-pillar","sha":"f2e52a86d5e359e8c3cc7e6bad3ef4fc16a84939","user":{"login":"bryce-gibson","id":7877411,"avatar_url":"https://avatars.githubusercontent.com/u/7877411?v=3","gravatar_id":"","url":"https://api.github.com/users/bryce-gibson","html_url":"https://github.com/bryce-gibson","followers_url":"https://api.github.com/users/bryce-gibson/followers","following_url":"https://api.github.com/users/bryce-gibson/following{/other_user}","gists_url":"https://api.github.com/users/bryce-gibson/gists{/gist_id}","starred_url":"https://api.github.com/users/bryce-gibson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bryce-gibson/subscriptions","organizations_url":"https://api.github.com/users/bryce-gibson/orgs","repos_url":"https://api.github.com/users/bryce-gibson/repos","events_url":"https://api.github.com/users/bryce-gibson/events{/privacy}","received_events_url":"https://api.github.com/users/bryce-gibson/received_events","type":"User","site_admin":false},"repo":{"id":44940251,"name":"salt","full_name":"bryce-gibson/salt","owner":{"login":"bryce-gibson","id":7877411,"avatar_url":"https://avatars.githubusercontent.com/u/7877411?v=3","gravatar_id":"","url":"https://api.github.com/users/bryce-gibson","html_url":"https://github.com/bryce-gibson","followers_url":"https://api.github.com/users/bryce-gibson/followers","following_url":"https://api.github.com/users/bryce-gibson/following{/other_user}","gists_url":"https://api.github.com/users/bryce-gibson/gists{/gist_id}","starred_url":"https://api.github.com/users/bryce-gibson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bryce-gibson/subscriptions","organizations_url":"https://api.github.com/users/bryce-gibson/orgs","repos_url":"https://api.github.com/users/bryce-gibson/repos","events_url":"https://api.github.com/users/bryce-gibson/events{/privacy}","received_events_url":"https://api.github.com/users/bryce-gibson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bryce-gibson/salt","description":"Infrastructure automation and management system","fork":true,"url":"https://api.github.com/repos/bryce-gibson/salt","forks_url":"https://api.github.com/repos/bryce-gibson/salt/forks","keys_url":"https://api.github.com/repos/bryce-gibson/salt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bryce-gibson/salt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bryce-gibson/salt/teams","hooks_url":"https://api.github.com/repos/bryce-gibson/salt/hooks","issue_events_url":"https://api.github.com/repos/bryce-gibson/salt/issues/events{/number}","events_url":"https://api.github.com/repos/bryce-gibson/salt/events","assignees_url":"https://api.github.com/repos/bryce-gibson/salt/assignees{/user}","branches_url":"https://api.github.com/repos/bryce-gibson/salt/branches{/branch}","tags_url":"https://api.github.com/repos/bryce-gibson/salt/tags","blobs_url":"https://api.github.com/repos/bryce-gibson/salt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bryce-gibson/salt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bryce-gibson/salt/git/refs{/sha}","trees_url":"https://api.github.com/repos/bryce-gibson/salt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bryce-gibson/salt/statuses/{sha}","languages_url":"https://api.github.com/repos/bryce-gibson/salt/languages","stargazers_url":"https://api.github.com/repos/bryce-gibson/salt/stargazers","contributors_url":"https://api.github.com/repos/bryce-gibson/salt/contributors","subscribers_url":"https://api.github.com/repos/bryce-gibson/salt/subscribers","subscription_url":"https://api.github.com/repos/bryce-gibson/salt/subscription","commits_url":"https://api.github.com/repos/bryce-gibson/salt/commits{/sha}","git_commits_url":"https://api.github.com/repos/bryce-gibson/salt/git/commits{/sha}","comments_url":"https://api.github.com/repos/bryce-gibson/salt/comments{/number}","issue_comment_url":"https://api.github.com/repos/bryce-gibson/salt/issues/comments{/number}","contents_url":"https://api.github.com/repos/bryce-gibson/salt/contents/{+path}","compare_url":"https://api.github.com/repos/bryce-gibson/salt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bryce-gibson/salt/merges","archive_url":"https://api.github.com/repos/bryce-gibson/salt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bryce-gibson/salt/downloads","issues_url":"https://api.github.com/repos/bryce-gibson/salt/issues{/number}","pulls_url":"https://api.github.com/repos/bryce-gibson/salt/pulls{/number}","milestones_url":"https://api.github.com/repos/bryce-gibson/salt/milestones{/number}","notifications_url":"https://api.github.com/repos/bryce-gibson/salt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bryce-gibson/salt/labels{/name}","releases_url":"https://api.github.com/repos/bryce-gibson/salt/releases{/id}","created_at":"2015-10-26T02:06:36Z","updated_at":"2015-10-26T02:06:59Z","pushed_at":"2015-10-30T11:24:14Z","git_url":"git://github.com/bryce-gibson/salt.git","ssh_url":"git@github.com:bryce-gibson/salt.git","clone_url":"https://github.com/bryce-gibson/salt.git","svn_url":"https://github.com/bryce-gibson/salt","homepage":"saltstack.com","size":125944,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"saltstack:develop","ref":"develop","sha":"a3abab13aae6852f03ab7156032ea8cea3d394cd","user":{"login":"saltstack","id":1147473,"avatar_url":"https://avatars.githubusercontent.com/u/1147473?v=3","gravatar_id":"","url":"https://api.github.com/users/saltstack","html_url":"https://github.com/saltstack","followers_url":"https://api.github.com/users/saltstack/followers","following_url":"https://api.github.com/users/saltstack/following{/other_user}","gists_url":"https://api.github.com/users/saltstack/gists{/gist_id}","starred_url":"https://api.github.com/users/saltstack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saltstack/subscriptions","organizations_url":"https://api.github.com/users/saltstack/orgs","repos_url":"https://api.github.com/users/saltstack/repos","events_url":"https://api.github.com/users/saltstack/events{/privacy}","received_events_url":"https://api.github.com/users/saltstack/received_events","type":"Organization","site_admin":false},"repo":{"id":1390248,"name":"salt","full_name":"saltstack/salt","owner":{"login":"saltstack","id":1147473,"avatar_url":"https://avatars.githubusercontent.com/u/1147473?v=3","gravatar_id":"","url":"https://api.github.com/users/saltstack","html_url":"https://github.com/saltstack","followers_url":"https://api.github.com/users/saltstack/followers","following_url":"https://api.github.com/users/saltstack/following{/other_user}","gists_url":"https://api.github.com/users/saltstack/gists{/gist_id}","starred_url":"https://api.github.com/users/saltstack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saltstack/subscriptions","organizations_url":"https://api.github.com/users/saltstack/orgs","repos_url":"https://api.github.com/users/saltstack/repos","events_url":"https://api.github.com/users/saltstack/events{/privacy}","received_events_url":"https://api.github.com/users/saltstack/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/saltstack/salt","description":"Infrastructure automation and management system","fork":false,"url":"https://api.github.com/repos/saltstack/salt","forks_url":"https://api.github.com/repos/saltstack/salt/forks","keys_url":"https://api.github.com/repos/saltstack/salt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/saltstack/salt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/saltstack/salt/teams","hooks_url":"https://api.github.com/repos/saltstack/salt/hooks","issue_events_url":"https://api.github.com/repos/saltstack/salt/issues/events{/number}","events_url":"https://api.github.com/repos/saltstack/salt/events","assignees_url":"https://api.github.com/repos/saltstack/salt/assignees{/user}","branches_url":"https://api.github.com/repos/saltstack/salt/branches{/branch}","tags_url":"https://api.github.com/repos/saltstack/salt/tags","blobs_url":"https://api.github.com/repos/saltstack/salt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/saltstack/salt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/saltstack/salt/git/refs{/sha}","trees_url":"https://api.github.com/repos/saltstack/salt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/saltstack/salt/statuses/{sha}","languages_url":"https://api.github.com/repos/saltstack/salt/languages","stargazers_url":"https://api.github.com/repos/saltstack/salt/stargazers","contributors_url":"https://api.github.com/repos/saltstack/salt/contributors","subscribers_url":"https://api.github.com/repos/saltstack/salt/subscribers","subscription_url":"https://api.github.com/repos/saltstack/salt/subscription","commits_url":"https://api.github.com/repos/saltstack/salt/commits{/sha}","git_commits_url":"https://api.github.com/repos/saltstack/salt/git/commits{/sha}","comments_url":"https://api.github.com/repos/saltstack/salt/comments{/number}","issue_comment_url":"https://api.github.com/repos/saltstack/salt/issues/comments{/number}","contents_url":"https://api.github.com/repos/saltstack/salt/contents/{+path}","compare_url":"https://api.github.com/repos/saltstack/salt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/saltstack/salt/merges","archive_url":"https://api.github.com/repos/saltstack/salt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/saltstack/salt/downloads","issues_url":"https://api.github.com/repos/saltstack/salt/issues{/number}","pulls_url":"https://api.github.com/repos/saltstack/salt/pulls{/number}","milestones_url":"https://api.github.com/repos/saltstack/salt/milestones{/number}","notifications_url":"https://api.github.com/repos/saltstack/salt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/saltstack/salt/labels{/name}","releases_url":"https://api.github.com/repos/saltstack/salt/releases{/id}","created_at":"2011-02-20T20:16:56Z","updated_at":"2015-10-30T08:09:37Z","pushed_at":"2015-10-30T10:59:10Z","git_url":"git://github.com/saltstack/salt.git","ssh_url":"git@github.com:saltstack/salt.git","clone_url":"https://github.com/saltstack/salt.git","svn_url":"https://github.com/saltstack/salt","homepage":"saltstack.com","size":256308,"stargazers_count":5818,"watchers_count":5818,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2480,"mirror_url":null,"open_issues_count":3062,"forks":2480,"open_issues":3062,"watchers":5818,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/saltstack/salt/pulls/28435"},"html":{"href":"https://github.com/saltstack/salt/pull/28435"},"issue":{"href":"https://api.github.com/repos/saltstack/salt/issues/28435"},"comments":{"href":"https://api.github.com/repos/saltstack/salt/issues/28435/comments"},"review_comments":{"href":"https://api.github.com/repos/saltstack/salt/pulls/28435/comments"},"review_comment":{"href":"https://api.github.com/repos/saltstack/salt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/saltstack/salt/pulls/28435/commits"},"statuses":{"href":"https://api.github.com/repos/saltstack/salt/statuses/f2e52a86d5e359e8c3cc7e6bad3ef4fc16a84939"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":1,"deletions":1,"changed_files":1}}