{"action":"created","comment":{"url":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/comments/47121364","id":47121364,"diff_hunk":"@@ -84,53 +97,62 @@ def scan_ring_desc(input)\n \n   r = RingInfo.new\n   state = :init\n-  next_state =\"\"  # if the current state is ignore, this is the next state\n-  ignore_count = 0  # the number of lines to ignore\n+  next_state = \"\" # if the current state is ignore, this is the next state\n+  ignore_until = nil # regexp to ignore lines until this match\n+  ignore_count = 0 # the number of lines to ignore, used if ignore_count is nil\n   input.each { |line|\n     case state\n       when :init\n-      state=:gen_info\n-      next\n+        state = :gen_info\n+        next\n \n       when :ignore\n-      Chef::Log.debug(\"ignoring line:\" + line )\n-      ignore_count -= 1\n-      if (ignore_count ==0)\n-        state = next_state\n-      end\n+        Chef::Log.debug(\"ignoring line: \" + line)\n+        if ignore_until.nil?\n+          ignore_count -= 1\n+          if (ignore_count == 0)\n+            state = next_state\n+          end\n+        else\n+          state = next_state if line =~ ignore_until\n+        end\n       next\n \n       when :gen_info\n-      line =~/^(\\d+).+,(\\d+).+,(\\d+).+,(\\d+).*,([0-9.]+).+$/\n-      r.partitions=$1\n-      r.replicas=$2\n-      r.zones=$3\n-      r.device_num=$4\n-      state = :ignore\n-      next_state = :dev_info\n-      ignore_count =2\n-      next\n-\n-      when :dev_info  #              0     1 192.168.124.131  6002      sdb1 100.00          0 -100.00\n-      Chef::Log.debug \"reading dev info:\" + line\n-      line =~ /^\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)\\s+(\\d+\\.\\d+\\.\\d+\\.\\d+)\\s+(\\d+)\\s+(\\d+\\.\\d+\\.\\d+\\.\\d+)\\s+(\\d+)\\s+(\\S+)\\s+([0-9.]+)\\s+(\\d+)\\s*([-0-9.]+)\\s*$/\n-      if $~.nil?\n-        raise \"failed to parse: #{line}\"\n-      else\n-        Chef::Log.debug \"matched: #{$~[0]}\"\n-      end\n-      dev = RingInfo::RingDeviceInfo.new\n-      dev.id = $1\n-      dev.region = $2\n-      dev.zone = $3\n-      dev.ip=$4\n-      dev.port = $5\n-      replication_ip = $6\n-      replication_port = $7\n-      dev.name = $8\n-      dev.weight = $9\n-      dev.partitions = $10\n-      r.add_device dev\n+        Chef::Log.debug(\"reading gen info: \" + line)\n+        line =~ /^(\\d+) partitions, ([0-9.]+) replicas, (\\d+) regions, (\\d+) zones, (\\d+) devices,.*$/","path":"chef/cookbooks/swift/providers/ringfile.rb","position":104,"original_position":104,"commit_id":"26ee9d36b0daf17692835ae17f938b7d5f79be03","original_commit_id":"26ee9d36b0daf17692835ae17f938b7d5f79be03","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":"Metrics/LineLength: Line is too long. [102/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)","created_at":"2015-12-09T17:16:44Z","updated_at":"2015-12-09T17:16:44Z","html_url":"https://github.com/crowbar/crowbar-openstack/pull/146#discussion_r47121364","pull_request_url":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/146","_links":{"self":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/comments/47121364"},"html":{"href":"https://github.com/crowbar/crowbar-openstack/pull/146#discussion_r47121364"},"pull_request":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/146"}}},"pull_request":{"url":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/146","id":53119863,"html_url":"https://github.com/crowbar/crowbar-openstack/pull/146","diff_url":"https://github.com/crowbar/crowbar-openstack/pull/146.diff","patch_url":"https://github.com/crowbar/crowbar-openstack/pull/146.patch","issue_url":"https://api.github.com/repos/crowbar/crowbar-openstack/issues/146","number":146,"state":"open","locked":false,"title":"swift: Fix ring builder parser to be compatible with both Juno & Liberty","user":{"login":"vuntz","id":1758783,"avatar_url":"https://avatars.githubusercontent.com/u/1758783?v=3","gravatar_id":"","url":"https://api.github.com/users/vuntz","html_url":"https://github.com/vuntz","followers_url":"https://api.github.com/users/vuntz/followers","following_url":"https://api.github.com/users/vuntz/following{/other_user}","gists_url":"https://api.github.com/users/vuntz/gists{/gist_id}","starred_url":"https://api.github.com/users/vuntz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vuntz/subscriptions","organizations_url":"https://api.github.com/users/vuntz/orgs","repos_url":"https://api.github.com/users/vuntz/repos","events_url":"https://api.github.com/users/vuntz/events{/privacy}","received_events_url":"https://api.github.com/users/vuntz/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-12-09T13:42:47Z","updated_at":"2015-12-09T17:16:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b69b86409e5ecce37b765ecad5cb18f26b467989","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/146/commits","review_comments_url":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/146/comments","review_comment_url":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/crowbar/crowbar-openstack/issues/146/comments","statuses_url":"https://api.github.com/repos/crowbar/crowbar-openstack/statuses/26ee9d36b0daf17692835ae17f938b7d5f79be03","head":{"label":"vuntz:swift-ring-builder-parser","ref":"swift-ring-builder-parser","sha":"26ee9d36b0daf17692835ae17f938b7d5f79be03","user":{"login":"vuntz","id":1758783,"avatar_url":"https://avatars.githubusercontent.com/u/1758783?v=3","gravatar_id":"","url":"https://api.github.com/users/vuntz","html_url":"https://github.com/vuntz","followers_url":"https://api.github.com/users/vuntz/followers","following_url":"https://api.github.com/users/vuntz/following{/other_user}","gists_url":"https://api.github.com/users/vuntz/gists{/gist_id}","starred_url":"https://api.github.com/users/vuntz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vuntz/subscriptions","organizations_url":"https://api.github.com/users/vuntz/orgs","repos_url":"https://api.github.com/users/vuntz/repos","events_url":"https://api.github.com/users/vuntz/events{/privacy}","received_events_url":"https://api.github.com/users/vuntz/received_events","type":"User","site_admin":false},"repo":{"id":41142183,"name":"crowbar-openstack","full_name":"vuntz/crowbar-openstack","owner":{"login":"vuntz","id":1758783,"avatar_url":"https://avatars.githubusercontent.com/u/1758783?v=3","gravatar_id":"","url":"https://api.github.com/users/vuntz","html_url":"https://github.com/vuntz","followers_url":"https://api.github.com/users/vuntz/followers","following_url":"https://api.github.com/users/vuntz/following{/other_user}","gists_url":"https://api.github.com/users/vuntz/gists{/gist_id}","starred_url":"https://api.github.com/users/vuntz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vuntz/subscriptions","organizations_url":"https://api.github.com/users/vuntz/orgs","repos_url":"https://api.github.com/users/vuntz/repos","events_url":"https://api.github.com/users/vuntz/events{/privacy}","received_events_url":"https://api.github.com/users/vuntz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vuntz/crowbar-openstack","description":"Openstack deployment for Crowbar","fork":true,"url":"https://api.github.com/repos/vuntz/crowbar-openstack","forks_url":"https://api.github.com/repos/vuntz/crowbar-openstack/forks","keys_url":"https://api.github.com/repos/vuntz/crowbar-openstack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vuntz/crowbar-openstack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vuntz/crowbar-openstack/teams","hooks_url":"https://api.github.com/repos/vuntz/crowbar-openstack/hooks","issue_events_url":"https://api.github.com/repos/vuntz/crowbar-openstack/issues/events{/number}","events_url":"https://api.github.com/repos/vuntz/crowbar-openstack/events","assignees_url":"https://api.github.com/repos/vuntz/crowbar-openstack/assignees{/user}","branches_url":"https://api.github.com/repos/vuntz/crowbar-openstack/branches{/branch}","tags_url":"https://api.github.com/repos/vuntz/crowbar-openstack/tags","blobs_url":"https://api.github.com/repos/vuntz/crowbar-openstack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vuntz/crowbar-openstack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vuntz/crowbar-openstack/git/refs{/sha}","trees_url":"https://api.github.com/repos/vuntz/crowbar-openstack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vuntz/crowbar-openstack/statuses/{sha}","languages_url":"https://api.github.com/repos/vuntz/crowbar-openstack/languages","stargazers_url":"https://api.github.com/repos/vuntz/crowbar-openstack/stargazers","contributors_url":"https://api.github.com/repos/vuntz/crowbar-openstack/contributors","subscribers_url":"https://api.github.com/repos/vuntz/crowbar-openstack/subscribers","subscription_url":"https://api.github.com/repos/vuntz/crowbar-openstack/subscription","commits_url":"https://api.github.com/repos/vuntz/crowbar-openstack/commits{/sha}","git_commits_url":"https://api.github.com/repos/vuntz/crowbar-openstack/git/commits{/sha}","comments_url":"https://api.github.com/repos/vuntz/crowbar-openstack/comments{/number}","issue_comment_url":"https://api.github.com/repos/vuntz/crowbar-openstack/issues/comments{/number}","contents_url":"https://api.github.com/repos/vuntz/crowbar-openstack/contents/{+path}","compare_url":"https://api.github.com/repos/vuntz/crowbar-openstack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vuntz/crowbar-openstack/merges","archive_url":"https://api.github.com/repos/vuntz/crowbar-openstack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vuntz/crowbar-openstack/downloads","issues_url":"https://api.github.com/repos/vuntz/crowbar-openstack/issues{/number}","pulls_url":"https://api.github.com/repos/vuntz/crowbar-openstack/pulls{/number}","milestones_url":"https://api.github.com/repos/vuntz/crowbar-openstack/milestones{/number}","notifications_url":"https://api.github.com/repos/vuntz/crowbar-openstack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vuntz/crowbar-openstack/labels{/name}","releases_url":"https://api.github.com/repos/vuntz/crowbar-openstack/releases{/id}","created_at":"2015-08-21T07:34:22Z","updated_at":"2015-08-21T07:34:23Z","pushed_at":"2015-12-09T17:16:38Z","git_url":"git://github.com/vuntz/crowbar-openstack.git","ssh_url":"git@github.com:vuntz/crowbar-openstack.git","clone_url":"https://github.com/vuntz/crowbar-openstack.git","svn_url":"https://github.com/vuntz/crowbar-openstack","homepage":null,"size":15624,"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":"master"}},"base":{"label":"crowbar:master","ref":"master","sha":"c35a05cbd4fc4f7e24b3762b7958abc7f9836f81","user":{"login":"crowbar","id":2910205,"avatar_url":"https://avatars.githubusercontent.com/u/2910205?v=3","gravatar_id":"","url":"https://api.github.com/users/crowbar","html_url":"https://github.com/crowbar","followers_url":"https://api.github.com/users/crowbar/followers","following_url":"https://api.github.com/users/crowbar/following{/other_user}","gists_url":"https://api.github.com/users/crowbar/gists{/gist_id}","starred_url":"https://api.github.com/users/crowbar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crowbar/subscriptions","organizations_url":"https://api.github.com/users/crowbar/orgs","repos_url":"https://api.github.com/users/crowbar/repos","events_url":"https://api.github.com/users/crowbar/events{/privacy}","received_events_url":"https://api.github.com/users/crowbar/received_events","type":"Organization","site_admin":false},"repo":{"id":39006903,"name":"crowbar-openstack","full_name":"crowbar/crowbar-openstack","owner":{"login":"crowbar","id":2910205,"avatar_url":"https://avatars.githubusercontent.com/u/2910205?v=3","gravatar_id":"","url":"https://api.github.com/users/crowbar","html_url":"https://github.com/crowbar","followers_url":"https://api.github.com/users/crowbar/followers","following_url":"https://api.github.com/users/crowbar/following{/other_user}","gists_url":"https://api.github.com/users/crowbar/gists{/gist_id}","starred_url":"https://api.github.com/users/crowbar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crowbar/subscriptions","organizations_url":"https://api.github.com/users/crowbar/orgs","repos_url":"https://api.github.com/users/crowbar/repos","events_url":"https://api.github.com/users/crowbar/events{/privacy}","received_events_url":"https://api.github.com/users/crowbar/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/crowbar/crowbar-openstack","description":"Openstack deployment for Crowbar","fork":false,"url":"https://api.github.com/repos/crowbar/crowbar-openstack","forks_url":"https://api.github.com/repos/crowbar/crowbar-openstack/forks","keys_url":"https://api.github.com/repos/crowbar/crowbar-openstack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crowbar/crowbar-openstack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crowbar/crowbar-openstack/teams","hooks_url":"https://api.github.com/repos/crowbar/crowbar-openstack/hooks","issue_events_url":"https://api.github.com/repos/crowbar/crowbar-openstack/issues/events{/number}","events_url":"https://api.github.com/repos/crowbar/crowbar-openstack/events","assignees_url":"https://api.github.com/repos/crowbar/crowbar-openstack/assignees{/user}","branches_url":"https://api.github.com/repos/crowbar/crowbar-openstack/branches{/branch}","tags_url":"https://api.github.com/repos/crowbar/crowbar-openstack/tags","blobs_url":"https://api.github.com/repos/crowbar/crowbar-openstack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crowbar/crowbar-openstack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crowbar/crowbar-openstack/git/refs{/sha}","trees_url":"https://api.github.com/repos/crowbar/crowbar-openstack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crowbar/crowbar-openstack/statuses/{sha}","languages_url":"https://api.github.com/repos/crowbar/crowbar-openstack/languages","stargazers_url":"https://api.github.com/repos/crowbar/crowbar-openstack/stargazers","contributors_url":"https://api.github.com/repos/crowbar/crowbar-openstack/contributors","subscribers_url":"https://api.github.com/repos/crowbar/crowbar-openstack/subscribers","subscription_url":"https://api.github.com/repos/crowbar/crowbar-openstack/subscription","commits_url":"https://api.github.com/repos/crowbar/crowbar-openstack/commits{/sha}","git_commits_url":"https://api.github.com/repos/crowbar/crowbar-openstack/git/commits{/sha}","comments_url":"https://api.github.com/repos/crowbar/crowbar-openstack/comments{/number}","issue_comment_url":"https://api.github.com/repos/crowbar/crowbar-openstack/issues/comments{/number}","contents_url":"https://api.github.com/repos/crowbar/crowbar-openstack/contents/{+path}","compare_url":"https://api.github.com/repos/crowbar/crowbar-openstack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crowbar/crowbar-openstack/merges","archive_url":"https://api.github.com/repos/crowbar/crowbar-openstack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crowbar/crowbar-openstack/downloads","issues_url":"https://api.github.com/repos/crowbar/crowbar-openstack/issues{/number}","pulls_url":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls{/number}","milestones_url":"https://api.github.com/repos/crowbar/crowbar-openstack/milestones{/number}","notifications_url":"https://api.github.com/repos/crowbar/crowbar-openstack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crowbar/crowbar-openstack/labels{/name}","releases_url":"https://api.github.com/repos/crowbar/crowbar-openstack/releases{/id}","created_at":"2015-07-13T10:55:33Z","updated_at":"2015-11-13T09:59:41Z","pushed_at":"2015-12-09T17:16:38Z","git_url":"git://github.com/crowbar/crowbar-openstack.git","ssh_url":"git@github.com:crowbar/crowbar-openstack.git","clone_url":"https://github.com/crowbar/crowbar-openstack.git","svn_url":"https://github.com/crowbar/crowbar-openstack","homepage":null,"size":15836,"stargazers_count":1,"watchers_count":1,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":20,"mirror_url":null,"open_issues_count":30,"forks":20,"open_issues":30,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/146"},"html":{"href":"https://github.com/crowbar/crowbar-openstack/pull/146"},"issue":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/issues/146"},"comments":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/issues/146/comments"},"review_comments":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/146/comments"},"review_comment":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/146/commits"},"statuses":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/statuses/26ee9d36b0daf17692835ae17f938b7d5f79be03"}}}}