Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow buckets with periods in their names #22

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ If you're looking for the same kind of tool, but for APT repositories, I can rec

1. You have python installed (2.6+).

1. You have your S3 credentials available in the `AWS_ACCESS_KEY` and `AWS_SECRET_KEY` environment variables:
1. You have your S3 credentials available in the `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment variables:

export AWS_ACCESS_KEY="key"
export AWS_SECRET_KEY="secret"
export AWS_ACCESS_KEY_ID="key"
export AWS_SECRET_ACCESS_KEY="secret"

## Installation

Expand All @@ -31,7 +31,7 @@ Use the provided `/test/test.sh` script:

vagrant up
vagrant ssh
AWS_ACCESS_KEY=xx AWS_SECRET_KET=yy BUCKET=zz ./test/test.sh
AWS_ACCESS_KEY_ID=xx AWS_SECRET_ACCESS_KEY=yy BUCKET=zz ./test/test.sh

Also:

Expand All @@ -58,7 +58,7 @@ Have a `~/.rpmmacros` file ready with the following content:

Pass the `--sign` option to `rpm-s3`:

AWS_ACCESS_KEY="key" AWS_SECRET_KEY="secret" ./bin/rpm-s3 --sign my-app-1.0.0.x86_64.rpm
AWS_ACCESS_KEY_ID="key" AWS_SECRET_ACCESS_KEY="secret" ./bin/rpm-s3 --sign my-app-1.0.0.x86_64.rpm

### Import gpg key to install signed packages

Expand Down
27 changes: 15 additions & 12 deletions bin/rpm-s3
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
#!/usr/bin/env python
"""CLI for serialising metadata updates on an s3-hosted yum repository.
"""
import boto
import boto.s3.connection
import collections
import logging
import optparse
import os
import shutil
import subprocess
import sys
import tempfile
import time
import urlparse
import tempfile
import shutil
import optparse
import logging
import collections
import yum
import boto
import subprocess

lib_root = os.path.dirname(os.path.dirname(__file__))

Expand Down Expand Up @@ -107,15 +108,17 @@ class FileGrabber(object):


def getclient(base, host_url):
if os.getenv('AWS_ACCESS_KEY'):
if os.getenv('AWS_ACCESS_KEY_ID'):
return boto.connect_s3(
os.getenv('AWS_ACCESS_KEY'),
os.getenv('AWS_SECRET_KEY'),
host=host_url
os.getenv('AWS_ACCESS_KEY_ID'),
os.getenv('AWS_SECRET_ACCESS_KEY'),
host=host_url,
calling_format=boto.s3.connection.OrdinaryCallingFormat()
).get_bucket(base.netloc)
else:
return boto.connect_s3(
host=host_url
host=host_url,
calling_format=boto.s3.connection.OrdinaryCallingFormat()
).get_bucket(base.netloc)


Expand Down