{"action":"created","comment":{"url":"https://api.github.com/repos/theforeman/smart-proxy/pulls/comments/70470698","id":70470698,"diff_hunk":"@@ -174,5 +188,23 @@ def enum_zones\n       logger.debug \"Enumerated authoritative dns zones: #{zones}\"\n       zones\n     end\n+\n+    def enum_records(zone_name, node_name, type)\n+      records = []\n+      response = execute \"/EnumRecords #{zone_name} #{node_name}. /Type #{type}\", \"EnumRecords\", true\n+      response.each do |line|\n+        line.chomp!\n+        logger.debug \"Extracting record from dnscmd output '#{line}'\"\n+        matches = /^@\\s+(?<ttl>\\d+)\\s+(?<type>#{type})\\s+(?<record>\\S+)$/.match(line)","path":"modules/dns_dnscmd/dns_dnscmd_main.rb","position":56,"original_position":56,"commit_id":"7f6b3db04f56a9d5022f8d0b248b4654bc802f49","original_commit_id":"7f6b3db04f56a9d5022f8d0b248b4654bc802f49","user":{"login":"alexjfisher","id":146471,"avatar_url":"https://avatars.githubusercontent.com/u/146471?v=3","gravatar_id":"","url":"https://api.github.com/users/alexjfisher","html_url":"https://github.com/alexjfisher","followers_url":"https://api.github.com/users/alexjfisher/followers","following_url":"https://api.github.com/users/alexjfisher/following{/other_user}","gists_url":"https://api.github.com/users/alexjfisher/gists{/gist_id}","starred_url":"https://api.github.com/users/alexjfisher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexjfisher/subscriptions","organizations_url":"https://api.github.com/users/alexjfisher/orgs","repos_url":"https://api.github.com/users/alexjfisher/repos","events_url":"https://api.github.com/users/alexjfisher/events{/privacy}","received_events_url":"https://api.github.com/users/alexjfisher/received_events","type":"User","site_admin":false},"body":"I don't *need* to capture `ttl` or `type`, but I thought it made the regex nicely self documenting.  My first iteration actually had the regex over several lines with comments ;)\r\n\r\nIt should be ok to use `[[:upper:]]` for matching the type, but `#{type}` is available and tighter?\r\n\r\nI'm happy to change it though!\r\n\r\nI'm still a ruby novice.  Could you give a more complete example of how I'd use `=~`?\r\n```\r\nif line =~ /^@\\s+(?<ttl>\\d+)\\s+(?<type>#{type})\\s+(?<record>\\S+)$/\r\n  #Found a match, but where do the captures go?\r\nelse\r\n  #Not a matching line\r\nend\r\n```\r\n","created_at":"2016-07-12T16:15:39Z","updated_at":"2016-07-12T16:15:39Z","html_url":"https://github.com/theforeman/smart-proxy/pull/410#discussion_r70470698","pull_request_url":"https://api.github.com/repos/theforeman/smart-proxy/pulls/410","_links":{"self":{"href":"https://api.github.com/repos/theforeman/smart-proxy/pulls/comments/70470698"},"html":{"href":"https://github.com/theforeman/smart-proxy/pull/410#discussion_r70470698"},"pull_request":{"href":"https://api.github.com/repos/theforeman/smart-proxy/pulls/410"}}},"pull_request":{"url":"https://api.github.com/repos/theforeman/smart-proxy/pulls/410","id":68033850,"html_url":"https://github.com/theforeman/smart-proxy/pull/410","diff_url":"https://github.com/theforeman/smart-proxy/pull/410.diff","patch_url":"https://github.com/theforeman/smart-proxy/pull/410.patch","issue_url":"https://api.github.com/repos/theforeman/smart-proxy/issues/410","number":410,"state":"open","locked":false,"title":"fixes #13237 - WIP. Use RRData option when deleting DNS records","user":{"login":"alexjfisher","id":146471,"avatar_url":"https://avatars.githubusercontent.com/u/146471?v=3","gravatar_id":"","url":"https://api.github.com/users/alexjfisher","html_url":"https://github.com/alexjfisher","followers_url":"https://api.github.com/users/alexjfisher/followers","following_url":"https://api.github.com/users/alexjfisher/following{/other_user}","gists_url":"https://api.github.com/users/alexjfisher/gists{/gist_id}","starred_url":"https://api.github.com/users/alexjfisher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexjfisher/subscriptions","organizations_url":"https://api.github.com/users/alexjfisher/orgs","repos_url":"https://api.github.com/users/alexjfisher/repos","events_url":"https://api.github.com/users/alexjfisher/events{/privacy}","received_events_url":"https://api.github.com/users/alexjfisher/received_events","type":"User","site_admin":false},"body":"WIP - DO NOT MERGE\r\n\r\nTODO:\r\n* IPv6\r\n* Unit tests\r\n* Work out root cause.  Is this change actually needed?","created_at":"2016-04-27T10:56:15Z","updated_at":"2016-07-12T16:15:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aae0cbdfa3f46a665f2b597af87d95e2e53bed39","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/theforeman/smart-proxy/pulls/410/commits","review_comments_url":"https://api.github.com/repos/theforeman/smart-proxy/pulls/410/comments","review_comment_url":"https://api.github.com/repos/theforeman/smart-proxy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/theforeman/smart-proxy/issues/410/comments","statuses_url":"https://api.github.com/repos/theforeman/smart-proxy/statuses/7f6b3db04f56a9d5022f8d0b248b4654bc802f49","head":{"label":"alexjfisher:fix_dnscmd_access_denied","ref":"fix_dnscmd_access_denied","sha":"7f6b3db04f56a9d5022f8d0b248b4654bc802f49","user":{"login":"alexjfisher","id":146471,"avatar_url":"https://avatars.githubusercontent.com/u/146471?v=3","gravatar_id":"","url":"https://api.github.com/users/alexjfisher","html_url":"https://github.com/alexjfisher","followers_url":"https://api.github.com/users/alexjfisher/followers","following_url":"https://api.github.com/users/alexjfisher/following{/other_user}","gists_url":"https://api.github.com/users/alexjfisher/gists{/gist_id}","starred_url":"https://api.github.com/users/alexjfisher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexjfisher/subscriptions","organizations_url":"https://api.github.com/users/alexjfisher/orgs","repos_url":"https://api.github.com/users/alexjfisher/repos","events_url":"https://api.github.com/users/alexjfisher/events{/privacy}","received_events_url":"https://api.github.com/users/alexjfisher/received_events","type":"User","site_admin":false},"repo":{"id":54023249,"name":"smart-proxy","full_name":"alexjfisher/smart-proxy","owner":{"login":"alexjfisher","id":146471,"avatar_url":"https://avatars.githubusercontent.com/u/146471?v=3","gravatar_id":"","url":"https://api.github.com/users/alexjfisher","html_url":"https://github.com/alexjfisher","followers_url":"https://api.github.com/users/alexjfisher/followers","following_url":"https://api.github.com/users/alexjfisher/following{/other_user}","gists_url":"https://api.github.com/users/alexjfisher/gists{/gist_id}","starred_url":"https://api.github.com/users/alexjfisher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexjfisher/subscriptions","organizations_url":"https://api.github.com/users/alexjfisher/orgs","repos_url":"https://api.github.com/users/alexjfisher/repos","events_url":"https://api.github.com/users/alexjfisher/events{/privacy}","received_events_url":"https://api.github.com/users/alexjfisher/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alexjfisher/smart-proxy","description":"RESTful proxies for DNS, DHCP, TFTP, BMC and Puppet","fork":true,"url":"https://api.github.com/repos/alexjfisher/smart-proxy","forks_url":"https://api.github.com/repos/alexjfisher/smart-proxy/forks","keys_url":"https://api.github.com/repos/alexjfisher/smart-proxy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alexjfisher/smart-proxy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alexjfisher/smart-proxy/teams","hooks_url":"https://api.github.com/repos/alexjfisher/smart-proxy/hooks","issue_events_url":"https://api.github.com/repos/alexjfisher/smart-proxy/issues/events{/number}","events_url":"https://api.github.com/repos/alexjfisher/smart-proxy/events","assignees_url":"https://api.github.com/repos/alexjfisher/smart-proxy/assignees{/user}","branches_url":"https://api.github.com/repos/alexjfisher/smart-proxy/branches{/branch}","tags_url":"https://api.github.com/repos/alexjfisher/smart-proxy/tags","blobs_url":"https://api.github.com/repos/alexjfisher/smart-proxy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alexjfisher/smart-proxy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alexjfisher/smart-proxy/git/refs{/sha}","trees_url":"https://api.github.com/repos/alexjfisher/smart-proxy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alexjfisher/smart-proxy/statuses/{sha}","languages_url":"https://api.github.com/repos/alexjfisher/smart-proxy/languages","stargazers_url":"https://api.github.com/repos/alexjfisher/smart-proxy/stargazers","contributors_url":"https://api.github.com/repos/alexjfisher/smart-proxy/contributors","subscribers_url":"https://api.github.com/repos/alexjfisher/smart-proxy/subscribers","subscription_url":"https://api.github.com/repos/alexjfisher/smart-proxy/subscription","commits_url":"https://api.github.com/repos/alexjfisher/smart-proxy/commits{/sha}","git_commits_url":"https://api.github.com/repos/alexjfisher/smart-proxy/git/commits{/sha}","comments_url":"https://api.github.com/repos/alexjfisher/smart-proxy/comments{/number}","issue_comment_url":"https://api.github.com/repos/alexjfisher/smart-proxy/issues/comments{/number}","contents_url":"https://api.github.com/repos/alexjfisher/smart-proxy/contents/{+path}","compare_url":"https://api.github.com/repos/alexjfisher/smart-proxy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alexjfisher/smart-proxy/merges","archive_url":"https://api.github.com/repos/alexjfisher/smart-proxy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alexjfisher/smart-proxy/downloads","issues_url":"https://api.github.com/repos/alexjfisher/smart-proxy/issues{/number}","pulls_url":"https://api.github.com/repos/alexjfisher/smart-proxy/pulls{/number}","milestones_url":"https://api.github.com/repos/alexjfisher/smart-proxy/milestones{/number}","notifications_url":"https://api.github.com/repos/alexjfisher/smart-proxy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alexjfisher/smart-proxy/labels{/name}","releases_url":"https://api.github.com/repos/alexjfisher/smart-proxy/releases{/id}","deployments_url":"https://api.github.com/repos/alexjfisher/smart-proxy/deployments","created_at":"2016-03-16T10:39:45Z","updated_at":"2016-03-16T10:39:46Z","pushed_at":"2016-07-04T09:59:09Z","git_url":"git://github.com/alexjfisher/smart-proxy.git","ssh_url":"git@github.com:alexjfisher/smart-proxy.git","clone_url":"https://github.com/alexjfisher/smart-proxy.git","svn_url":"https://github.com/alexjfisher/smart-proxy","homepage":"http://theforeman.org/projects/smart-proxy","size":1398,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"theforeman:develop","ref":"develop","sha":"36956f8ff2f73ec139d606a7fed9604f17da2808","user":{"login":"theforeman","id":1439844,"avatar_url":"https://avatars.githubusercontent.com/u/1439844?v=3","gravatar_id":"","url":"https://api.github.com/users/theforeman","html_url":"https://github.com/theforeman","followers_url":"https://api.github.com/users/theforeman/followers","following_url":"https://api.github.com/users/theforeman/following{/other_user}","gists_url":"https://api.github.com/users/theforeman/gists{/gist_id}","starred_url":"https://api.github.com/users/theforeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theforeman/subscriptions","organizations_url":"https://api.github.com/users/theforeman/orgs","repos_url":"https://api.github.com/users/theforeman/repos","events_url":"https://api.github.com/users/theforeman/events{/privacy}","received_events_url":"https://api.github.com/users/theforeman/received_events","type":"Organization","site_admin":false},"repo":{"id":986551,"name":"smart-proxy","full_name":"theforeman/smart-proxy","owner":{"login":"theforeman","id":1439844,"avatar_url":"https://avatars.githubusercontent.com/u/1439844?v=3","gravatar_id":"","url":"https://api.github.com/users/theforeman","html_url":"https://github.com/theforeman","followers_url":"https://api.github.com/users/theforeman/followers","following_url":"https://api.github.com/users/theforeman/following{/other_user}","gists_url":"https://api.github.com/users/theforeman/gists{/gist_id}","starred_url":"https://api.github.com/users/theforeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theforeman/subscriptions","organizations_url":"https://api.github.com/users/theforeman/orgs","repos_url":"https://api.github.com/users/theforeman/repos","events_url":"https://api.github.com/users/theforeman/events{/privacy}","received_events_url":"https://api.github.com/users/theforeman/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/theforeman/smart-proxy","description":"RESTful proxies for DNS, DHCP, TFTP, BMC and Puppet","fork":false,"url":"https://api.github.com/repos/theforeman/smart-proxy","forks_url":"https://api.github.com/repos/theforeman/smart-proxy/forks","keys_url":"https://api.github.com/repos/theforeman/smart-proxy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/theforeman/smart-proxy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/theforeman/smart-proxy/teams","hooks_url":"https://api.github.com/repos/theforeman/smart-proxy/hooks","issue_events_url":"https://api.github.com/repos/theforeman/smart-proxy/issues/events{/number}","events_url":"https://api.github.com/repos/theforeman/smart-proxy/events","assignees_url":"https://api.github.com/repos/theforeman/smart-proxy/assignees{/user}","branches_url":"https://api.github.com/repos/theforeman/smart-proxy/branches{/branch}","tags_url":"https://api.github.com/repos/theforeman/smart-proxy/tags","blobs_url":"https://api.github.com/repos/theforeman/smart-proxy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/theforeman/smart-proxy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/theforeman/smart-proxy/git/refs{/sha}","trees_url":"https://api.github.com/repos/theforeman/smart-proxy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/theforeman/smart-proxy/statuses/{sha}","languages_url":"https://api.github.com/repos/theforeman/smart-proxy/languages","stargazers_url":"https://api.github.com/repos/theforeman/smart-proxy/stargazers","contributors_url":"https://api.github.com/repos/theforeman/smart-proxy/contributors","subscribers_url":"https://api.github.com/repos/theforeman/smart-proxy/subscribers","subscription_url":"https://api.github.com/repos/theforeman/smart-proxy/subscription","commits_url":"https://api.github.com/repos/theforeman/smart-proxy/commits{/sha}","git_commits_url":"https://api.github.com/repos/theforeman/smart-proxy/git/commits{/sha}","comments_url":"https://api.github.com/repos/theforeman/smart-proxy/comments{/number}","issue_comment_url":"https://api.github.com/repos/theforeman/smart-proxy/issues/comments{/number}","contents_url":"https://api.github.com/repos/theforeman/smart-proxy/contents/{+path}","compare_url":"https://api.github.com/repos/theforeman/smart-proxy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/theforeman/smart-proxy/merges","archive_url":"https://api.github.com/repos/theforeman/smart-proxy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/theforeman/smart-proxy/downloads","issues_url":"https://api.github.com/repos/theforeman/smart-proxy/issues{/number}","pulls_url":"https://api.github.com/repos/theforeman/smart-proxy/pulls{/number}","milestones_url":"https://api.github.com/repos/theforeman/smart-proxy/milestones{/number}","notifications_url":"https://api.github.com/repos/theforeman/smart-proxy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/theforeman/smart-proxy/labels{/name}","releases_url":"https://api.github.com/repos/theforeman/smart-proxy/releases{/id}","deployments_url":"https://api.github.com/repos/theforeman/smart-proxy/deployments","created_at":"2010-10-14T10:00:51Z","updated_at":"2016-06-22T08:39:05Z","pushed_at":"2016-07-08T08:52:14Z","git_url":"git://github.com/theforeman/smart-proxy.git","ssh_url":"git@github.com:theforeman/smart-proxy.git","clone_url":"https://github.com/theforeman/smart-proxy.git","svn_url":"https://github.com/theforeman/smart-proxy","homepage":"http://theforeman.org/projects/smart-proxy","size":2096,"stargazers_count":128,"watchers_count":128,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":156,"mirror_url":null,"open_issues_count":19,"forks":156,"open_issues":19,"watchers":128,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/theforeman/smart-proxy/pulls/410"},"html":{"href":"https://github.com/theforeman/smart-proxy/pull/410"},"issue":{"href":"https://api.github.com/repos/theforeman/smart-proxy/issues/410"},"comments":{"href":"https://api.github.com/repos/theforeman/smart-proxy/issues/410/comments"},"review_comments":{"href":"https://api.github.com/repos/theforeman/smart-proxy/pulls/410/comments"},"review_comment":{"href":"https://api.github.com/repos/theforeman/smart-proxy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/theforeman/smart-proxy/pulls/410/commits"},"statuses":{"href":"https://api.github.com/repos/theforeman/smart-proxy/statuses/7f6b3db04f56a9d5022f8d0b248b4654bc802f49"}}}}
{"actor":{"display_login":"alexjfisher"}}