{"action":"created","comment":{"url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/pulls/comments/50676906","id":50676906,"diff_hunk":"@@ -30,28 +30,37 @@\n Validator = common.Validator\n \n \n-def create_volume(context, availability_zone=None, size=None,\n-                  snapshot_id=None, volume_type=None, iops=None,\n-                  encrypted=None, kms_key_id=None):\n-    if snapshot_id is not None:\n-        snapshot = ec2utils.get_db_item(context, snapshot_id)\n-        os_snapshot_id = snapshot['os_id']\n-    else:\n-        os_snapshot_id = None\n-\n+def create_volume(context, size=None,\n+                  snapshot_id=None,\n+                  name=None,description=None):\n     cinder = clients.cinder(context)\n+    if size is None :\n+       size=0\n+    if snapshot_id is not None:\n+       os_snapshot=cinder.backups.get(snapshot_id)\n+       snap_size=os_snapshot.size\n+       if snap_size >size :\n+           size=snap_size","path":"ec2api/api/volume.py","position":23,"original_position":23,"commit_id":"9a3e773e2a570e1b49c3d70bf9444209ea252a54","original_commit_id":"9a3e773e2a570e1b49c3d70bf9444209ea252a54","user":{"login":"aggarwalchirag","id":16008606,"avatar_url":"https://avatars.githubusercontent.com/u/16008606?v=3","gravatar_id":"","url":"https://api.github.com/users/aggarwalchirag","html_url":"https://github.com/aggarwalchirag","followers_url":"https://api.github.com/users/aggarwalchirag/followers","following_url":"https://api.github.com/users/aggarwalchirag/following{/other_user}","gists_url":"https://api.github.com/users/aggarwalchirag/gists{/gist_id}","starred_url":"https://api.github.com/users/aggarwalchirag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aggarwalchirag/subscriptions","organizations_url":"https://api.github.com/users/aggarwalchirag/orgs","repos_url":"https://api.github.com/users/aggarwalchirag/repos","events_url":"https://api.github.com/users/aggarwalchirag/events{/privacy}","received_events_url":"https://api.github.com/users/aggarwalchirag/received_events","type":"User","site_admin":false},"body":"size handling is incorrect when a snapshot is provided","created_at":"2016-01-25T10:32:48Z","updated_at":"2016-01-25T10:32:48Z","html_url":"https://github.com/JioCloud/cinder-ec2-api/pull/4#discussion_r50676906","pull_request_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/JioCloud/cinder-ec2-api/pulls/comments/50676906"},"html":{"href":"https://github.com/JioCloud/cinder-ec2-api/pull/4#discussion_r50676906"},"pull_request":{"href":"https://api.github.com/repos/JioCloud/cinder-ec2-api/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/pulls/4","id":56874557,"html_url":"https://github.com/JioCloud/cinder-ec2-api/pull/4","diff_url":"https://github.com/JioCloud/cinder-ec2-api/pull/4.diff","patch_url":"https://github.com/JioCloud/cinder-ec2-api/pull/4.patch","issue_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/issues/4","number":4,"state":"open","locked":false,"title":"JBS-24 : added api for cinder ec2","user":{"login":"rjain-iitr","id":4263665,"avatar_url":"https://avatars.githubusercontent.com/u/4263665?v=3","gravatar_id":"","url":"https://api.github.com/users/rjain-iitr","html_url":"https://github.com/rjain-iitr","followers_url":"https://api.github.com/users/rjain-iitr/followers","following_url":"https://api.github.com/users/rjain-iitr/following{/other_user}","gists_url":"https://api.github.com/users/rjain-iitr/gists{/gist_id}","starred_url":"https://api.github.com/users/rjain-iitr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjain-iitr/subscriptions","organizations_url":"https://api.github.com/users/rjain-iitr/orgs","repos_url":"https://api.github.com/users/rjain-iitr/repos","events_url":"https://api.github.com/users/rjain-iitr/events{/privacy}","received_events_url":"https://api.github.com/users/rjain-iitr/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-01-22T11:08:56Z","updated_at":"2016-01-25T10:32:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a8c5aa02a755a28cfa6d0e521a0ed5971d6ee4e7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/pulls/4/commits","review_comments_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/pulls/4/comments","review_comment_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/issues/4/comments","statuses_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/statuses/9a3e773e2a570e1b49c3d70bf9444209ea252a54","head":{"label":"rjain-iitr:stable/kilo","ref":"stable/kilo","sha":"9a3e773e2a570e1b49c3d70bf9444209ea252a54","user":{"login":"rjain-iitr","id":4263665,"avatar_url":"https://avatars.githubusercontent.com/u/4263665?v=3","gravatar_id":"","url":"https://api.github.com/users/rjain-iitr","html_url":"https://github.com/rjain-iitr","followers_url":"https://api.github.com/users/rjain-iitr/followers","following_url":"https://api.github.com/users/rjain-iitr/following{/other_user}","gists_url":"https://api.github.com/users/rjain-iitr/gists{/gist_id}","starred_url":"https://api.github.com/users/rjain-iitr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjain-iitr/subscriptions","organizations_url":"https://api.github.com/users/rjain-iitr/orgs","repos_url":"https://api.github.com/users/rjain-iitr/repos","events_url":"https://api.github.com/users/rjain-iitr/events{/privacy}","received_events_url":"https://api.github.com/users/rjain-iitr/received_events","type":"User","site_admin":false},"repo":{"id":50097129,"name":"cinder-ec2-api","full_name":"rjain-iitr/cinder-ec2-api","owner":{"login":"rjain-iitr","id":4263665,"avatar_url":"https://avatars.githubusercontent.com/u/4263665?v=3","gravatar_id":"","url":"https://api.github.com/users/rjain-iitr","html_url":"https://github.com/rjain-iitr","followers_url":"https://api.github.com/users/rjain-iitr/followers","following_url":"https://api.github.com/users/rjain-iitr/following{/other_user}","gists_url":"https://api.github.com/users/rjain-iitr/gists{/gist_id}","starred_url":"https://api.github.com/users/rjain-iitr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjain-iitr/subscriptions","organizations_url":"https://api.github.com/users/rjain-iitr/orgs","repos_url":"https://api.github.com/users/rjain-iitr/repos","events_url":"https://api.github.com/users/rjain-iitr/events{/privacy}","received_events_url":"https://api.github.com/users/rjain-iitr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rjain-iitr/cinder-ec2-api","description":"AWS EC2 and VPC API support in standalone service for OpenStack. At first uses nova's EC2 API for non-VPC functionality. Later it'll be transferred here out of nova.","fork":true,"url":"https://api.github.com/repos/rjain-iitr/cinder-ec2-api","forks_url":"https://api.github.com/repos/rjain-iitr/cinder-ec2-api/forks","keys_url":"https://api.github.com/repos/rjain-iitr/cinder-ec2-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rjain-iitr/cinder-ec2-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rjain-iitr/cinder-ec2-api/teams","hooks_url":"https://api.github.com/repos/rjain-iitr/cinder-ec2-api/hooks","issue_events_url":"https://api.github.com/repos/rjain-iitr/cinder-ec2-api/issues/events{/number}","events_url":"https://api.github.com/repos/rjain-iitr/cinder-ec2-api/events","assignees_url":"https://api.github.com/repos/rjain-iitr/cinder-ec2-api/assignees{/user}","branches_url":"https://api.github.com/repos/rjain-iitr/cinder-ec2-api/branches{/branch}","tags_url":"https://api.github.com/repos/rjain-iitr/cinder-ec2-api/tags","blobs_url":"https://api.github.com/repos/rjain-iitr/cinder-ec2-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rjain-iitr/cinder-ec2-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rjain-iitr/cinder-ec2-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/rjain-iitr/cinder-ec2-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rjain-iitr/cinder-ec2-api/statuses/{sha}","languages_url":"https://api.github.com/repos/rjain-iitr/cinder-ec2-api/languages","stargazers_url":"https://api.github.com/repos/rjain-iitr/cinder-ec2-api/stargazers","contributors_url":"https://api.github.com/repos/rjain-iitr/cinder-ec2-api/contributors","subscribers_url":"https://api.github.com/repos/rjain-iitr/cinder-ec2-api/subscribers","subscription_url":"https://api.github.com/repos/rjain-iitr/cinder-ec2-api/subscription","commits_url":"https://api.github.com/repos/rjain-iitr/cinder-ec2-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/rjain-iitr/cinder-ec2-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/rjain-iitr/cinder-ec2-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/rjain-iitr/cinder-ec2-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/rjain-iitr/cinder-ec2-api/contents/{+path}","compare_url":"https://api.github.com/repos/rjain-iitr/cinder-ec2-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rjain-iitr/cinder-ec2-api/merges","archive_url":"https://api.github.com/repos/rjain-iitr/cinder-ec2-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rjain-iitr/cinder-ec2-api/downloads","issues_url":"https://api.github.com/repos/rjain-iitr/cinder-ec2-api/issues{/number}","pulls_url":"https://api.github.com/repos/rjain-iitr/cinder-ec2-api/pulls{/number}","milestones_url":"https://api.github.com/repos/rjain-iitr/cinder-ec2-api/milestones{/number}","notifications_url":"https://api.github.com/repos/rjain-iitr/cinder-ec2-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rjain-iitr/cinder-ec2-api/labels{/name}","releases_url":"https://api.github.com/repos/rjain-iitr/cinder-ec2-api/releases{/id}","deployments_url":"https://api.github.com/repos/rjain-iitr/cinder-ec2-api/deployments","created_at":"2016-01-21T09:35:58Z","updated_at":"2016-01-21T09:35:59Z","pushed_at":"2016-01-22T12:14:18Z","git_url":"git://github.com/rjain-iitr/cinder-ec2-api.git","ssh_url":"git@github.com:rjain-iitr/cinder-ec2-api.git","clone_url":"https://github.com/rjain-iitr/cinder-ec2-api.git","svn_url":"https://github.com/rjain-iitr/cinder-ec2-api","homepage":"http://openstack.org","size":2653,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":false,"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":"JioCloud:stable/kilo","ref":"stable/kilo","sha":"3bf1be0d8d429626e42d048899276e3bd2770dd9","user":{"login":"JioCloud","id":5500757,"avatar_url":"https://avatars.githubusercontent.com/u/5500757?v=3","gravatar_id":"","url":"https://api.github.com/users/JioCloud","html_url":"https://github.com/JioCloud","followers_url":"https://api.github.com/users/JioCloud/followers","following_url":"https://api.github.com/users/JioCloud/following{/other_user}","gists_url":"https://api.github.com/users/JioCloud/gists{/gist_id}","starred_url":"https://api.github.com/users/JioCloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JioCloud/subscriptions","organizations_url":"https://api.github.com/users/JioCloud/orgs","repos_url":"https://api.github.com/users/JioCloud/repos","events_url":"https://api.github.com/users/JioCloud/events{/privacy}","received_events_url":"https://api.github.com/users/JioCloud/received_events","type":"Organization","site_admin":false},"repo":{"id":49059759,"name":"cinder-ec2-api","full_name":"JioCloud/cinder-ec2-api","owner":{"login":"JioCloud","id":5500757,"avatar_url":"https://avatars.githubusercontent.com/u/5500757?v=3","gravatar_id":"","url":"https://api.github.com/users/JioCloud","html_url":"https://github.com/JioCloud","followers_url":"https://api.github.com/users/JioCloud/followers","following_url":"https://api.github.com/users/JioCloud/following{/other_user}","gists_url":"https://api.github.com/users/JioCloud/gists{/gist_id}","starred_url":"https://api.github.com/users/JioCloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JioCloud/subscriptions","organizations_url":"https://api.github.com/users/JioCloud/orgs","repos_url":"https://api.github.com/users/JioCloud/repos","events_url":"https://api.github.com/users/JioCloud/events{/privacy}","received_events_url":"https://api.github.com/users/JioCloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/JioCloud/cinder-ec2-api","description":"AWS EC2 and VPC API support in standalone service for OpenStack. At first uses nova's EC2 API for non-VPC functionality. Later it'll be transferred here out of nova.","fork":true,"url":"https://api.github.com/repos/JioCloud/cinder-ec2-api","forks_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/forks","keys_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/teams","hooks_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/hooks","issue_events_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/issues/events{/number}","events_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/events","assignees_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/assignees{/user}","branches_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/branches{/branch}","tags_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/tags","blobs_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/statuses/{sha}","languages_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/languages","stargazers_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/stargazers","contributors_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/contributors","subscribers_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/subscribers","subscription_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/subscription","commits_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/contents/{+path}","compare_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/merges","archive_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/downloads","issues_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/issues{/number}","pulls_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/pulls{/number}","milestones_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/milestones{/number}","notifications_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/labels{/name}","releases_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/releases{/id}","deployments_url":"https://api.github.com/repos/JioCloud/cinder-ec2-api/deployments","created_at":"2016-01-05T10:41:51Z","updated_at":"2016-01-05T10:42:15Z","pushed_at":"2016-01-22T12:14:18Z","git_url":"git://github.com/JioCloud/cinder-ec2-api.git","ssh_url":"git@github.com:JioCloud/cinder-ec2-api.git","clone_url":"https://github.com/JioCloud/cinder-ec2-api.git","svn_url":"https://github.com/JioCloud/cinder-ec2-api","homepage":"http://openstack.org","size":2647,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JioCloud/cinder-ec2-api/pulls/4"},"html":{"href":"https://github.com/JioCloud/cinder-ec2-api/pull/4"},"issue":{"href":"https://api.github.com/repos/JioCloud/cinder-ec2-api/issues/4"},"comments":{"href":"https://api.github.com/repos/JioCloud/cinder-ec2-api/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/JioCloud/cinder-ec2-api/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/JioCloud/cinder-ec2-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JioCloud/cinder-ec2-api/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/JioCloud/cinder-ec2-api/statuses/9a3e773e2a570e1b49c3d70bf9444209ea252a54"}}}}