Skip to content

Commit

Permalink
fixed bug with arn parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickbcullen committed Jun 12, 2017
1 parent e267c5a commit cd55c21
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

setup(
name='aws-tagger',
version='0.5.0',
version='0.5.1',
packages=find_packages(),
include_package_data=True,
install_requires=[
Expand All @@ -28,7 +28,7 @@
author="Patrick Cullen and the WaPo platform tools team",
author_email="[email protected]",
url="https://github.com/washingtonpost/aws-tagger",
download_url = "https://github.com/washingtonpost/aws-tagger/tarball/v0.5.0",
download_url = "https://github.com/washingtonpost/aws-tagger/tarball/v0.5.1",
keywords = ['tag', 'tagger', 'tagging', 'aws'],
classifiers = []
)
6 changes: 5 additions & 1 deletion tagger/tagger.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def tag(self, resource_id, tags):
return

tagger = None
resource_arn = resource_id
if resource_id.startswith('arn:'):
product, resource_id = self._parse_arn(resource_id)
if product:
Expand All @@ -90,13 +91,16 @@ def tag(self, resource_id, tags):

if resource_id.startswith('i-'):
tagger = self.taggers['ec2']
resource_arn = resource_id
elif resource_id.startswith('vol-'):
tagger = self.taggers['ec2']
resource_arn = resource_id
elif resource_id.startswith('snap-'):
tagger = self.taggers['ec2']
resource_arn = resource_id

if tagger:
tagger.tag(resource_id, tags)
tagger.tag(resource_arn, tags)
else:
print "Tagging is not support for this resource %s" % resource_id

Expand Down

0 comments on commit cd55c21

Please sign in to comment.