Skip to content

Commit

Permalink
releng - ruff whitespace config and github output (cloud-custodian#8649)
Browse files Browse the repository at this point in the history
  • Loading branch information
kapilt authored Jun 20, 2023
1 parent 631c3a9 commit 32d8cc6
Show file tree
Hide file tree
Showing 35 changed files with 216 additions and 209 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
with:
terraform_wrapper: false
- name: Lint Check
env:
RUFF_FORMAT: github
run: |
make lint
- name: Check Workflows
Expand Down
2 changes: 1 addition & 1 deletion c7n/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def get_contents(self):
uri=self.data.get('url'),
headers=self.data.get('headers', {})
)

contents = str(self.resolver.resolve(**params))
return contents, format

Expand Down
2 changes: 1 addition & 1 deletion c7n/resources/appsync.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def process(self, resources):
else:
self.retry(client.disassociate_web_acl,
ResourceArn=r[arn_key])


@GraphQLApi.action_registry.register('delete')
class Delete(Action):
Expand Down
3 changes: 2 additions & 1 deletion c7n/resources/cw.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ class resource_type(TypeInfo):
class EventBusCrossAccountFilter(CrossAccountAccessFilter):
# dummy permission
permissions = ('events:ListEventBuses',)



@EventBus.action_registry.register('delete')
class EventBusDelete(BaseAction):
"""Delete an event bus.
Expand Down
6 changes: 3 additions & 3 deletions c7n/resources/ecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,10 +593,10 @@ class DeleteTaskDefinition(BaseAction):
The definition will be marked as InActive. Currently running
services and task can still reference, new services & tasks
can't.
force is False by default. When given as True, the task definition will
force is False by default. When given as True, the task definition will
be permanently deleted.
.. code-block:: yaml
policies:
Expand Down
2 changes: 1 addition & 1 deletion c7n/resources/efs.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class resource_type(TypeInfo):
arn = False
cfn_type = 'AWS::EFS::MountTarget'
supports_trailevents = True


@ElasticFileSystemMountTarget.filter_registry.register('subnet')
class Subnet(SubnetFilter):
Expand Down
2 changes: 1 addition & 1 deletion c7n/resources/elasticsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ class RemoveMatchedSourceIps(BaseAction):
ElasticSearch domain.
:example:
.. code-block:: yaml
policies:
Expand Down
2 changes: 1 addition & 1 deletion c7n/resources/iam.py
Original file line number Diff line number Diff line change
Expand Up @@ -1956,7 +1956,7 @@ class UserPolicy(ValueFilter):
include-via: true
"""

schema = type_schema('policy', rinherit=ValueFilter.schema,
schema = type_schema('policy', rinherit=ValueFilter.schema,
**{'include-via': {'type': 'boolean'}})
schema_alias = False
permissions = (
Expand Down
22 changes: 12 additions & 10 deletions c7n/resources/kinesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ class KmsFilterVideoStream(KmsRelatedFilter):

RelatedIdsExpression = 'KmsKeyId'


@KinesisVideoStream.action_registry.register("tag")
class TagVideoStream(Tag):
"""Action to add tag/tags to Kinesis Video streams resource
Expand All @@ -419,15 +420,16 @@ class TagVideoStream(Tag):
value: "KinesisVideo Tag Value"
"""
permissions = ('kinesisvideo:TagResource',)

def process_resource_set(self, client, resource_set, tag_keys):
for r in resource_set:
self.manager.retry(
client.tag_resource,
ResourceARN=r['StreamARN'],
Tags=tag_keys,
client.tag_resource,
ResourceARN=r['StreamARN'],
Tags=tag_keys,
ignore_err_codes=("ResourceNotFoundException",))



@KinesisVideoStream.action_registry.register('remove-tag')
class VideoStreamRemoveTag(RemoveTag):
"""Action to remove tag/tags from a Kinesis Video streams resource
Expand All @@ -445,14 +447,14 @@ class VideoStreamRemoveTag(RemoveTag):
- type: remove-tag
tags: ["KinesisVideoTag"]
"""

permissions = ('kinesisvideo:UntagResource',)

def process_resource_set(self, client, resource_set, tag_keys):
for r in resource_set:
self.manager.retry(
client.untag_resource,
ResourceARN=r['StreamARN'],
TagKeyList=tag_keys,
client.untag_resource,
ResourceARN=r['StreamARN'],
TagKeyList=tag_keys,
ignore_err_codes=("ResourceNotFoundException",))

2 changes: 1 addition & 1 deletion c7n/resources/rds.py
Original file line number Diff line number Diff line change
Expand Up @@ -2108,7 +2108,7 @@ def handle_optiongroup_cache(self, client, paginator, option_groups):
ogcache[og] = option_group

cache.save(cache_key, ogcache[og])

return ogcache

def process(self, resources, event=None):
Expand Down
2 changes: 1 addition & 1 deletion c7n/resources/ses.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class DescribeConfigurationSet(DescribeSource):
def augment(self, resources):
client = local_session(self.manager.session_factory).client('ses')
for r in resources:
details = client.describe_configuration_set(ConfigurationSetName=r['Name'],
details = client.describe_configuration_set(ConfigurationSetName=r['Name'],
ConfigurationSetAttributeNames=['eventDestinations','trackingOptions','deliveryOptions','reputationOptions'])
r.update({
k: details[k]
Expand Down
Loading

0 comments on commit 32d8cc6

Please sign in to comment.