Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Commit

Permalink
Fix Pylint violations C0301
Browse files Browse the repository at this point in the history
  • Loading branch information
sopel committed Apr 15, 2013
1 parent bb6dbba commit 07a87d8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
10 changes: 7 additions & 3 deletions botocross/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,14 @@ def build_region_parser():

def build_filter_parser(resource_name, add_ids=True):
parser = argparse.ArgumentParser(add_help=False)
parser.add_argument("-f", "--filter", action="append", help="A {0} filter. [can be used multiple times]".format(resource_name))
parser.add_argument("-x", "--exclude", action="append", help="A {0} filter (matching ones are excluded). [can be used multiple times]".format(resource_name))
parser.add_argument("-f", "--filter", action="append",
help="A {0} filter. [can be used multiple times]".format(resource_name))
parser.add_argument("-x", "--exclude", action="append",
help="A {0} filter (matching ones are excluded). [can be used multiple times]"
.format(resource_name))
if add_ids:
parser.add_argument("-i", "--id", dest="resource_ids", action="append", help="A {0} id. [can be used multiple times]".format(resource_name))
parser.add_argument("-i", "--id", dest="resource_ids", action="append",
help="A {0} id. [can be used multiple times]".format(resource_name))
return parser

def parse_credentials(args):
Expand Down
6 changes: 4 additions & 2 deletions botocross/ec2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ def expire_snapshots(ec2, volume_ids, backup_set, backup_retention, no_origin_sa
snapshot_filters['description'] = CREATED_BY_BOTO_EBS_SNAPSHOT_SCRIPT_SIGNATURE + volume_id
log.debug(snapshot_filters)
snapshots = ec2.get_all_snapshots(owner='self', filters=snapshot_filters)
log.info("Deleting snapshots of " + volume_id + " (set '" + backup_set + "', " + str(len(snapshots)) + " available, retaining " + str(backup_retention) + "):")
log.info("Deleting snapshots of " + volume_id + " (set '" + backup_set + "', " + str(len(snapshots)) +
" available, retaining " + str(backup_retention) + "):")
# While snapshots are apparently returned in oldest to youngest order, this isn't documented;
# therefore an explicit sort is performed to ensure this regardless.
num_snapshots = len(snapshots);
Expand Down Expand Up @@ -101,7 +102,8 @@ def expire_images(ec2, instance_ids, backup_set, backup_retention, no_origin_saf
image_filters['description'] = CREATED_BY_BOTO_EC2_IMAGE_SCRIPT_SIGNATURE + instance_id
log.debug(image_filters)
images = ec2.get_all_images(owners=['self'], filters=image_filters)
log.info("Deregistering images of " + instance_id + " (set '" + backup_set + "', " + str(len(images)) + " available, retaining " + str(backup_retention) + "):")
log.info("Deregistering images of " + instance_id + " (set '" + backup_set + "', " + str(len(images)) +
" available, retaining " + str(backup_retention) + "):")
# While images are apparently returned in oldest to youngest order, this isn't documented;
# therefore an explicit sort is performed to ensure this regardless.
num_images = len(images)
Expand Down
3 changes: 2 additions & 1 deletion botocross/iam/userinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ def __init__(self, iam_connection):
self.id = botocross.iam.RESOURCE_UNAUTHORIZED # TODO: could be deduced from credentials in use instead.

def __repr__(self):
return '<UserInfo - path:%s create_date:%s id:%s arn:%s name:%s>' % (self.path, self.create_date, self.id, self.arn, self.name)
template = '<UserInfo - path:%s create_date:%s id:%s arn:%s name:%s>'
return template % (self.path, self.create_date, self.id, self.arn, self.name)

def describe(self):
try:
Expand Down

0 comments on commit 07a87d8

Please sign in to comment.