{"action":"created","comment":{"url":"https://api.github.com/repos/sheepdog/cinder/pulls/comments/33541911","id":33541911,"diff_hunk":"@@ -92,6 +93,38 @@ def _run_dog(self, command, subcommand, *params):\n                 stdout=e.stdout.replace('\\n', '\\\\n'),\n                 stderr=e.stderr.replace('\\n', '\\\\n'))\n \n+    def _run_qemu_img(self, command, *params):\n+        \"\"\"Executes qemu-img command wrapper\"\"\"\n+        cmd = ['qemu-img', command]\n+        for param in params:\n+            if param.startswith(self.QEMU_SHEEPDOG_PREFIX):\n+                # replace 'sheepdog:vdiname[:snapid]' to\n+                #         'sheepdog:addr:port:vdiname[:snapid]'\n+                param = param.replace(self.QEMU_SHEEPDOG_PREFIX,\n+                                      '%(prefix)s%(addr)s:%(port)s:' %\n+                                      {'prefix': self.QEMU_SHEEPDOG_PREFIX,\n+                                       'addr': self.addr,\n+                                       'port': self.port},\n+                                      1)\n+            cmd.append(param)\n+        try:\n+            return self._execute(*cmd)","path":"cinder/volume/drivers/sheepdog.py","position":null,"original_position":27,"commit_id":"9c3942444564a4482c3bfe227b3e6f19d629b4c5","original_commit_id":"66628014a530b944f556709c174e4a8c2eaa7ea4","user":{"login":"y-naga","id":12693164,"avatar_url":"https://avatars.githubusercontent.com/u/12693164?v=3","gravatar_id":"","url":"https://api.github.com/users/y-naga","html_url":"https://github.com/y-naga","followers_url":"https://api.github.com/users/y-naga/followers","following_url":"https://api.github.com/users/y-naga/following{/other_user}","gists_url":"https://api.github.com/users/y-naga/gists{/gist_id}","starred_url":"https://api.github.com/users/y-naga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/y-naga/subscriptions","organizations_url":"https://api.github.com/users/y-naga/orgs","repos_url":"https://api.github.com/users/y-naga/repos","events_url":"https://api.github.com/users/y-naga/events{/privacy}","received_events_url":"https://api.github.com/users/y-naga/received_events","type":"User","site_admin":false},"body":"`utils.execute(*cmd)`にてコマンドを実行する様に修正。\r\nテストケースのパッチも合わせて`mock.patch.object(utils, 'execute')`に修正。","created_at":"2015-06-30T05:44:31Z","updated_at":"2015-06-30T05:44:31Z","html_url":"https://github.com/sheepdog/cinder/pull/21#discussion_r33541911","pull_request_url":"https://api.github.com/repos/sheepdog/cinder/pulls/21","_links":{"self":{"href":"https://api.github.com/repos/sheepdog/cinder/pulls/comments/33541911"},"html":{"href":"https://github.com/sheepdog/cinder/pull/21#discussion_r33541911"},"pull_request":{"href":"https://api.github.com/repos/sheepdog/cinder/pulls/21"}}},"pull_request":{"url":"https://api.github.com/repos/sheepdog/cinder/pulls/21","id":38513326,"html_url":"https://github.com/sheepdog/cinder/pull/21","diff_url":"https://github.com/sheepdog/cinder/pull/21.diff","patch_url":"https://github.com/sheepdog/cinder/pull/21.patch","issue_url":"https://api.github.com/repos/sheepdog/cinder/issues/21","number":21,"state":"open","locked":false,"title":"SheepdogClient._run_qemu_img()","user":{"login":"y-naga","id":12693164,"avatar_url":"https://avatars.githubusercontent.com/u/12693164?v=3","gravatar_id":"","url":"https://api.github.com/users/y-naga","html_url":"https://github.com/y-naga","followers_url":"https://api.github.com/users/y-naga/followers","following_url":"https://api.github.com/users/y-naga/following{/other_user}","gists_url":"https://api.github.com/users/y-naga/gists{/gist_id}","starred_url":"https://api.github.com/users/y-naga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/y-naga/subscriptions","organizations_url":"https://api.github.com/users/y-naga/orgs","repos_url":"https://api.github.com/users/y-naga/repos","events_url":"https://api.github.com/users/y-naga/events{/privacy}","received_events_url":"https://api.github.com/users/y-naga/received_events","type":"User","site_admin":false},"body":"レビューお願いします。","created_at":"2015-06-25T05:32:36Z","updated_at":"2015-06-30T05:44:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ddebaa1bb629157cb48df61ad9b3e6a72833c50c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sheepdog/cinder/pulls/21/commits","review_comments_url":"https://api.github.com/repos/sheepdog/cinder/pulls/21/comments","review_comment_url":"https://api.github.com/repos/sheepdog/cinder/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sheepdog/cinder/issues/21/comments","statuses_url":"https://api.github.com/repos/sheepdog/cinder/statuses/9c3942444564a4482c3bfe227b3e6f19d629b4c5","head":{"label":"y-naga:run_qemu_img","ref":"run_qemu_img","sha":"9c3942444564a4482c3bfe227b3e6f19d629b4c5","user":{"login":"y-naga","id":12693164,"avatar_url":"https://avatars.githubusercontent.com/u/12693164?v=3","gravatar_id":"","url":"https://api.github.com/users/y-naga","html_url":"https://github.com/y-naga","followers_url":"https://api.github.com/users/y-naga/followers","following_url":"https://api.github.com/users/y-naga/following{/other_user}","gists_url":"https://api.github.com/users/y-naga/gists{/gist_id}","starred_url":"https://api.github.com/users/y-naga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/y-naga/subscriptions","organizations_url":"https://api.github.com/users/y-naga/orgs","repos_url":"https://api.github.com/users/y-naga/repos","events_url":"https://api.github.com/users/y-naga/events{/privacy}","received_events_url":"https://api.github.com/users/y-naga/received_events","type":"User","site_admin":false},"repo":{"id":36648463,"name":"cinder","full_name":"y-naga/cinder","owner":{"login":"y-naga","id":12693164,"avatar_url":"https://avatars.githubusercontent.com/u/12693164?v=3","gravatar_id":"","url":"https://api.github.com/users/y-naga","html_url":"https://github.com/y-naga","followers_url":"https://api.github.com/users/y-naga/followers","following_url":"https://api.github.com/users/y-naga/following{/other_user}","gists_url":"https://api.github.com/users/y-naga/gists{/gist_id}","starred_url":"https://api.github.com/users/y-naga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/y-naga/subscriptions","organizations_url":"https://api.github.com/users/y-naga/orgs","repos_url":"https://api.github.com/users/y-naga/repos","events_url":"https://api.github.com/users/y-naga/events{/privacy}","received_events_url":"https://api.github.com/users/y-naga/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/y-naga/cinder","description":"","fork":true,"url":"https://api.github.com/repos/y-naga/cinder","forks_url":"https://api.github.com/repos/y-naga/cinder/forks","keys_url":"https://api.github.com/repos/y-naga/cinder/keys{/key_id}","collaborators_url":"https://api.github.com/repos/y-naga/cinder/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/y-naga/cinder/teams","hooks_url":"https://api.github.com/repos/y-naga/cinder/hooks","issue_events_url":"https://api.github.com/repos/y-naga/cinder/issues/events{/number}","events_url":"https://api.github.com/repos/y-naga/cinder/events","assignees_url":"https://api.github.com/repos/y-naga/cinder/assignees{/user}","branches_url":"https://api.github.com/repos/y-naga/cinder/branches{/branch}","tags_url":"https://api.github.com/repos/y-naga/cinder/tags","blobs_url":"https://api.github.com/repos/y-naga/cinder/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/y-naga/cinder/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/y-naga/cinder/git/refs{/sha}","trees_url":"https://api.github.com/repos/y-naga/cinder/git/trees{/sha}","statuses_url":"https://api.github.com/repos/y-naga/cinder/statuses/{sha}","languages_url":"https://api.github.com/repos/y-naga/cinder/languages","stargazers_url":"https://api.github.com/repos/y-naga/cinder/stargazers","contributors_url":"https://api.github.com/repos/y-naga/cinder/contributors","subscribers_url":"https://api.github.com/repos/y-naga/cinder/subscribers","subscription_url":"https://api.github.com/repos/y-naga/cinder/subscription","commits_url":"https://api.github.com/repos/y-naga/cinder/commits{/sha}","git_commits_url":"https://api.github.com/repos/y-naga/cinder/git/commits{/sha}","comments_url":"https://api.github.com/repos/y-naga/cinder/comments{/number}","issue_comment_url":"https://api.github.com/repos/y-naga/cinder/issues/comments{/number}","contents_url":"https://api.github.com/repos/y-naga/cinder/contents/{+path}","compare_url":"https://api.github.com/repos/y-naga/cinder/compare/{base}...{head}","merges_url":"https://api.github.com/repos/y-naga/cinder/merges","archive_url":"https://api.github.com/repos/y-naga/cinder/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/y-naga/cinder/downloads","issues_url":"https://api.github.com/repos/y-naga/cinder/issues{/number}","pulls_url":"https://api.github.com/repos/y-naga/cinder/pulls{/number}","milestones_url":"https://api.github.com/repos/y-naga/cinder/milestones{/number}","notifications_url":"https://api.github.com/repos/y-naga/cinder/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/y-naga/cinder/labels{/name}","releases_url":"https://api.github.com/repos/y-naga/cinder/releases{/id}","created_at":"2015-06-01T08:42:38Z","updated_at":"2015-06-29T08:42:43Z","pushed_at":"2015-06-30T05:41:56Z","git_url":"git://github.com/y-naga/cinder.git","ssh_url":"git@github.com:y-naga/cinder.git","clone_url":"https://github.com/y-naga/cinder.git","svn_url":"https://github.com/y-naga/cinder","homepage":"http://openstack.org","size":39316,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"sheepdog:sheepdog-devel","ref":"sheepdog-devel","sha":"aaf711553af8fedd034942d9d24ad3e37800c648","user":{"login":"sheepdog","id":4846685,"avatar_url":"https://avatars.githubusercontent.com/u/4846685?v=3","gravatar_id":"","url":"https://api.github.com/users/sheepdog","html_url":"https://github.com/sheepdog","followers_url":"https://api.github.com/users/sheepdog/followers","following_url":"https://api.github.com/users/sheepdog/following{/other_user}","gists_url":"https://api.github.com/users/sheepdog/gists{/gist_id}","starred_url":"https://api.github.com/users/sheepdog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sheepdog/subscriptions","organizations_url":"https://api.github.com/users/sheepdog/orgs","repos_url":"https://api.github.com/users/sheepdog/repos","events_url":"https://api.github.com/users/sheepdog/events{/privacy}","received_events_url":"https://api.github.com/users/sheepdog/received_events","type":"Organization","site_admin":false},"repo":{"id":36645800,"name":"cinder","full_name":"sheepdog/cinder","owner":{"login":"sheepdog","id":4846685,"avatar_url":"https://avatars.githubusercontent.com/u/4846685?v=3","gravatar_id":"","url":"https://api.github.com/users/sheepdog","html_url":"https://github.com/sheepdog","followers_url":"https://api.github.com/users/sheepdog/followers","following_url":"https://api.github.com/users/sheepdog/following{/other_user}","gists_url":"https://api.github.com/users/sheepdog/gists{/gist_id}","starred_url":"https://api.github.com/users/sheepdog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sheepdog/subscriptions","organizations_url":"https://api.github.com/users/sheepdog/orgs","repos_url":"https://api.github.com/users/sheepdog/repos","events_url":"https://api.github.com/users/sheepdog/events{/privacy}","received_events_url":"https://api.github.com/users/sheepdog/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sheepdog/cinder","description":"","fork":true,"url":"https://api.github.com/repos/sheepdog/cinder","forks_url":"https://api.github.com/repos/sheepdog/cinder/forks","keys_url":"https://api.github.com/repos/sheepdog/cinder/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sheepdog/cinder/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sheepdog/cinder/teams","hooks_url":"https://api.github.com/repos/sheepdog/cinder/hooks","issue_events_url":"https://api.github.com/repos/sheepdog/cinder/issues/events{/number}","events_url":"https://api.github.com/repos/sheepdog/cinder/events","assignees_url":"https://api.github.com/repos/sheepdog/cinder/assignees{/user}","branches_url":"https://api.github.com/repos/sheepdog/cinder/branches{/branch}","tags_url":"https://api.github.com/repos/sheepdog/cinder/tags","blobs_url":"https://api.github.com/repos/sheepdog/cinder/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sheepdog/cinder/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sheepdog/cinder/git/refs{/sha}","trees_url":"https://api.github.com/repos/sheepdog/cinder/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sheepdog/cinder/statuses/{sha}","languages_url":"https://api.github.com/repos/sheepdog/cinder/languages","stargazers_url":"https://api.github.com/repos/sheepdog/cinder/stargazers","contributors_url":"https://api.github.com/repos/sheepdog/cinder/contributors","subscribers_url":"https://api.github.com/repos/sheepdog/cinder/subscribers","subscription_url":"https://api.github.com/repos/sheepdog/cinder/subscription","commits_url":"https://api.github.com/repos/sheepdog/cinder/commits{/sha}","git_commits_url":"https://api.github.com/repos/sheepdog/cinder/git/commits{/sha}","comments_url":"https://api.github.com/repos/sheepdog/cinder/comments{/number}","issue_comment_url":"https://api.github.com/repos/sheepdog/cinder/issues/comments{/number}","contents_url":"https://api.github.com/repos/sheepdog/cinder/contents/{+path}","compare_url":"https://api.github.com/repos/sheepdog/cinder/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sheepdog/cinder/merges","archive_url":"https://api.github.com/repos/sheepdog/cinder/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sheepdog/cinder/downloads","issues_url":"https://api.github.com/repos/sheepdog/cinder/issues{/number}","pulls_url":"https://api.github.com/repos/sheepdog/cinder/pulls{/number}","milestones_url":"https://api.github.com/repos/sheepdog/cinder/milestones{/number}","notifications_url":"https://api.github.com/repos/sheepdog/cinder/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sheepdog/cinder/labels{/name}","releases_url":"https://api.github.com/repos/sheepdog/cinder/releases{/id}","created_at":"2015-06-01T07:50:20Z","updated_at":"2015-06-01T07:50:25Z","pushed_at":"2015-06-30T05:41:57Z","git_url":"git://github.com/sheepdog/cinder.git","ssh_url":"git@github.com:sheepdog/cinder.git","clone_url":"https://github.com/sheepdog/cinder.git","svn_url":"https://github.com/sheepdog/cinder","homepage":"http://openstack.org","size":40576,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":6,"forks":4,"open_issues":6,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sheepdog/cinder/pulls/21"},"html":{"href":"https://github.com/sheepdog/cinder/pull/21"},"issue":{"href":"https://api.github.com/repos/sheepdog/cinder/issues/21"},"comments":{"href":"https://api.github.com/repos/sheepdog/cinder/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/sheepdog/cinder/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/sheepdog/cinder/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sheepdog/cinder/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/sheepdog/cinder/statuses/9c3942444564a4482c3bfe227b3e6f19d629b4c5"}}}}