{"action":"created","comment":{"url":"https://api.github.com/repos/nmstate/nmstate/pulls/comments/226088764","pull_request_review_id":165829190,"id":226088764,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNjA4ODc2NA==","diff_hunk":"@@ -98,6 +125,77 @@ def _filter_state(state, whitelist):\n     return state\n \n \n+def edit(args):\n+    state = _filter_state(netinfo.show(), args.only)\n+\n+    if args.yaml:\n+        suffix = '.yaml'\n+        txtstate = pretty_yaml(state)\n+    else:\n+        suffix = '.json'\n+        txtstate = pretty_json(state)\n+    with tempfile.NamedTemporaryFile(suffix=suffix,\n+                                     prefix='nmstate-') as statefile:\n+        statefile.write(txtstate)\n+        statefile.flush()\n+\n+        while True:\n+            txtstate = run_editor(txtstate, suffix)","path":"nmstatectl/nmstatectl.py","position":null,"original_position":85,"commit_id":"b3d311997db71d621d9b75fe408cf9d41ca11cce","original_commit_id":"5ece1aa251c669fe4e5c9f8d8170bcdff2205be1","user":{"login":"tyll","id":197720,"node_id":"MDQ6VXNlcjE5NzcyMA==","avatar_url":"https://avatars2.githubusercontent.com/u/197720?v=4","gravatar_id":"","url":"https://api.github.com/users/tyll","html_url":"https://github.com/tyll","followers_url":"https://api.github.com/users/tyll/followers","following_url":"https://api.github.com/users/tyll/following{/other_user}","gists_url":"https://api.github.com/users/tyll/gists{/gist_id}","starred_url":"https://api.github.com/users/tyll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tyll/subscriptions","organizations_url":"https://api.github.com/users/tyll/orgs","repos_url":"https://api.github.com/users/tyll/repos","events_url":"https://api.github.com/users/tyll/events{/privacy}","received_events_url":"https://api.github.com/users/tyll/received_events","type":"User","site_admin":false},"body":"fixed","created_at":"2018-10-17T20:47:55Z","updated_at":"2018-10-17T20:47:55Z","html_url":"https://github.com/nmstate/nmstate/pull/73#discussion_r226088764","pull_request_url":"https://api.github.com/repos/nmstate/nmstate/pulls/73","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/nmstate/nmstate/pulls/comments/226088764"},"html":{"href":"https://github.com/nmstate/nmstate/pull/73#discussion_r226088764"},"pull_request":{"href":"https://api.github.com/repos/nmstate/nmstate/pulls/73"}},"in_reply_to_id":225862850},"pull_request":{"url":"https://api.github.com/repos/nmstate/nmstate/pulls/73","id":214338075,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE0MzM4MDc1","html_url":"https://github.com/nmstate/nmstate/pull/73","diff_url":"https://github.com/nmstate/nmstate/pull/73.diff","patch_url":"https://github.com/nmstate/nmstate/pull/73.patch","issue_url":"https://api.github.com/repos/nmstate/nmstate/issues/73","number":73,"state":"open","locked":false,"title":"nmstatectl: Add edit command to edit state","user":{"login":"tyll","id":197720,"node_id":"MDQ6VXNlcjE5NzcyMA==","avatar_url":"https://avatars2.githubusercontent.com/u/197720?v=4","gravatar_id":"","url":"https://api.github.com/users/tyll","html_url":"https://github.com/tyll","followers_url":"https://api.github.com/users/tyll/followers","following_url":"https://api.github.com/users/tyll/following{/other_user}","gists_url":"https://api.github.com/users/tyll/gists{/gist_id}","starred_url":"https://api.github.com/users/tyll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tyll/subscriptions","organizations_url":"https://api.github.com/users/tyll/orgs","repos_url":"https://api.github.com/users/tyll/repos","events_url":"https://api.github.com/users/tyll/events{/privacy}","received_events_url":"https://api.github.com/users/tyll/received_events","type":"User","site_admin":false},"body":"Use EDITOR variable to open an editor with the current state and apply\r\nit after the editor is closed.","created_at":"2018-09-10T14:40:22Z","updated_at":"2018-10-17T20:47:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b0bd938fa1eb81730e5d2a2e3437cde3607dc1bd","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/nmstate/nmstate/pulls/73/commits","review_comments_url":"https://api.github.com/repos/nmstate/nmstate/pulls/73/comments","review_comment_url":"https://api.github.com/repos/nmstate/nmstate/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nmstate/nmstate/issues/73/comments","statuses_url":"https://api.github.com/repos/nmstate/nmstate/statuses/b3d311997db71d621d9b75fe408cf9d41ca11cce","head":{"label":"tyll:edit-cmd","ref":"edit-cmd","sha":"b3d311997db71d621d9b75fe408cf9d41ca11cce","user":{"login":"tyll","id":197720,"node_id":"MDQ6VXNlcjE5NzcyMA==","avatar_url":"https://avatars2.githubusercontent.com/u/197720?v=4","gravatar_id":"","url":"https://api.github.com/users/tyll","html_url":"https://github.com/tyll","followers_url":"https://api.github.com/users/tyll/followers","following_url":"https://api.github.com/users/tyll/following{/other_user}","gists_url":"https://api.github.com/users/tyll/gists{/gist_id}","starred_url":"https://api.github.com/users/tyll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tyll/subscriptions","organizations_url":"https://api.github.com/users/tyll/orgs","repos_url":"https://api.github.com/users/tyll/repos","events_url":"https://api.github.com/users/tyll/events{/privacy}","received_events_url":"https://api.github.com/users/tyll/received_events","type":"User","site_admin":false},"repo":{"id":133372837,"node_id":"MDEwOlJlcG9zaXRvcnkxMzMzNzI4Mzc=","name":"nmstate","full_name":"tyll/nmstate","private":false,"owner":{"login":"tyll","id":197720,"node_id":"MDQ6VXNlcjE5NzcyMA==","avatar_url":"https://avatars2.githubusercontent.com/u/197720?v=4","gravatar_id":"","url":"https://api.github.com/users/tyll","html_url":"https://github.com/tyll","followers_url":"https://api.github.com/users/tyll/followers","following_url":"https://api.github.com/users/tyll/following{/other_user}","gists_url":"https://api.github.com/users/tyll/gists{/gist_id}","starred_url":"https://api.github.com/users/tyll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tyll/subscriptions","organizations_url":"https://api.github.com/users/tyll/orgs","repos_url":"https://api.github.com/users/tyll/repos","events_url":"https://api.github.com/users/tyll/events{/privacy}","received_events_url":"https://api.github.com/users/tyll/received_events","type":"User","site_admin":false},"html_url":"https://github.com/tyll/nmstate","description":null,"fork":true,"url":"https://api.github.com/repos/tyll/nmstate","forks_url":"https://api.github.com/repos/tyll/nmstate/forks","keys_url":"https://api.github.com/repos/tyll/nmstate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tyll/nmstate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tyll/nmstate/teams","hooks_url":"https://api.github.com/repos/tyll/nmstate/hooks","issue_events_url":"https://api.github.com/repos/tyll/nmstate/issues/events{/number}","events_url":"https://api.github.com/repos/tyll/nmstate/events","assignees_url":"https://api.github.com/repos/tyll/nmstate/assignees{/user}","branches_url":"https://api.github.com/repos/tyll/nmstate/branches{/branch}","tags_url":"https://api.github.com/repos/tyll/nmstate/tags","blobs_url":"https://api.github.com/repos/tyll/nmstate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tyll/nmstate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tyll/nmstate/git/refs{/sha}","trees_url":"https://api.github.com/repos/tyll/nmstate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tyll/nmstate/statuses/{sha}","languages_url":"https://api.github.com/repos/tyll/nmstate/languages","stargazers_url":"https://api.github.com/repos/tyll/nmstate/stargazers","contributors_url":"https://api.github.com/repos/tyll/nmstate/contributors","subscribers_url":"https://api.github.com/repos/tyll/nmstate/subscribers","subscription_url":"https://api.github.com/repos/tyll/nmstate/subscription","commits_url":"https://api.github.com/repos/tyll/nmstate/commits{/sha}","git_commits_url":"https://api.github.com/repos/tyll/nmstate/git/commits{/sha}","comments_url":"https://api.github.com/repos/tyll/nmstate/comments{/number}","issue_comment_url":"https://api.github.com/repos/tyll/nmstate/issues/comments{/number}","contents_url":"https://api.github.com/repos/tyll/nmstate/contents/{+path}","compare_url":"https://api.github.com/repos/tyll/nmstate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tyll/nmstate/merges","archive_url":"https://api.github.com/repos/tyll/nmstate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tyll/nmstate/downloads","issues_url":"https://api.github.com/repos/tyll/nmstate/issues{/number}","pulls_url":"https://api.github.com/repos/tyll/nmstate/pulls{/number}","milestones_url":"https://api.github.com/repos/tyll/nmstate/milestones{/number}","notifications_url":"https://api.github.com/repos/tyll/nmstate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tyll/nmstate/labels{/name}","releases_url":"https://api.github.com/repos/tyll/nmstate/releases{/id}","deployments_url":"https://api.github.com/repos/tyll/nmstate/deployments","created_at":"2018-05-14T14:22:28Z","updated_at":"2018-10-17T20:39:22Z","pushed_at":"2018-10-17T20:47:52Z","git_url":"git://github.com/tyll/nmstate.git","ssh_url":"git@github.com:tyll/nmstate.git","clone_url":"https://github.com/tyll/nmstate.git","svn_url":"https://github.com/tyll/nmstate","homepage":null,"size":201,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"nmstate:master","ref":"master","sha":"21a65cdb8f0f446145ad482b648549aab1cd77b9","user":{"login":"nmstate","id":39068239,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM5MDY4MjM5","avatar_url":"https://avatars0.githubusercontent.com/u/39068239?v=4","gravatar_id":"","url":"https://api.github.com/users/nmstate","html_url":"https://github.com/nmstate","followers_url":"https://api.github.com/users/nmstate/followers","following_url":"https://api.github.com/users/nmstate/following{/other_user}","gists_url":"https://api.github.com/users/nmstate/gists{/gist_id}","starred_url":"https://api.github.com/users/nmstate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmstate/subscriptions","organizations_url":"https://api.github.com/users/nmstate/orgs","repos_url":"https://api.github.com/users/nmstate/repos","events_url":"https://api.github.com/users/nmstate/events{/privacy}","received_events_url":"https://api.github.com/users/nmstate/received_events","type":"Organization","site_admin":false},"repo":{"id":132556280,"node_id":"MDEwOlJlcG9zaXRvcnkxMzI1NTYyODA=","name":"nmstate","full_name":"nmstate/nmstate","private":false,"owner":{"login":"nmstate","id":39068239,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM5MDY4MjM5","avatar_url":"https://avatars0.githubusercontent.com/u/39068239?v=4","gravatar_id":"","url":"https://api.github.com/users/nmstate","html_url":"https://github.com/nmstate","followers_url":"https://api.github.com/users/nmstate/followers","following_url":"https://api.github.com/users/nmstate/following{/other_user}","gists_url":"https://api.github.com/users/nmstate/gists{/gist_id}","starred_url":"https://api.github.com/users/nmstate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmstate/subscriptions","organizations_url":"https://api.github.com/users/nmstate/orgs","repos_url":"https://api.github.com/users/nmstate/repos","events_url":"https://api.github.com/users/nmstate/events{/privacy}","received_events_url":"https://api.github.com/users/nmstate/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/nmstate/nmstate","description":"A declarative network manager API for hosts","fork":false,"url":"https://api.github.com/repos/nmstate/nmstate","forks_url":"https://api.github.com/repos/nmstate/nmstate/forks","keys_url":"https://api.github.com/repos/nmstate/nmstate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nmstate/nmstate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nmstate/nmstate/teams","hooks_url":"https://api.github.com/repos/nmstate/nmstate/hooks","issue_events_url":"https://api.github.com/repos/nmstate/nmstate/issues/events{/number}","events_url":"https://api.github.com/repos/nmstate/nmstate/events","assignees_url":"https://api.github.com/repos/nmstate/nmstate/assignees{/user}","branches_url":"https://api.github.com/repos/nmstate/nmstate/branches{/branch}","tags_url":"https://api.github.com/repos/nmstate/nmstate/tags","blobs_url":"https://api.github.com/repos/nmstate/nmstate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nmstate/nmstate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nmstate/nmstate/git/refs{/sha}","trees_url":"https://api.github.com/repos/nmstate/nmstate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nmstate/nmstate/statuses/{sha}","languages_url":"https://api.github.com/repos/nmstate/nmstate/languages","stargazers_url":"https://api.github.com/repos/nmstate/nmstate/stargazers","contributors_url":"https://api.github.com/repos/nmstate/nmstate/contributors","subscribers_url":"https://api.github.com/repos/nmstate/nmstate/subscribers","subscription_url":"https://api.github.com/repos/nmstate/nmstate/subscription","commits_url":"https://api.github.com/repos/nmstate/nmstate/commits{/sha}","git_commits_url":"https://api.github.com/repos/nmstate/nmstate/git/commits{/sha}","comments_url":"https://api.github.com/repos/nmstate/nmstate/comments{/number}","issue_comment_url":"https://api.github.com/repos/nmstate/nmstate/issues/comments{/number}","contents_url":"https://api.github.com/repos/nmstate/nmstate/contents/{+path}","compare_url":"https://api.github.com/repos/nmstate/nmstate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nmstate/nmstate/merges","archive_url":"https://api.github.com/repos/nmstate/nmstate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nmstate/nmstate/downloads","issues_url":"https://api.github.com/repos/nmstate/nmstate/issues{/number}","pulls_url":"https://api.github.com/repos/nmstate/nmstate/pulls{/number}","milestones_url":"https://api.github.com/repos/nmstate/nmstate/milestones{/number}","notifications_url":"https://api.github.com/repos/nmstate/nmstate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nmstate/nmstate/labels{/name}","releases_url":"https://api.github.com/repos/nmstate/nmstate/releases{/id}","deployments_url":"https://api.github.com/repos/nmstate/nmstate/deployments","created_at":"2018-05-08T05:02:22Z","updated_at":"2018-10-17T09:34:09Z","pushed_at":"2018-10-17T20:47:54Z","git_url":"git://github.com/nmstate/nmstate.git","ssh_url":"git@github.com:nmstate/nmstate.git","clone_url":"https://github.com/nmstate/nmstate.git","svn_url":"https://github.com/nmstate/nmstate","homepage":"https://nmstate.github.io","size":168,"stargazers_count":5,"watchers_count":5,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"archived":false,"open_issues_count":20,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":5,"open_issues":20,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nmstate/nmstate/pulls/73"},"html":{"href":"https://github.com/nmstate/nmstate/pull/73"},"issue":{"href":"https://api.github.com/repos/nmstate/nmstate/issues/73"},"comments":{"href":"https://api.github.com/repos/nmstate/nmstate/issues/73/comments"},"review_comments":{"href":"https://api.github.com/repos/nmstate/nmstate/pulls/73/comments"},"review_comment":{"href":"https://api.github.com/repos/nmstate/nmstate/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nmstate/nmstate/pulls/73/commits"},"statuses":{"href":"https://api.github.com/repos/nmstate/nmstate/statuses/b3d311997db71d621d9b75fe408cf9d41ca11cce"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"tyll"}}