{"action":"opened","number":65,"pull_request":{"url":"https://api.github.com/repos/arista-eosplus/ansible-eos/pulls/65","id":45730222,"html_url":"https://github.com/arista-eosplus/ansible-eos/pull/65","diff_url":"https://github.com/arista-eosplus/ansible-eos/pull/65.diff","patch_url":"https://github.com/arista-eosplus/ansible-eos/pull/65.patch","issue_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/issues/65","number":65,"state":"open","locked":false,"title":"Added encoding option to command module.","user":{"login":"chepazzo","id":1101764,"avatar_url":"https://avatars.githubusercontent.com/u/1101764?v=3","gravatar_id":"","url":"https://api.github.com/users/chepazzo","html_url":"https://github.com/chepazzo","followers_url":"https://api.github.com/users/chepazzo/followers","following_url":"https://api.github.com/users/chepazzo/following{/other_user}","gists_url":"https://api.github.com/users/chepazzo/gists{/gist_id}","starred_url":"https://api.github.com/users/chepazzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chepazzo/subscriptions","organizations_url":"https://api.github.com/users/chepazzo/orgs","repos_url":"https://api.github.com/users/chepazzo/repos","events_url":"https://api.github.com/users/chepazzo/events{/privacy}","received_events_url":"https://api.github.com/users/chepazzo/received_events","type":"User","site_admin":false},"body":"When performing tasks like creating a snapshot of device configs in a lab (e.g. to automate switching between different topologies), the json structure is difficult to render into a readable configuration.\r\n\r\ne.g. With multiple nested levels, the structure isn't ordered, so you end up with something like this:\r\n\r\n```json\r\n{ \"management api http-commands\": {\r\n                                \"cmds\": {\r\n                                    \"vrf MGMT\": {\r\n                                        \"cmds\": {\r\n                                            \"no shutdown\": null\r\n                                        }, \r\n                                        \"comments\": []\r\n                                    },\r\n                                    \"no shutdown\": null, \r\n                                    \"no protocol https\": null, \r\n                                    \"protocol http\": null, \r\n                                }, \r\n                                \"comments\": []\r\n                            }\r\n}\r\n```\r\n\r\nwhich results in:\r\n```\r\nmanagement api http-commands\r\n  vrf MGMT\r\n    no shutdown\r\n  no shutdown\r\n  no protocol https\r\n  protocol http\r\n```\r\n\r\nwithout adding a lot of complex code that has prior knowledge of what the ordering **should** be.","created_at":"2015-09-22T23:33:27Z","updated_at":"2015-09-22T23:33:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c8481b9f51b800d76b310c6777e7822a4dff0fdd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/pulls/65/commits","review_comments_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/pulls/65/comments","review_comment_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/pulls/comments{/number}","comments_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/issues/65/comments","statuses_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/statuses/fe29afd03a54586e47fe24a04e4f3a689a23b674","head":{"label":"chepazzo:command_encoding","ref":"command_encoding","sha":"fe29afd03a54586e47fe24a04e4f3a689a23b674","user":{"login":"chepazzo","id":1101764,"avatar_url":"https://avatars.githubusercontent.com/u/1101764?v=3","gravatar_id":"","url":"https://api.github.com/users/chepazzo","html_url":"https://github.com/chepazzo","followers_url":"https://api.github.com/users/chepazzo/followers","following_url":"https://api.github.com/users/chepazzo/following{/other_user}","gists_url":"https://api.github.com/users/chepazzo/gists{/gist_id}","starred_url":"https://api.github.com/users/chepazzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chepazzo/subscriptions","organizations_url":"https://api.github.com/users/chepazzo/orgs","repos_url":"https://api.github.com/users/chepazzo/repos","events_url":"https://api.github.com/users/chepazzo/events{/privacy}","received_events_url":"https://api.github.com/users/chepazzo/received_events","type":"User","site_admin":false},"repo":{"id":38436411,"name":"ansible-eos","full_name":"chepazzo/ansible-eos","owner":{"login":"chepazzo","id":1101764,"avatar_url":"https://avatars.githubusercontent.com/u/1101764?v=3","gravatar_id":"","url":"https://api.github.com/users/chepazzo","html_url":"https://github.com/chepazzo","followers_url":"https://api.github.com/users/chepazzo/followers","following_url":"https://api.github.com/users/chepazzo/following{/other_user}","gists_url":"https://api.github.com/users/chepazzo/gists{/gist_id}","starred_url":"https://api.github.com/users/chepazzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chepazzo/subscriptions","organizations_url":"https://api.github.com/users/chepazzo/orgs","repos_url":"https://api.github.com/users/chepazzo/repos","events_url":"https://api.github.com/users/chepazzo/events{/privacy}","received_events_url":"https://api.github.com/users/chepazzo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chepazzo/ansible-eos","description":"Ansible role that provides modules for managing resources on Arista EOS nodes.  Please see http://galaxy.ansible.com for more details","fork":true,"url":"https://api.github.com/repos/chepazzo/ansible-eos","forks_url":"https://api.github.com/repos/chepazzo/ansible-eos/forks","keys_url":"https://api.github.com/repos/chepazzo/ansible-eos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chepazzo/ansible-eos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chepazzo/ansible-eos/teams","hooks_url":"https://api.github.com/repos/chepazzo/ansible-eos/hooks","issue_events_url":"https://api.github.com/repos/chepazzo/ansible-eos/issues/events{/number}","events_url":"https://api.github.com/repos/chepazzo/ansible-eos/events","assignees_url":"https://api.github.com/repos/chepazzo/ansible-eos/assignees{/user}","branches_url":"https://api.github.com/repos/chepazzo/ansible-eos/branches{/branch}","tags_url":"https://api.github.com/repos/chepazzo/ansible-eos/tags","blobs_url":"https://api.github.com/repos/chepazzo/ansible-eos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chepazzo/ansible-eos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chepazzo/ansible-eos/git/refs{/sha}","trees_url":"https://api.github.com/repos/chepazzo/ansible-eos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chepazzo/ansible-eos/statuses/{sha}","languages_url":"https://api.github.com/repos/chepazzo/ansible-eos/languages","stargazers_url":"https://api.github.com/repos/chepazzo/ansible-eos/stargazers","contributors_url":"https://api.github.com/repos/chepazzo/ansible-eos/contributors","subscribers_url":"https://api.github.com/repos/chepazzo/ansible-eos/subscribers","subscription_url":"https://api.github.com/repos/chepazzo/ansible-eos/subscription","commits_url":"https://api.github.com/repos/chepazzo/ansible-eos/commits{/sha}","git_commits_url":"https://api.github.com/repos/chepazzo/ansible-eos/git/commits{/sha}","comments_url":"https://api.github.com/repos/chepazzo/ansible-eos/comments{/number}","issue_comment_url":"https://api.github.com/repos/chepazzo/ansible-eos/issues/comments{/number}","contents_url":"https://api.github.com/repos/chepazzo/ansible-eos/contents/{+path}","compare_url":"https://api.github.com/repos/chepazzo/ansible-eos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chepazzo/ansible-eos/merges","archive_url":"https://api.github.com/repos/chepazzo/ansible-eos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chepazzo/ansible-eos/downloads","issues_url":"https://api.github.com/repos/chepazzo/ansible-eos/issues{/number}","pulls_url":"https://api.github.com/repos/chepazzo/ansible-eos/pulls{/number}","milestones_url":"https://api.github.com/repos/chepazzo/ansible-eos/milestones{/number}","notifications_url":"https://api.github.com/repos/chepazzo/ansible-eos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chepazzo/ansible-eos/labels{/name}","releases_url":"https://api.github.com/repos/chepazzo/ansible-eos/releases{/id}","created_at":"2015-07-02T14:09:41Z","updated_at":"2015-07-02T14:09:41Z","pushed_at":"2015-09-22T23:23:14Z","git_url":"git://github.com/chepazzo/ansible-eos.git","ssh_url":"git@github.com:chepazzo/ansible-eos.git","clone_url":"https://github.com/chepazzo/ansible-eos.git","svn_url":"https://github.com/chepazzo/ansible-eos","homepage":null,"size":2012,"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":"arista-eosplus:develop","ref":"develop","sha":"3f95d9ff4707bd7c08b01be942eceff249229630","user":{"login":"arista-eosplus","id":6643264,"avatar_url":"https://avatars.githubusercontent.com/u/6643264?v=3","gravatar_id":"","url":"https://api.github.com/users/arista-eosplus","html_url":"https://github.com/arista-eosplus","followers_url":"https://api.github.com/users/arista-eosplus/followers","following_url":"https://api.github.com/users/arista-eosplus/following{/other_user}","gists_url":"https://api.github.com/users/arista-eosplus/gists{/gist_id}","starred_url":"https://api.github.com/users/arista-eosplus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arista-eosplus/subscriptions","organizations_url":"https://api.github.com/users/arista-eosplus/orgs","repos_url":"https://api.github.com/users/arista-eosplus/repos","events_url":"https://api.github.com/users/arista-eosplus/events{/privacy}","received_events_url":"https://api.github.com/users/arista-eosplus/received_events","type":"Organization","site_admin":false},"repo":{"id":23003910,"name":"ansible-eos","full_name":"arista-eosplus/ansible-eos","owner":{"login":"arista-eosplus","id":6643264,"avatar_url":"https://avatars.githubusercontent.com/u/6643264?v=3","gravatar_id":"","url":"https://api.github.com/users/arista-eosplus","html_url":"https://github.com/arista-eosplus","followers_url":"https://api.github.com/users/arista-eosplus/followers","following_url":"https://api.github.com/users/arista-eosplus/following{/other_user}","gists_url":"https://api.github.com/users/arista-eosplus/gists{/gist_id}","starred_url":"https://api.github.com/users/arista-eosplus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arista-eosplus/subscriptions","organizations_url":"https://api.github.com/users/arista-eosplus/orgs","repos_url":"https://api.github.com/users/arista-eosplus/repos","events_url":"https://api.github.com/users/arista-eosplus/events{/privacy}","received_events_url":"https://api.github.com/users/arista-eosplus/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/arista-eosplus/ansible-eos","description":"Ansible role that provides modules for managing resources on Arista EOS nodes.  Please see http://galaxy.ansible.com for more details","fork":false,"url":"https://api.github.com/repos/arista-eosplus/ansible-eos","forks_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/forks","keys_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/teams","hooks_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/hooks","issue_events_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/issues/events{/number}","events_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/events","assignees_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/assignees{/user}","branches_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/branches{/branch}","tags_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/tags","blobs_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/git/refs{/sha}","trees_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/statuses/{sha}","languages_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/languages","stargazers_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/stargazers","contributors_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/contributors","subscribers_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/subscribers","subscription_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/subscription","commits_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/commits{/sha}","git_commits_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/git/commits{/sha}","comments_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/comments{/number}","issue_comment_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/issues/comments{/number}","contents_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/contents/{+path}","compare_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/merges","archive_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/downloads","issues_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/issues{/number}","pulls_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/pulls{/number}","milestones_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/milestones{/number}","notifications_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/labels{/name}","releases_url":"https://api.github.com/repos/arista-eosplus/ansible-eos/releases{/id}","created_at":"2014-08-15T21:43:58Z","updated_at":"2015-09-02T15:04:24Z","pushed_at":"2015-09-22T23:33:27Z","git_url":"git://github.com/arista-eosplus/ansible-eos.git","ssh_url":"git@github.com:arista-eosplus/ansible-eos.git","clone_url":"https://github.com/arista-eosplus/ansible-eos.git","svn_url":"https://github.com/arista-eosplus/ansible-eos","homepage":null,"size":2575,"stargazers_count":22,"watchers_count":22,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":10,"forks":11,"open_issues":10,"watchers":22,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/arista-eosplus/ansible-eos/pulls/65"},"html":{"href":"https://github.com/arista-eosplus/ansible-eos/pull/65"},"issue":{"href":"https://api.github.com/repos/arista-eosplus/ansible-eos/issues/65"},"comments":{"href":"https://api.github.com/repos/arista-eosplus/ansible-eos/issues/65/comments"},"review_comments":{"href":"https://api.github.com/repos/arista-eosplus/ansible-eos/pulls/65/comments"},"review_comment":{"href":"https://api.github.com/repos/arista-eosplus/ansible-eos/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/arista-eosplus/ansible-eos/pulls/65/commits"},"statuses":{"href":"https://api.github.com/repos/arista-eosplus/ansible-eos/statuses/fe29afd03a54586e47fe24a04e4f3a689a23b674"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":12,"deletions":2,"changed_files":1}}