{"action":"created","comment":{"url":"https://api.github.com/repos/heptio/rpm-s3/pulls/comments/216337558","pull_request_review_id":153793964,"id":216337558,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNjMzNzU1OA==","diff_hunk":"@@ -108,24 +106,42 @@ class FileGrabber(object):\n \n def getclient(base, host_url):\n     if os.getenv('AWS_ACCESS_KEY'):\n-        return boto.connect_s3(\n+        client = boto.connect_s3(\n             os.getenv('AWS_ACCESS_KEY'),\n             os.getenv('AWS_SECRET_KEY'),\n             host=host_url\n-        ).get_bucket(base.netloc)\n+        )\n     else:\n-        return boto.connect_s3(\n+        client = boto.connect_s3(\n             host=host_url\n-        ).get_bucket(base.netloc)\n-\n+        )\n+    b = client.get_bucket(options.bucket)\n+    loc = b.get_location()  \n+    if loc: # not US standard\n+        client = boto.s3.connect_to_region(loc)\n+    return client.get_bucket(options.bucket)\n+\n+def get_rpm_gpg_opts():\n+    optlist = []\n+    if options.gpg_cmd:\n+        optlist.append('--define \"%__gpg {}\"'.format(options.gpg_cmd))\n+    if options.signing_key:\n+        optlist.append('--define \"%_gpg_name {}\"'.format(options.signing_key))\n+    return optlist\n+\n+def get_gpg_opts():\n+    if options.signing_key:\n+        return [\"--local-user\", options.signing_key]\n+            \n \n def sign(rpmfile):\n     \"\"\"Requires a proper ~/.rpmmacros file. See <http://fedoranews.org/tchung/gpg/>\"\"\"\n     # TODO: check if file is indeed signed\n-    cmd = \"rpm --resign '%s'\" % rpmfile\n+    cmd = [\"rpm\", \"--resign\", rpmfile] + get_rpm_gpg_opts()\n+    cmd = \" \".join(cmd)\n     logging.info(cmd)\n     try:\n-        child = pexpect.spawn(cmd)\n+\tchild = pexpect.spawn(cmd)","path":"bin/rpm-s3","position":60,"original_position":60,"commit_id":"654cabf1cc1c79fb39b2d6a7a10ab14e4fb6a457","original_commit_id":"654cabf1cc1c79fb39b2d6a7a10ab14e4fb6a457","user":{"login":"ncdc","id":354,"node_id":"MDQ6VXNlcjM1NA==","avatar_url":"https://avatars2.githubusercontent.com/u/354?v=4","gravatar_id":"","url":"https://api.github.com/users/ncdc","html_url":"https://github.com/ncdc","followers_url":"https://api.github.com/users/ncdc/followers","following_url":"https://api.github.com/users/ncdc/following{/other_user}","gists_url":"https://api.github.com/users/ncdc/gists{/gist_id}","starred_url":"https://api.github.com/users/ncdc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncdc/subscriptions","organizations_url":"https://api.github.com/users/ncdc/orgs","repos_url":"https://api.github.com/users/ncdc/repos","events_url":"https://api.github.com/users/ncdc/events{/privacy}","received_events_url":"https://api.github.com/users/ncdc/received_events","type":"User","site_admin":false},"body":"Looks like I messed up indentation","created_at":"2018-09-10T14:14:40Z","updated_at":"2018-09-10T14:14:40Z","html_url":"https://github.com/heptio/rpm-s3/pull/1#discussion_r216337558","pull_request_url":"https://api.github.com/repos/heptio/rpm-s3/pulls/1","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/heptio/rpm-s3/pulls/comments/216337558"},"html":{"href":"https://github.com/heptio/rpm-s3/pull/1#discussion_r216337558"},"pull_request":{"href":"https://api.github.com/repos/heptio/rpm-s3/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/heptio/rpm-s3/pulls/1","id":214022820,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE0MDIyODIw","html_url":"https://github.com/heptio/rpm-s3/pull/1","diff_url":"https://github.com/heptio/rpm-s3/pull/1.diff","patch_url":"https://github.com/heptio/rpm-s3/pull/1.patch","issue_url":"https://api.github.com/repos/heptio/rpm-s3/issues/1","number":1,"state":"open","locked":false,"title":"Refactor for gpg signing of rpms","user":{"login":"rdodev","id":1234335,"node_id":"MDQ6VXNlcjEyMzQzMzU=","avatar_url":"https://avatars2.githubusercontent.com/u/1234335?v=4","gravatar_id":"","url":"https://api.github.com/users/rdodev","html_url":"https://github.com/rdodev","followers_url":"https://api.github.com/users/rdodev/followers","following_url":"https://api.github.com/users/rdodev/following{/other_user}","gists_url":"https://api.github.com/users/rdodev/gists{/gist_id}","starred_url":"https://api.github.com/users/rdodev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rdodev/subscriptions","organizations_url":"https://api.github.com/users/rdodev/orgs","repos_url":"https://api.github.com/users/rdodev/repos","events_url":"https://api.github.com/users/rdodev/events{/privacy}","received_events_url":"https://api.github.com/users/rdodev/received_events","type":"User","site_admin":false},"body":"Code changes to make rpm-s3 work with our home-grown gpg utility.\r\n\r\n* Removed git submodule pexpect \r\n* Leveraging pip for installing boto, pexpect and others that were previously yum'd\r\n* Dockerfile for running in a container\r\n* Added options for bespoke gpg command\r\n* Added logic for rpm macros and additional gpg options\r\n* Added bucket-region discovery code","created_at":"2018-09-07T19:46:25Z","updated_at":"2018-09-10T14:14:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aa1a524ce0652ec2211d98ed2eb5cbe43c62faa6","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/heptio/rpm-s3/pulls/1/commits","review_comments_url":"https://api.github.com/repos/heptio/rpm-s3/pulls/1/comments","review_comment_url":"https://api.github.com/repos/heptio/rpm-s3/pulls/comments{/number}","comments_url":"https://api.github.com/repos/heptio/rpm-s3/issues/1/comments","statuses_url":"https://api.github.com/repos/heptio/rpm-s3/statuses/654cabf1cc1c79fb39b2d6a7a10ab14e4fb6a457","head":{"label":"rdodev:refactor","ref":"refactor","sha":"654cabf1cc1c79fb39b2d6a7a10ab14e4fb6a457","user":{"login":"rdodev","id":1234335,"node_id":"MDQ6VXNlcjEyMzQzMzU=","avatar_url":"https://avatars2.githubusercontent.com/u/1234335?v=4","gravatar_id":"","url":"https://api.github.com/users/rdodev","html_url":"https://github.com/rdodev","followers_url":"https://api.github.com/users/rdodev/followers","following_url":"https://api.github.com/users/rdodev/following{/other_user}","gists_url":"https://api.github.com/users/rdodev/gists{/gist_id}","starred_url":"https://api.github.com/users/rdodev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rdodev/subscriptions","organizations_url":"https://api.github.com/users/rdodev/orgs","repos_url":"https://api.github.com/users/rdodev/repos","events_url":"https://api.github.com/users/rdodev/events{/privacy}","received_events_url":"https://api.github.com/users/rdodev/received_events","type":"User","site_admin":false},"repo":{"id":147578468,"node_id":"MDEwOlJlcG9zaXRvcnkxNDc1Nzg0Njg=","name":"rpm-s3","full_name":"rdodev/rpm-s3","owner":{"login":"rdodev","id":1234335,"node_id":"MDQ6VXNlcjEyMzQzMzU=","avatar_url":"https://avatars2.githubusercontent.com/u/1234335?v=4","gravatar_id":"","url":"https://api.github.com/users/rdodev","html_url":"https://github.com/rdodev","followers_url":"https://api.github.com/users/rdodev/followers","following_url":"https://api.github.com/users/rdodev/following{/other_user}","gists_url":"https://api.github.com/users/rdodev/gists{/gist_id}","starred_url":"https://api.github.com/users/rdodev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rdodev/subscriptions","organizations_url":"https://api.github.com/users/rdodev/orgs","repos_url":"https://api.github.com/users/rdodev/repos","events_url":"https://api.github.com/users/rdodev/events{/privacy}","received_events_url":"https://api.github.com/users/rdodev/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rdodev/rpm-s3","description":"Maintain YUM repositories of RPM packages on S3, intelligently.","fork":true,"url":"https://api.github.com/repos/rdodev/rpm-s3","forks_url":"https://api.github.com/repos/rdodev/rpm-s3/forks","keys_url":"https://api.github.com/repos/rdodev/rpm-s3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rdodev/rpm-s3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rdodev/rpm-s3/teams","hooks_url":"https://api.github.com/repos/rdodev/rpm-s3/hooks","issue_events_url":"https://api.github.com/repos/rdodev/rpm-s3/issues/events{/number}","events_url":"https://api.github.com/repos/rdodev/rpm-s3/events","assignees_url":"https://api.github.com/repos/rdodev/rpm-s3/assignees{/user}","branches_url":"https://api.github.com/repos/rdodev/rpm-s3/branches{/branch}","tags_url":"https://api.github.com/repos/rdodev/rpm-s3/tags","blobs_url":"https://api.github.com/repos/rdodev/rpm-s3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rdodev/rpm-s3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rdodev/rpm-s3/git/refs{/sha}","trees_url":"https://api.github.com/repos/rdodev/rpm-s3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rdodev/rpm-s3/statuses/{sha}","languages_url":"https://api.github.com/repos/rdodev/rpm-s3/languages","stargazers_url":"https://api.github.com/repos/rdodev/rpm-s3/stargazers","contributors_url":"https://api.github.com/repos/rdodev/rpm-s3/contributors","subscribers_url":"https://api.github.com/repos/rdodev/rpm-s3/subscribers","subscription_url":"https://api.github.com/repos/rdodev/rpm-s3/subscription","commits_url":"https://api.github.com/repos/rdodev/rpm-s3/commits{/sha}","git_commits_url":"https://api.github.com/repos/rdodev/rpm-s3/git/commits{/sha}","comments_url":"https://api.github.com/repos/rdodev/rpm-s3/comments{/number}","issue_comment_url":"https://api.github.com/repos/rdodev/rpm-s3/issues/comments{/number}","contents_url":"https://api.github.com/repos/rdodev/rpm-s3/contents/{+path}","compare_url":"https://api.github.com/repos/rdodev/rpm-s3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rdodev/rpm-s3/merges","archive_url":"https://api.github.com/repos/rdodev/rpm-s3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rdodev/rpm-s3/downloads","issues_url":"https://api.github.com/repos/rdodev/rpm-s3/issues{/number}","pulls_url":"https://api.github.com/repos/rdodev/rpm-s3/pulls{/number}","milestones_url":"https://api.github.com/repos/rdodev/rpm-s3/milestones{/number}","notifications_url":"https://api.github.com/repos/rdodev/rpm-s3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rdodev/rpm-s3/labels{/name}","releases_url":"https://api.github.com/repos/rdodev/rpm-s3/releases{/id}","deployments_url":"https://api.github.com/repos/rdodev/rpm-s3/deployments","created_at":"2018-09-05T20:55:33Z","updated_at":"2018-09-05T20:55:34Z","pushed_at":"2018-09-07T19:53:37Z","git_url":"git://github.com/rdodev/rpm-s3.git","ssh_url":"git@github.com:rdodev/rpm-s3.git","clone_url":"https://github.com/rdodev/rpm-s3.git","svn_url":"https://github.com/rdodev/rpm-s3","homepage":null,"size":139,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"bsd-2-clause","name":"BSD 2-Clause \"Simplified\" License","spdx_id":"BSD-2-Clause","url":"https://api.github.com/licenses/bsd-2-clause","node_id":"MDc6TGljZW5zZTQ="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"heptio:master","ref":"master","sha":"db3ef54a6c55e5812ef41a338c7905461c2c8612","user":{"login":"heptio","id":22035492,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMDM1NDky","avatar_url":"https://avatars0.githubusercontent.com/u/22035492?v=4","gravatar_id":"","url":"https://api.github.com/users/heptio","html_url":"https://github.com/heptio","followers_url":"https://api.github.com/users/heptio/followers","following_url":"https://api.github.com/users/heptio/following{/other_user}","gists_url":"https://api.github.com/users/heptio/gists{/gist_id}","starred_url":"https://api.github.com/users/heptio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heptio/subscriptions","organizations_url":"https://api.github.com/users/heptio/orgs","repos_url":"https://api.github.com/users/heptio/repos","events_url":"https://api.github.com/users/heptio/events{/privacy}","received_events_url":"https://api.github.com/users/heptio/received_events","type":"Organization","site_admin":false},"repo":{"id":147713245,"node_id":"MDEwOlJlcG9zaXRvcnkxNDc3MTMyNDU=","name":"rpm-s3","full_name":"heptio/rpm-s3","owner":{"login":"heptio","id":22035492,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMDM1NDky","avatar_url":"https://avatars0.githubusercontent.com/u/22035492?v=4","gravatar_id":"","url":"https://api.github.com/users/heptio","html_url":"https://github.com/heptio","followers_url":"https://api.github.com/users/heptio/followers","following_url":"https://api.github.com/users/heptio/following{/other_user}","gists_url":"https://api.github.com/users/heptio/gists{/gist_id}","starred_url":"https://api.github.com/users/heptio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heptio/subscriptions","organizations_url":"https://api.github.com/users/heptio/orgs","repos_url":"https://api.github.com/users/heptio/repos","events_url":"https://api.github.com/users/heptio/events{/privacy}","received_events_url":"https://api.github.com/users/heptio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/heptio/rpm-s3","description":"Maintain YUM repositories of RPM packages on S3, intelligently.","fork":true,"url":"https://api.github.com/repos/heptio/rpm-s3","forks_url":"https://api.github.com/repos/heptio/rpm-s3/forks","keys_url":"https://api.github.com/repos/heptio/rpm-s3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/heptio/rpm-s3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/heptio/rpm-s3/teams","hooks_url":"https://api.github.com/repos/heptio/rpm-s3/hooks","issue_events_url":"https://api.github.com/repos/heptio/rpm-s3/issues/events{/number}","events_url":"https://api.github.com/repos/heptio/rpm-s3/events","assignees_url":"https://api.github.com/repos/heptio/rpm-s3/assignees{/user}","branches_url":"https://api.github.com/repos/heptio/rpm-s3/branches{/branch}","tags_url":"https://api.github.com/repos/heptio/rpm-s3/tags","blobs_url":"https://api.github.com/repos/heptio/rpm-s3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/heptio/rpm-s3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/heptio/rpm-s3/git/refs{/sha}","trees_url":"https://api.github.com/repos/heptio/rpm-s3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/heptio/rpm-s3/statuses/{sha}","languages_url":"https://api.github.com/repos/heptio/rpm-s3/languages","stargazers_url":"https://api.github.com/repos/heptio/rpm-s3/stargazers","contributors_url":"https://api.github.com/repos/heptio/rpm-s3/contributors","subscribers_url":"https://api.github.com/repos/heptio/rpm-s3/subscribers","subscription_url":"https://api.github.com/repos/heptio/rpm-s3/subscription","commits_url":"https://api.github.com/repos/heptio/rpm-s3/commits{/sha}","git_commits_url":"https://api.github.com/repos/heptio/rpm-s3/git/commits{/sha}","comments_url":"https://api.github.com/repos/heptio/rpm-s3/comments{/number}","issue_comment_url":"https://api.github.com/repos/heptio/rpm-s3/issues/comments{/number}","contents_url":"https://api.github.com/repos/heptio/rpm-s3/contents/{+path}","compare_url":"https://api.github.com/repos/heptio/rpm-s3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/heptio/rpm-s3/merges","archive_url":"https://api.github.com/repos/heptio/rpm-s3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/heptio/rpm-s3/downloads","issues_url":"https://api.github.com/repos/heptio/rpm-s3/issues{/number}","pulls_url":"https://api.github.com/repos/heptio/rpm-s3/pulls{/number}","milestones_url":"https://api.github.com/repos/heptio/rpm-s3/milestones{/number}","notifications_url":"https://api.github.com/repos/heptio/rpm-s3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/heptio/rpm-s3/labels{/name}","releases_url":"https://api.github.com/repos/heptio/rpm-s3/releases{/id}","deployments_url":"https://api.github.com/repos/heptio/rpm-s3/deployments","created_at":"2018-09-06T18:02:39Z","updated_at":"2018-09-06T18:02:42Z","pushed_at":"2018-09-07T19:53:38Z","git_url":"git://github.com/heptio/rpm-s3.git","ssh_url":"git@github.com:heptio/rpm-s3.git","clone_url":"https://github.com/heptio/rpm-s3.git","svn_url":"https://github.com/heptio/rpm-s3","homepage":null,"size":138,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"bsd-2-clause","name":"BSD 2-Clause \"Simplified\" License","spdx_id":"BSD-2-Clause","url":"https://api.github.com/licenses/bsd-2-clause","node_id":"MDc6TGljZW5zZTQ="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/heptio/rpm-s3/pulls/1"},"html":{"href":"https://github.com/heptio/rpm-s3/pull/1"},"issue":{"href":"https://api.github.com/repos/heptio/rpm-s3/issues/1"},"comments":{"href":"https://api.github.com/repos/heptio/rpm-s3/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/heptio/rpm-s3/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/heptio/rpm-s3/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/heptio/rpm-s3/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/heptio/rpm-s3/statuses/654cabf1cc1c79fb39b2d6a7a10ab14e4fb6a457"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"ncdc"}}