{"action":"created","comment":{"url":"https://api.github.com/repos/ClusterLabs/hawk/pulls/comments/45566261","id":45566261,"diff_hunk":"@@ -145,4 +182,37 @@ def find(id)\n       super(name, 'name')\n     end\n   end\n+\n+  def merge_nvpairs(list, attrs)\n+    if attrs.empty?\n+      # No attributes to set, get rid of the list (if it exists)\n+      xml.elements[list].remove if xml.elements[list]\n+    else\n+      # Get rid of any attributes that are no longer set\n+      if xml.elements[list]\n+        xml.elements[list].elements.each do |el|\n+          el.remove unless attrs.keys.include? el.attributes['name']\n+        end\n+      else\n+        xml.add_element(\n+          list,\n+          \"id\" => \"#{xml.attributes[\"id\"]}-#{list}\")\n+      end\n+\n+      # Write new attributes or update existing ones\n+      attrs.each do |n, v|\n+        nvp = xml.elements[\"#{list}/nvpair[@name=\\\"#{n}\\\"]\"]\n+\n+        if nvp\n+          nvp.attributes[\"value\"] = v\n+        else\n+          xml.elements[list].add_element(\n+            \"nvpair\",\n+            \"id\" => \"#{xml.elements[list].attributes['id']}-#{n}\",","path":"hawk/app/models/node.rb","position":100,"original_position":100,"commit_id":"cbe7c37bfbc9c730705698e1d3fcffa5fbbb71fd","original_commit_id":"cbe7c37bfbc9c730705698e1d3fcffa5fbbb71fd","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Style/StringLiteralsInInterpolation: Prefer double-quoted strings inside interpolations.","created_at":"2015-11-22T22:59:07Z","updated_at":"2015-11-22T22:59:07Z","html_url":"https://github.com/ClusterLabs/hawk/pull/61#discussion_r45566261","pull_request_url":"https://api.github.com/repos/ClusterLabs/hawk/pulls/61","_links":{"self":{"href":"https://api.github.com/repos/ClusterLabs/hawk/pulls/comments/45566261"},"html":{"href":"https://github.com/ClusterLabs/hawk/pull/61#discussion_r45566261"},"pull_request":{"href":"https://api.github.com/repos/ClusterLabs/hawk/pulls/61"}}},"pull_request":{"url":"https://api.github.com/repos/ClusterLabs/hawk/pulls/61","id":51477681,"html_url":"https://github.com/ClusterLabs/hawk/pull/61","diff_url":"https://github.com/ClusterLabs/hawk/pull/61.diff","patch_url":"https://github.com/ClusterLabs/hawk/pull/61.patch","issue_url":"https://api.github.com/repos/ClusterLabs/hawk/issues/61","number":61,"state":"open","locked":false,"title":"Revised UI, new status view, node attribute editing support, etc.","user":{"login":"krig","id":25527,"avatar_url":"https://avatars.githubusercontent.com/u/25527?v=3","gravatar_id":"","url":"https://api.github.com/users/krig","html_url":"https://github.com/krig","followers_url":"https://api.github.com/users/krig/followers","following_url":"https://api.github.com/users/krig/following{/other_user}","gists_url":"https://api.github.com/users/krig/gists{/gist_id}","starred_url":"https://api.github.com/users/krig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krig/subscriptions","organizations_url":"https://api.github.com/users/krig/orgs","repos_url":"https://api.github.com/users/krig/repos","events_url":"https://api.github.com/users/krig/events{/privacy}","received_events_url":"https://api.github.com/users/krig/received_events","type":"User","site_admin":false},"body":"I had a productive weekend, and have been playing around with fixing a bunch of stuff in the UI.\r\n\r\nFeedback / comments are welcome!\r\n","created_at":"2015-11-22T22:58:38Z","updated_at":"2015-11-22T22:59:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"38e0814e9baed657d1688b302cb34ffa745e063a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ClusterLabs/hawk/pulls/61/commits","review_comments_url":"https://api.github.com/repos/ClusterLabs/hawk/pulls/61/comments","review_comment_url":"https://api.github.com/repos/ClusterLabs/hawk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ClusterLabs/hawk/issues/61/comments","statuses_url":"https://api.github.com/repos/ClusterLabs/hawk/statuses/cbe7c37bfbc9c730705698e1d3fcffa5fbbb71fd","head":{"label":"krig:susecon","ref":"susecon","sha":"cbe7c37bfbc9c730705698e1d3fcffa5fbbb71fd","user":{"login":"krig","id":25527,"avatar_url":"https://avatars.githubusercontent.com/u/25527?v=3","gravatar_id":"","url":"https://api.github.com/users/krig","html_url":"https://github.com/krig","followers_url":"https://api.github.com/users/krig/followers","following_url":"https://api.github.com/users/krig/following{/other_user}","gists_url":"https://api.github.com/users/krig/gists{/gist_id}","starred_url":"https://api.github.com/users/krig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krig/subscriptions","organizations_url":"https://api.github.com/users/krig/orgs","repos_url":"https://api.github.com/users/krig/repos","events_url":"https://api.github.com/users/krig/events{/privacy}","received_events_url":"https://api.github.com/users/krig/received_events","type":"User","site_admin":false},"repo":{"id":11468129,"name":"hawk","full_name":"krig/hawk","owner":{"login":"krig","id":25527,"avatar_url":"https://avatars.githubusercontent.com/u/25527?v=3","gravatar_id":"","url":"https://api.github.com/users/krig","html_url":"https://github.com/krig","followers_url":"https://api.github.com/users/krig/followers","following_url":"https://api.github.com/users/krig/following{/other_user}","gists_url":"https://api.github.com/users/krig/gists{/gist_id}","starred_url":"https://api.github.com/users/krig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krig/subscriptions","organizations_url":"https://api.github.com/users/krig/orgs","repos_url":"https://api.github.com/users/krig/repos","events_url":"https://api.github.com/users/krig/events{/privacy}","received_events_url":"https://api.github.com/users/krig/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/krig/hawk","description":"A web-based GUI for managing and monitoring the Pacemaker High-Availability cluster resource manager","fork":true,"url":"https://api.github.com/repos/krig/hawk","forks_url":"https://api.github.com/repos/krig/hawk/forks","keys_url":"https://api.github.com/repos/krig/hawk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/krig/hawk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/krig/hawk/teams","hooks_url":"https://api.github.com/repos/krig/hawk/hooks","issue_events_url":"https://api.github.com/repos/krig/hawk/issues/events{/number}","events_url":"https://api.github.com/repos/krig/hawk/events","assignees_url":"https://api.github.com/repos/krig/hawk/assignees{/user}","branches_url":"https://api.github.com/repos/krig/hawk/branches{/branch}","tags_url":"https://api.github.com/repos/krig/hawk/tags","blobs_url":"https://api.github.com/repos/krig/hawk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/krig/hawk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/krig/hawk/git/refs{/sha}","trees_url":"https://api.github.com/repos/krig/hawk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/krig/hawk/statuses/{sha}","languages_url":"https://api.github.com/repos/krig/hawk/languages","stargazers_url":"https://api.github.com/repos/krig/hawk/stargazers","contributors_url":"https://api.github.com/repos/krig/hawk/contributors","subscribers_url":"https://api.github.com/repos/krig/hawk/subscribers","subscription_url":"https://api.github.com/repos/krig/hawk/subscription","commits_url":"https://api.github.com/repos/krig/hawk/commits{/sha}","git_commits_url":"https://api.github.com/repos/krig/hawk/git/commits{/sha}","comments_url":"https://api.github.com/repos/krig/hawk/comments{/number}","issue_comment_url":"https://api.github.com/repos/krig/hawk/issues/comments{/number}","contents_url":"https://api.github.com/repos/krig/hawk/contents/{+path}","compare_url":"https://api.github.com/repos/krig/hawk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/krig/hawk/merges","archive_url":"https://api.github.com/repos/krig/hawk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/krig/hawk/downloads","issues_url":"https://api.github.com/repos/krig/hawk/issues{/number}","pulls_url":"https://api.github.com/repos/krig/hawk/pulls{/number}","milestones_url":"https://api.github.com/repos/krig/hawk/milestones{/number}","notifications_url":"https://api.github.com/repos/krig/hawk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/krig/hawk/labels{/name}","releases_url":"https://api.github.com/repos/krig/hawk/releases{/id}","created_at":"2013-07-17T05:38:56Z","updated_at":"2015-06-29T13:43:57Z","pushed_at":"2015-11-22T22:52:53Z","git_url":"git://github.com/krig/hawk.git","ssh_url":"git@github.com:krig/hawk.git","clone_url":"https://github.com/krig/hawk.git","svn_url":"https://github.com/krig/hawk","homepage":null,"size":13808,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"master"}},"base":{"label":"ClusterLabs:master","ref":"master","sha":"3d88e5fd858a390d89c724c0e57e914f30ad74da","user":{"login":"ClusterLabs","id":574912,"avatar_url":"https://avatars.githubusercontent.com/u/574912?v=3","gravatar_id":"","url":"https://api.github.com/users/ClusterLabs","html_url":"https://github.com/ClusterLabs","followers_url":"https://api.github.com/users/ClusterLabs/followers","following_url":"https://api.github.com/users/ClusterLabs/following{/other_user}","gists_url":"https://api.github.com/users/ClusterLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/ClusterLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ClusterLabs/subscriptions","organizations_url":"https://api.github.com/users/ClusterLabs/orgs","repos_url":"https://api.github.com/users/ClusterLabs/repos","events_url":"https://api.github.com/users/ClusterLabs/events{/privacy}","received_events_url":"https://api.github.com/users/ClusterLabs/received_events","type":"Organization","site_admin":false},"repo":{"id":4154361,"name":"hawk","full_name":"ClusterLabs/hawk","owner":{"login":"ClusterLabs","id":574912,"avatar_url":"https://avatars.githubusercontent.com/u/574912?v=3","gravatar_id":"","url":"https://api.github.com/users/ClusterLabs","html_url":"https://github.com/ClusterLabs","followers_url":"https://api.github.com/users/ClusterLabs/followers","following_url":"https://api.github.com/users/ClusterLabs/following{/other_user}","gists_url":"https://api.github.com/users/ClusterLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/ClusterLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ClusterLabs/subscriptions","organizations_url":"https://api.github.com/users/ClusterLabs/orgs","repos_url":"https://api.github.com/users/ClusterLabs/repos","events_url":"https://api.github.com/users/ClusterLabs/events{/privacy}","received_events_url":"https://api.github.com/users/ClusterLabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ClusterLabs/hawk","description":"A web-based GUI for managing and monitoring the Pacemaker High-Availability cluster resource manager","fork":false,"url":"https://api.github.com/repos/ClusterLabs/hawk","forks_url":"https://api.github.com/repos/ClusterLabs/hawk/forks","keys_url":"https://api.github.com/repos/ClusterLabs/hawk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ClusterLabs/hawk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ClusterLabs/hawk/teams","hooks_url":"https://api.github.com/repos/ClusterLabs/hawk/hooks","issue_events_url":"https://api.github.com/repos/ClusterLabs/hawk/issues/events{/number}","events_url":"https://api.github.com/repos/ClusterLabs/hawk/events","assignees_url":"https://api.github.com/repos/ClusterLabs/hawk/assignees{/user}","branches_url":"https://api.github.com/repos/ClusterLabs/hawk/branches{/branch}","tags_url":"https://api.github.com/repos/ClusterLabs/hawk/tags","blobs_url":"https://api.github.com/repos/ClusterLabs/hawk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ClusterLabs/hawk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ClusterLabs/hawk/git/refs{/sha}","trees_url":"https://api.github.com/repos/ClusterLabs/hawk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ClusterLabs/hawk/statuses/{sha}","languages_url":"https://api.github.com/repos/ClusterLabs/hawk/languages","stargazers_url":"https://api.github.com/repos/ClusterLabs/hawk/stargazers","contributors_url":"https://api.github.com/repos/ClusterLabs/hawk/contributors","subscribers_url":"https://api.github.com/repos/ClusterLabs/hawk/subscribers","subscription_url":"https://api.github.com/repos/ClusterLabs/hawk/subscription","commits_url":"https://api.github.com/repos/ClusterLabs/hawk/commits{/sha}","git_commits_url":"https://api.github.com/repos/ClusterLabs/hawk/git/commits{/sha}","comments_url":"https://api.github.com/repos/ClusterLabs/hawk/comments{/number}","issue_comment_url":"https://api.github.com/repos/ClusterLabs/hawk/issues/comments{/number}","contents_url":"https://api.github.com/repos/ClusterLabs/hawk/contents/{+path}","compare_url":"https://api.github.com/repos/ClusterLabs/hawk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ClusterLabs/hawk/merges","archive_url":"https://api.github.com/repos/ClusterLabs/hawk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ClusterLabs/hawk/downloads","issues_url":"https://api.github.com/repos/ClusterLabs/hawk/issues{/number}","pulls_url":"https://api.github.com/repos/ClusterLabs/hawk/pulls{/number}","milestones_url":"https://api.github.com/repos/ClusterLabs/hawk/milestones{/number}","notifications_url":"https://api.github.com/repos/ClusterLabs/hawk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ClusterLabs/hawk/labels{/name}","releases_url":"https://api.github.com/repos/ClusterLabs/hawk/releases{/id}","created_at":"2012-04-27T02:30:01Z","updated_at":"2015-11-19T21:15:49Z","pushed_at":"2015-11-22T22:58:38Z","git_url":"git://github.com/ClusterLabs/hawk.git","ssh_url":"git@github.com:ClusterLabs/hawk.git","clone_url":"https://github.com/ClusterLabs/hawk.git","svn_url":"https://github.com/ClusterLabs/hawk","homepage":null,"size":13446,"stargazers_count":46,"watchers_count":46,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":7,"forks":15,"open_issues":7,"watchers":46,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ClusterLabs/hawk/pulls/61"},"html":{"href":"https://github.com/ClusterLabs/hawk/pull/61"},"issue":{"href":"https://api.github.com/repos/ClusterLabs/hawk/issues/61"},"comments":{"href":"https://api.github.com/repos/ClusterLabs/hawk/issues/61/comments"},"review_comments":{"href":"https://api.github.com/repos/ClusterLabs/hawk/pulls/61/comments"},"review_comment":{"href":"https://api.github.com/repos/ClusterLabs/hawk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ClusterLabs/hawk/pulls/61/commits"},"statuses":{"href":"https://api.github.com/repos/ClusterLabs/hawk/statuses/cbe7c37bfbc9c730705698e1d3fcffa5fbbb71fd"}}}}