-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* support versioned download * PR comments * support several other operations * remove some newlines * add s3 mv tests * add cli args * provide options to list versions * tweak help str * add flag for rm * lint fix * don't support mv command on versioned files
- Loading branch information
Chenyang Liu
authored
Apr 10, 2017
1 parent
87dbd86
commit bfc30a7
Showing
7 changed files
with
123 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
def get_versioned_key_remote(bucket, key_name, version_id=None): | ||
''' | ||
Utility function to get versioned key from a bucket | ||
''' | ||
from boto.exception import S3ResponseError | ||
from baiji.exceptions import InvalidVersionID | ||
|
||
key = None | ||
try: | ||
key = bucket.get_key(key_name, version_id=version_id) | ||
except S3ResponseError as e: | ||
if e.status == 400: | ||
raise InvalidVersionID("Invalid versionID %s" % version_id) | ||
else: | ||
raise e | ||
return key |