From 9071ce3144b8ca8257c2f2ce979318967866db54 Mon Sep 17 00:00:00 2001 From: Thirumalesh Aaraveti Date: Mon, 3 Jun 2024 13:41:18 +0530 Subject: [PATCH] pre-commit: end-of-file-fixer --- .coveralls.yml | 2 +- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- .github/ISSUE_TEMPLATE/feature_request.md | 2 +- .pre-commit-config.yaml | 1 + cloud_governance/cloud_resource_orchestration/README.md | 2 +- .../clouds/aws/ec2/collect_cro_reports.py | 1 - .../clouds/azure/resource_groups/azure_monitor_tickets.py | 4 ---- .../clouds/azure/resource_groups/cost_over_usage.py | 1 - .../common/clouds/aws/athena/abstract_athena_operations.py | 1 - .../common/clouds/azure/subscriptions/azure_operations.py | 5 ----- .../common/elasticsearch/elasticsearch_exceptions.py | 2 +- cloud_governance/common/jira/jira_operations.py | 1 - cloud_governance/common/logger/init_logger.py | 1 - cloud_governance/policy/azure/cleanup/instance_idle.py | 1 - cloud_governance/policy/azure/cleanup/unattached_volume.py | 1 - .../aws/tag_cluster/run_tag_cluster_resouces.py | 1 - .../aws/tag_non_cluster/run_tag_non_cluster_resources.py | 1 - .../aws/zombie_cluster/zombie_cluster_common_methods.py | 1 - .../policy/policy_operations/gitleaks/gitleaks.py | 2 +- .../policy_operations/ibm/ibm_operations/ibm_operations.py | 4 ---- cloud_governance/policy/policy_runners/aws/policy_runner.py | 1 - .../policy/policy_runners/common/abstract_policy_runner.py | 1 - .../clouds/aws/instances_price.json | 2 +- .../cloud_resource_orchestration/common/projects.txt | 2 +- cloudsensei/email_template.j2 | 2 +- docs/source/conf.py | 2 +- docs/source/configuration.md | 2 +- docs/source/index.md | 3 --- docs/source/podman.md | 2 +- docs/source/tagging.md | 3 --- grafana/clouds/aws/aws_global_dashboard.json | 2 +- grafana/clouds/aws/cost_explorer_main.json | 2 +- grafana/clouds/aws/payer_account_billing_reports.json | 2 +- grafana/clouds/ibm/ibm_global_dashboard.json | 2 +- how_to_add_aws_account | 2 +- iam/clouds/aws/create_bucket.sh | 2 +- .../aws/delete/CloudGovernanceDeleteCostExplorerPolicy | 2 +- iam/clouds/aws/delete/CloudGovernanceIAMPolicy | 2 +- iam/clouds/aws/not_delete/CloudGovernanceCostExplorerPolicy | 2 +- iam/clouds/aws/not_delete/CloudGovernanceIAMPolicy | 2 +- .../payer_roles/CloudGovernanceCostExplorerReadPolicy.json | 2 +- .../payer_roles/CloudGovernanceCostExplorerReadRole.json | 2 +- iam/clouds/aws/payer_roles/README.md | 2 +- jenkins/README.md | 1 - jenkins/Step_by_Step.md | 2 +- pod_yaml/cloud-governance.yaml | 3 --- pod_yaml/cloud_governance_secret.yaml | 2 +- pod_yaml/quayio_secret.sh | 2 +- pod_yaml/upload_quayio | 2 +- .../aws/zombie_cluster/test_ec2_zombie_delete.py | 1 - .../aws/zombie_cluster/test_s3_zombie_delete.py | 6 ------ .../common/clouds/gcp/test_google_account.py | 1 - .../test_upload_cloudtrail_data_to_dynamodb.py | 6 ------ .../test_zombie_iam_cluster_delete_resource.py | 1 - .../clouds/azure/resource_groups/test_cost_over_usage.py | 1 - .../azure/monitor/test_monitor_management_operations.py | 2 -- .../common/elasticsearch/test_elasticsearch_operations.py | 2 +- .../policy/helpers/aws/test_aws_policy_operations.py | 1 - tests/unittest/mocks/azure/common_operations.py | 2 -- 59 files changed, 31 insertions(+), 86 deletions(-) diff --git a/.coveralls.yml b/.coveralls.yml index bcc16798..2dfbf2d4 100644 --- a/.coveralls.yml +++ b/.coveralls.yml @@ -1,2 +1,2 @@ service_name: travis-pro -parallel: true \ No newline at end of file +parallel: true diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 272cbd70..dd84ea78 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -35,4 +35,4 @@ If applicable, add screenshots to help explain your problem. - Version [e.g. 22] **Additional context** -Add any other context about the problem here. \ No newline at end of file +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 24473dee..bbcbbe7d 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -17,4 +17,4 @@ A clear and concise description of what you want to happen. A clear and concise description of any alternative solutions or features you've considered. **Additional context** -Add any other context or screenshots about the feature request here. \ No newline at end of file +Add any other context or screenshots about the feature request here. diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 76ffbab2..4c6436cc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,3 +16,4 @@ repos: - id: check-json - id: check-yaml - id: trailing-whitespace + - id: end-of-file-fixer diff --git a/cloud_governance/cloud_resource_orchestration/README.md b/cloud_governance/cloud_resource_orchestration/README.md index d479e8d8..8e58c36b 100644 --- a/cloud_governance/cloud_resource_orchestration/README.md +++ b/cloud_governance/cloud_resource_orchestration/README.md @@ -11,4 +11,4 @@ To start **cloud_resource_orchestration** CI run the below podman command ```commandline podman run --net="host" --rm --name cloud_resource_orchestration -e AWS_DEFAULT_REGION="ap-south-1" -e CLOUD_RESOURCE_ORCHESTRATION="True" -e account="$account" -e AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID" -e AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY" -e PUBLIC_CLOUD_NAME="$PUBLIC_CLOUD_NAME" -e es_host="$ES_HOST" -e es_port="$ES_PORT" -e CRO_ES_INDEX="$CRO_ES_INDEX" -e log_level="INFO" -e LDAP_HOST_NAME="$LDAP_HOST_NAME" -e JIRA_QUEUE="$JIRA_QUEUE" -e JIRA_TOKEN="$JIRA_TOKEN" -e JIRA_USERNAME="$JIRA_USERNAME" -e JIRA_URL="$JIRA_URL" -e CRO_COST_OVER_USAGE="$CRO_COST_OVER_USAGE" -e CRO_PORTAL="$CRO_PORTAL" -e CRO_DEFAULT_ADMINS="$CRO_DEFAULT_ADMINS" -e CRO_REPLACED_USERNAMES="$CRO_REPLACED_USERNAMES" -e CRO_DURATION_DAYS="30" quay.io/ebattat/cloud-governance:latest -``` \ No newline at end of file +``` diff --git a/cloud_governance/cloud_resource_orchestration/clouds/aws/ec2/collect_cro_reports.py b/cloud_governance/cloud_resource_orchestration/clouds/aws/ec2/collect_cro_reports.py index 81856385..586ca438 100644 --- a/cloud_governance/cloud_resource_orchestration/clouds/aws/ec2/collect_cro_reports.py +++ b/cloud_governance/cloud_resource_orchestration/clouds/aws/ec2/collect_cro_reports.py @@ -329,4 +329,3 @@ def run(self, monitor_data: dict): result = self.__upload_cro_report_to_es(monitor_data=monitor_data) handler.setLevel(logging.WARN) return result - diff --git a/cloud_governance/cloud_resource_orchestration/clouds/azure/resource_groups/azure_monitor_tickets.py b/cloud_governance/cloud_resource_orchestration/clouds/azure/resource_groups/azure_monitor_tickets.py index 7156ddfb..4112559a 100644 --- a/cloud_governance/cloud_resource_orchestration/clouds/azure/resource_groups/azure_monitor_tickets.py +++ b/cloud_governance/cloud_resource_orchestration/clouds/azure/resource_groups/azure_monitor_tickets.py @@ -60,7 +60,3 @@ def run(self): :return: # """ self.monitor_tickets() - - - - diff --git a/cloud_governance/cloud_resource_orchestration/clouds/azure/resource_groups/cost_over_usage.py b/cloud_governance/cloud_resource_orchestration/clouds/azure/resource_groups/cost_over_usage.py index 43a1bddb..f6198487 100644 --- a/cloud_governance/cloud_resource_orchestration/clouds/azure/resource_groups/cost_over_usage.py +++ b/cloud_governance/cloud_resource_orchestration/clouds/azure/resource_groups/cost_over_usage.py @@ -80,4 +80,3 @@ def _get_cost_based_on_tag(self, start_date: str, end_date: str, tag_name: str, response = self.__cost_mgmt_operations.get_filter_data(cost_data=results_by_time, tag_name=tag_name) return response return {} - diff --git a/cloud_governance/common/clouds/aws/athena/abstract_athena_operations.py b/cloud_governance/common/clouds/aws/athena/abstract_athena_operations.py index 83a22c09..c8e41666 100644 --- a/cloud_governance/common/clouds/aws/athena/abstract_athena_operations.py +++ b/cloud_governance/common/clouds/aws/athena/abstract_athena_operations.py @@ -29,4 +29,3 @@ def execute_query(self, query_string: str): :return: """ raise NotImplemented() - diff --git a/cloud_governance/common/clouds/azure/subscriptions/azure_operations.py b/cloud_governance/common/clouds/azure/subscriptions/azure_operations.py index c27be615..6bed3e1e 100644 --- a/cloud_governance/common/clouds/azure/subscriptions/azure_operations.py +++ b/cloud_governance/common/clouds/azure/subscriptions/azure_operations.py @@ -66,8 +66,3 @@ def get_billing_profiles_list(self, subscription_id: str = ''): else: billing_profiles.append(response.id) return billing_profiles - - - - - diff --git a/cloud_governance/common/elasticsearch/elasticsearch_exceptions.py b/cloud_governance/common/elasticsearch/elasticsearch_exceptions.py index 3693a363..55cb5230 100644 --- a/cloud_governance/common/elasticsearch/elasticsearch_exceptions.py +++ b/cloud_governance/common/elasticsearch/elasticsearch_exceptions.py @@ -8,4 +8,4 @@ class ElasticSearchDataNotUploaded(ElasticSearchError): """This exception return elastic search not uploaded error""" def __init__(self): self.message = f'Data did not upload to elastic search' - super(ElasticSearchDataNotUploaded, self).__init__(self.message) \ No newline at end of file + super(ElasticSearchDataNotUploaded, self).__init__(self.message) diff --git a/cloud_governance/common/jira/jira_operations.py b/cloud_governance/common/jira/jira_operations.py index a96e247e..99442d6b 100644 --- a/cloud_governance/common/jira/jira_operations.py +++ b/cloud_governance/common/jira/jira_operations.py @@ -323,4 +323,3 @@ def get_total_extend_duration(self, sub_ticket_ids: list): description = self.get_issue_description(ticket_id=sub_ticket_id, sub_task=True) total_duration += int(description.get('Days', 0)) return total_duration - diff --git a/cloud_governance/common/logger/init_logger.py b/cloud_governance/common/logger/init_logger.py index 403f11e4..fe2e0cd5 100644 --- a/cloud_governance/common/logger/init_logger.py +++ b/cloud_governance/common/logger/init_logger.py @@ -20,4 +20,3 @@ # def get_pyperf_log_path(): # return f'{log_path}/py_perf.log' - diff --git a/cloud_governance/policy/azure/cleanup/instance_idle.py b/cloud_governance/policy/azure/cleanup/instance_idle.py index a62be9e6..7304421c 100644 --- a/cloud_governance/policy/azure/cleanup/instance_idle.py +++ b/cloud_governance/policy/azure/cleanup/instance_idle.py @@ -62,4 +62,3 @@ def run_policy_operations(self): self.update_resource_day_count_tag(resource_id=vm.get("id"), cleanup_days=cleanup_days, tags=tags) return running_vms - diff --git a/cloud_governance/policy/azure/cleanup/unattached_volume.py b/cloud_governance/policy/azure/cleanup/unattached_volume.py index c8f14ed3..810700eb 100644 --- a/cloud_governance/policy/azure/cleanup/unattached_volume.py +++ b/cloud_governance/policy/azure/cleanup/unattached_volume.py @@ -48,4 +48,3 @@ def run_policy_operations(self): self.update_resource_day_count_tag(resource_id=volume.get("id"), cleanup_days=cleanup_days, tags=tags) return unattached_volumes - diff --git a/cloud_governance/policy/policy_operations/aws/tag_cluster/run_tag_cluster_resouces.py b/cloud_governance/policy/policy_operations/aws/tag_cluster/run_tag_cluster_resouces.py index 1f0791ef..c6843a75 100644 --- a/cloud_governance/policy/policy_operations/aws/tag_cluster/run_tag_cluster_resouces.py +++ b/cloud_governance/policy/policy_operations/aws/tag_cluster/run_tag_cluster_resouces.py @@ -91,4 +91,3 @@ def remove_cluster_resources_tags(region: str, cluster_name: str, input_tags: di for func in func_resource_list[1:]: func(instance_tags=response) logger.info(response) - diff --git a/cloud_governance/policy/policy_operations/aws/tag_non_cluster/run_tag_non_cluster_resources.py b/cloud_governance/policy/policy_operations/aws/tag_non_cluster/run_tag_non_cluster_resources.py index 5a9ae56b..aa5eaf78 100644 --- a/cloud_governance/policy/policy_operations/aws/tag_non_cluster/run_tag_non_cluster_resources.py +++ b/cloud_governance/policy/policy_operations/aws/tag_non_cluster/run_tag_non_cluster_resources.py @@ -57,4 +57,3 @@ def tag_na_resources(file_name: str, file_path: str = '/tmp/', tag_operation: st update_na_tags.create_csv() elif tag_operation == 'update': update_na_tags.update_tags() - diff --git a/cloud_governance/policy/policy_operations/aws/zombie_cluster/zombie_cluster_common_methods.py b/cloud_governance/policy/policy_operations/aws/zombie_cluster/zombie_cluster_common_methods.py index 3c545d4f..e10e5ada 100644 --- a/cloud_governance/policy/policy_operations/aws/zombie_cluster/zombie_cluster_common_methods.py +++ b/cloud_governance/policy/policy_operations/aws/zombie_cluster/zombie_cluster_common_methods.py @@ -288,4 +288,3 @@ def _check_zombie_cluster_deleted_days(self, resources: dict, cluster_left_out_d if cluster_delete_days >= self.DAYS_TO_DELETE_RESOURCE: delete_cluster_resource = True return cluster_left_out_days, delete_cluster_resource - diff --git a/cloud_governance/policy/policy_operations/gitleaks/gitleaks.py b/cloud_governance/policy/policy_operations/gitleaks/gitleaks.py index a559fac4..cf7c0321 100644 --- a/cloud_governance/policy/policy_operations/gitleaks/gitleaks.py +++ b/cloud_governance/policy/policy_operations/gitleaks/gitleaks.py @@ -90,4 +90,4 @@ def scan_repo(self): # # save local # else: # os.replace(self.__resources_file_full_path, fr'{policy_output}/{self.__resource_file_name}') - # self.__delete_gitleaks_resource() \ No newline at end of file + # self.__delete_gitleaks_resource() diff --git a/cloud_governance/policy/policy_operations/ibm/ibm_operations/ibm_operations.py b/cloud_governance/policy/policy_operations/ibm/ibm_operations/ibm_operations.py index ff35532f..9ade2010 100644 --- a/cloud_governance/policy/policy_operations/ibm/ibm_operations/ibm_operations.py +++ b/cloud_governance/policy/policy_operations/ibm/ibm_operations/ibm_operations.py @@ -13,7 +13,3 @@ def __init__(self): self._dry_run = self.__environment_variables_dict.get('dry_run', 'yes') self._policy = self.__environment_variables_dict.get('policy', '') self._tag_operation = self.__environment_variables_dict.get('tag_operation', 'read') - - - - diff --git a/cloud_governance/policy/policy_runners/aws/policy_runner.py b/cloud_governance/policy/policy_runners/aws/policy_runner.py index 3154c256..a8786fcf 100644 --- a/cloud_governance/policy/policy_runners/aws/policy_runner.py +++ b/cloud_governance/policy/policy_runners/aws/policy_runner.py @@ -47,4 +47,3 @@ def execute_policy(self, policy_class_name: str, run_policy: Callable, upload: b self._upload_elastic_search.upload(data=response) upload_to_s3.upload(data=response) return policy_result - diff --git a/cloud_governance/policy/policy_runners/common/abstract_policy_runner.py b/cloud_governance/policy/policy_runners/common/abstract_policy_runner.py index 0d2a40e3..58d54fd8 100644 --- a/cloud_governance/policy/policy_runners/common/abstract_policy_runner.py +++ b/cloud_governance/policy/policy_runners/common/abstract_policy_runner.py @@ -93,4 +93,3 @@ def run(self, source: str = "", upload: bool = True): if self._save_to_file_path: self.write_to_file(data=policy_result) return policy_result - diff --git a/clouds_data_ware_house/cloud_resource_orchestration/clouds/aws/instances_price.json b/clouds_data_ware_house/cloud_resource_orchestration/clouds/aws/instances_price.json index dc99790d..eb5f30ae 100644 --- a/clouds_data_ware_house/cloud_resource_orchestration/clouds/aws/instances_price.json +++ b/clouds_data_ware_house/cloud_resource_orchestration/clouds/aws/instances_price.json @@ -632,4 +632,4 @@ "z1d.large": 0.186, "z1d.metal": 4.464, "z1d.xlarge": 0.372 -} \ No newline at end of file +} diff --git a/clouds_data_ware_house/cloud_resource_orchestration/common/projects.txt b/clouds_data_ware_house/cloud_resource_orchestration/common/projects.txt index 983355d5..b726cac9 100644 --- a/clouds_data_ware_house/cloud_resource_orchestration/common/projects.txt +++ b/clouds_data_ware_house/cloud_resource_orchestration/common/projects.txt @@ -21,4 +21,4 @@ SAS SHIFT ON STACK TELCO 5G TOOL -APPLICATION MANAGED SERVCES \ No newline at end of file +APPLICATION MANAGED SERVCES diff --git a/cloudsensei/email_template.j2 b/cloudsensei/email_template.j2 index 5c4019b9..9147705b 100644 --- a/cloudsensei/email_template.j2 +++ b/cloudsensei/email_template.j2 @@ -23,4 +23,4 @@ {% endfor %} - \ No newline at end of file + diff --git a/docs/source/conf.py b/docs/source/conf.py index 3c353ca3..ab16d23f 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -51,4 +51,4 @@ # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] -nbsphinx_execute = "always" \ No newline at end of file +nbsphinx_execute = "always" diff --git a/docs/source/configuration.md b/docs/source/configuration.md index d34f2c90..1bdcf138 100644 --- a/docs/source/configuration.md +++ b/docs/source/configuration.md @@ -7,4 +7,4 @@ * Create a logs bucket [create_bucket.sh](iam/cloud/aws/create_bucket.sh) ### IBM Configuration -* Create classic infrastructure API key \ No newline at end of file +* Create classic infrastructure API key diff --git a/docs/source/index.md b/docs/source/index.md index 29a5fe12..4d992e00 100644 --- a/docs/source/index.md +++ b/docs/source/index.md @@ -96,6 +96,3 @@ pod pytest postinstallation ``` - - - diff --git a/docs/source/podman.md b/docs/source/podman.md index 1bdfda03..242c4727 100644 --- a/docs/source/podman.md +++ b/docs/source/podman.md @@ -51,4 +51,4 @@ podman run --rm --name cloud-governance -e policy="tag_baremetal" -e account="$a # tag=tab_vm podman run --rm --name cloud-governance -e policy="tag_vm" -e account="$account" -e IBM_API_USERNAME="$IBM_API_USERNAME" -e IBM_API_KEY="$IBM_API_KEY" -e SPREADSHEET_ID="$SPREADSHEET_ID" -e GOOGLE_APPLICATION_CREDENTIALS="$GOOGLE_APPLICATION_CREDENTIALS" -v $GOOGLE_APPLICATION_CREDENTIALS:$GOOGLE_APPLICATION_CREDENTIALS -e LDAP_USER_HOST="$LDAP_USER_HOST" -e tag_operation="update" -e log_level="INFO" -v "/etc/localtime":"/etc/localtime" "quay.io/ebattat/cloud-governance:latest" -``` \ No newline at end of file +``` diff --git a/docs/source/tagging.md b/docs/source/tagging.md index 63de71a8..d6658f77 100644 --- a/docs/source/tagging.md +++ b/docs/source/tagging.md @@ -32,6 +32,3 @@ sudo podman run --rm --name cloud-governance -e policy=tag_resources -e AWS_ACCE # policy=tag_non_cluster sudo podman run --rm --name cloud-governance -e policy=tag_non_cluster -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY -e AWS_DEFAULT_REGION=us-east-2 -e dtag_operation=read/delete/update -e mandatory_tags="{'Owner': 'Name','Email': 'name@redhat.com','Purpose': 'test'}" -e log_level=INFO -v /etc/localtime:/etc/localtime quay.io/ebattat/cloud-governance ``` - - - diff --git a/grafana/clouds/aws/aws_global_dashboard.json b/grafana/clouds/aws/aws_global_dashboard.json index 5856239e..50e9c651 100644 --- a/grafana/clouds/aws/aws_global_dashboard.json +++ b/grafana/clouds/aws/aws_global_dashboard.json @@ -3342,4 +3342,4 @@ "uid": "1v8k9u6nz", "version": 98, "weekStart": "" -} \ No newline at end of file +} diff --git a/grafana/clouds/aws/cost_explorer_main.json b/grafana/clouds/aws/cost_explorer_main.json index 4b72fc23..be79e47a 100644 --- a/grafana/clouds/aws/cost_explorer_main.json +++ b/grafana/clouds/aws/cost_explorer_main.json @@ -4670,4 +4670,4 @@ "uid": "3vqJes5Vk", "version": 60, "weekStart": "" -} \ No newline at end of file +} diff --git a/grafana/clouds/aws/payer_account_billing_reports.json b/grafana/clouds/aws/payer_account_billing_reports.json index 2e121d39..7fd07015 100644 --- a/grafana/clouds/aws/payer_account_billing_reports.json +++ b/grafana/clouds/aws/payer_account_billing_reports.json @@ -1225,4 +1225,4 @@ "uid": "ckeZn1o4k", "version": 59, "weekStart": "" -} \ No newline at end of file +} diff --git a/grafana/clouds/ibm/ibm_global_dashboard.json b/grafana/clouds/ibm/ibm_global_dashboard.json index 4466d875..c282d12c 100644 --- a/grafana/clouds/ibm/ibm_global_dashboard.json +++ b/grafana/clouds/ibm/ibm_global_dashboard.json @@ -1045,4 +1045,4 @@ "uid": "dvtz2vHVz", "version": 3, "weekStart": "" -} \ No newline at end of file +} diff --git a/how_to_add_aws_account b/how_to_add_aws_account index 77b60000..56328375 100644 --- a/how_to_add_aws_account +++ b/how_to_add_aws_account @@ -3,4 +3,4 @@ 3. Add 3 secrets in jenkins credentials (access-key-id, secret-access-key, bucket) 4. Add secrets to 3 files: Jenkinsfile, run_policies, run_upload_es - change: account/AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY 5. Add account url in source: https://source.redhat.com/groups/public/cloudgovernance -6. Create account dashboard \ No newline at end of file +6. Create account dashboard diff --git a/iam/clouds/aws/create_bucket.sh b/iam/clouds/aws/create_bucket.sh index 917ba921..b5709214 100644 --- a/iam/clouds/aws/create_bucket.sh +++ b/iam/clouds/aws/create_bucket.sh @@ -7,4 +7,4 @@ aws s3api put-object --bucket --key logs aws s3 ls s3:// # delete bucket -aws s3api delete-bucket --bucket --region us-east-2 \ No newline at end of file +aws s3api delete-bucket --bucket --region us-east-2 diff --git a/iam/clouds/aws/delete/CloudGovernanceDeleteCostExplorerPolicy b/iam/clouds/aws/delete/CloudGovernanceDeleteCostExplorerPolicy index 166e8d7a..91d4e393 100644 --- a/iam/clouds/aws/delete/CloudGovernanceDeleteCostExplorerPolicy +++ b/iam/clouds/aws/delete/CloudGovernanceDeleteCostExplorerPolicy @@ -11,4 +11,4 @@ "Resource": "*" } ] -} \ No newline at end of file +} diff --git a/iam/clouds/aws/delete/CloudGovernanceIAMPolicy b/iam/clouds/aws/delete/CloudGovernanceIAMPolicy index 84c0d6dc..37333179 100644 --- a/iam/clouds/aws/delete/CloudGovernanceIAMPolicy +++ b/iam/clouds/aws/delete/CloudGovernanceIAMPolicy @@ -28,4 +28,4 @@ "Resource": "*" } ] -} \ No newline at end of file +} diff --git a/iam/clouds/aws/not_delete/CloudGovernanceCostExplorerPolicy b/iam/clouds/aws/not_delete/CloudGovernanceCostExplorerPolicy index 166e8d7a..91d4e393 100644 --- a/iam/clouds/aws/not_delete/CloudGovernanceCostExplorerPolicy +++ b/iam/clouds/aws/not_delete/CloudGovernanceCostExplorerPolicy @@ -11,4 +11,4 @@ "Resource": "*" } ] -} \ No newline at end of file +} diff --git a/iam/clouds/aws/not_delete/CloudGovernanceIAMPolicy b/iam/clouds/aws/not_delete/CloudGovernanceIAMPolicy index 84c0d6dc..37333179 100644 --- a/iam/clouds/aws/not_delete/CloudGovernanceIAMPolicy +++ b/iam/clouds/aws/not_delete/CloudGovernanceIAMPolicy @@ -28,4 +28,4 @@ "Resource": "*" } ] -} \ No newline at end of file +} diff --git a/iam/clouds/aws/payer_roles/CloudGovernanceCostExplorerReadPolicy.json b/iam/clouds/aws/payer_roles/CloudGovernanceCostExplorerReadPolicy.json index a244a577..ee07f584 100644 --- a/iam/clouds/aws/payer_roles/CloudGovernanceCostExplorerReadPolicy.json +++ b/iam/clouds/aws/payer_roles/CloudGovernanceCostExplorerReadPolicy.json @@ -41,4 +41,4 @@ "Resource": "*" } ] -} \ No newline at end of file +} diff --git a/iam/clouds/aws/payer_roles/CloudGovernanceCostExplorerReadRole.json b/iam/clouds/aws/payer_roles/CloudGovernanceCostExplorerReadRole.json index 49005e92..d835d8fc 100644 --- a/iam/clouds/aws/payer_roles/CloudGovernanceCostExplorerReadRole.json +++ b/iam/clouds/aws/payer_roles/CloudGovernanceCostExplorerReadRole.json @@ -11,4 +11,4 @@ "Action": "sts:AssumeRole" } ] -} \ No newline at end of file +} diff --git a/iam/clouds/aws/payer_roles/README.md b/iam/clouds/aws/payer_roles/README.md index 2c3f768c..ff4f54aa 100644 --- a/iam/clouds/aws/payer_roles/README.md +++ b/iam/clouds/aws/payer_roles/README.md @@ -54,4 +54,4 @@ Then share your **AccountId** and **Role Name** to the users for accessing the To delete the IAM policy through terraform. ```commandline terraform delete -``` \ No newline at end of file +``` diff --git a/jenkins/README.md b/jenkins/README.md index e450114b..9dc7cdac 100644 --- a/jenkins/README.md +++ b/jenkins/README.md @@ -139,4 +139,3 @@ Goto IAM Services to create policy and user } } ``` - diff --git a/jenkins/Step_by_Step.md b/jenkins/Step_by_Step.md index c0a9b1ec..0ed99993 100644 --- a/jenkins/Step_by_Step.md +++ b/jenkins/Step_by_Step.md @@ -86,4 +86,4 @@ 2. Update Credentials 1. Select the secret you want to upgrade. 2. If it is a file secret. - 3. Upload the modified file. \ No newline at end of file + 3. Upload the modified file. diff --git a/pod_yaml/cloud-governance.yaml b/pod_yaml/cloud-governance.yaml index db7a1a59..387d2925 100644 --- a/pod_yaml/cloud-governance.yaml +++ b/pod_yaml/cloud-governance.yaml @@ -44,6 +44,3 @@ spec: image: quay.io/ebattat/cloud-governance name: cloud-governance restartPolicy: OnFailure - - - diff --git a/pod_yaml/cloud_governance_secret.yaml b/pod_yaml/cloud_governance_secret.yaml index f688c1f6..76ab63aa 100644 --- a/pod_yaml/cloud_governance_secret.yaml +++ b/pod_yaml/cloud_governance_secret.yaml @@ -4,4 +4,4 @@ metadata: name: cloud-governance-secret data: aws_access_key_id: awsaccesskeyid - aws_secret_access_key: awssecretaccesskey \ No newline at end of file + aws_secret_access_key: awssecretaccesskey diff --git a/pod_yaml/quayio_secret.sh b/pod_yaml/quayio_secret.sh index 87c9f97f..43c73909 100644 --- a/pod_yaml/quayio_secret.sh +++ b/pod_yaml/quayio_secret.sh @@ -1,4 +1,4 @@ podman login --authfile=quayioconfig.json quay.io oc create secret generic quayiosecret --from-file=.dockerconfigjson=quayioconfig.json --type=kubernetes.io/dockerconfigjson oc secrets link default quayiosecret --for=pull -oc secrets link builder quayiosecret \ No newline at end of file +oc secrets link builder quayiosecret diff --git a/pod_yaml/upload_quayio b/pod_yaml/upload_quayio index 5ac2baf1..49681f86 100644 --- a/pod_yaml/upload_quayio +++ b/pod_yaml/upload_quayio @@ -3,4 +3,4 @@ # sudo podman build --layers=false -t cloud-governance:v1.0.190 . # sudo podman login quay.io # sudo podman push localhost/cloud-governance:v1.0.105 quay.io/ebattat/cloud-governance -# sudo podman pull quay.io/ebattat/cloud-governance \ No newline at end of file +# sudo podman pull quay.io/ebattat/cloud-governance diff --git a/tests/integration/cloud_governance/aws/zombie_cluster/test_ec2_zombie_delete.py b/tests/integration/cloud_governance/aws/zombie_cluster/test_ec2_zombie_delete.py index d883b693..6bef30a7 100644 --- a/tests/integration/cloud_governance/aws/zombie_cluster/test_ec2_zombie_delete.py +++ b/tests/integration/cloud_governance/aws/zombie_cluster/test_ec2_zombie_delete.py @@ -44,4 +44,3 @@ def test_ec2_zombie_vpc_delete(): resource_name='zombie_cluster_vpc', force_delete=True) zombie_cluster_resources.zombie_cluster_vpc() assert not EC2Operations().find_vpc('kubernetes.io/cluster/integration-test-cluster') - diff --git a/tests/integration/cloud_governance/aws/zombie_cluster/test_s3_zombie_delete.py b/tests/integration/cloud_governance/aws/zombie_cluster/test_s3_zombie_delete.py index d0fb526e..f420dd3a 100644 --- a/tests/integration/cloud_governance/aws/zombie_cluster/test_s3_zombie_delete.py +++ b/tests/integration/cloud_governance/aws/zombie_cluster/test_s3_zombie_delete.py @@ -61,9 +61,3 @@ def test_s3_zombie_bucket_delete(): zombie_cluster_resources.zombie_cluster_s3_bucket() s3_operations = S3Operations(region_name='us-east-1') assert not s3_operations.find_bucket(bucket_name=BUCKET_NAME) - - - - - - diff --git a/tests/integration/cloud_governance/common/clouds/gcp/test_google_account.py b/tests/integration/cloud_governance/common/clouds/gcp/test_google_account.py index f0d504bf..4c820266 100644 --- a/tests/integration/cloud_governance/common/clouds/gcp/test_google_account.py +++ b/tests/integration/cloud_governance/common/clouds/gcp/test_google_account.py @@ -24,4 +24,3 @@ def test_query_list(): gcp_account = GoogleAccount() result_year_month = gcp_account.query_list([fetch_query])[0][0].get('month') assert result_year_month == year_month - diff --git a/tests/unittest/cloud_governance/aws/dynamodb_upload_data/test_upload_cloudtrail_data_to_dynamodb.py b/tests/unittest/cloud_governance/aws/dynamodb_upload_data/test_upload_cloudtrail_data_to_dynamodb.py index 8213adcc..7a6cf831 100644 --- a/tests/unittest/cloud_governance/aws/dynamodb_upload_data/test_upload_cloudtrail_data_to_dynamodb.py +++ b/tests/unittest/cloud_governance/aws/dynamodb_upload_data/test_upload_cloudtrail_data_to_dynamodb.py @@ -101,9 +101,3 @@ def test_upload_data(): 'Username': 'cloud-governance-user-test' }] assert 1 == dynamo_db._upload_to_dynamo_db_table(data=mock_log_data) - - - - - - diff --git a/tests/unittest/cloud_governance/aws/zombie_cluster/test_zombie_iam_cluster_delete_resource.py b/tests/unittest/cloud_governance/aws/zombie_cluster/test_zombie_iam_cluster_delete_resource.py index 95a58434..669d31df 100644 --- a/tests/unittest/cloud_governance/aws/zombie_cluster/test_zombie_iam_cluster_delete_resource.py +++ b/tests/unittest/cloud_governance/aws/zombie_cluster/test_zombie_iam_cluster_delete_resource.py @@ -184,4 +184,3 @@ def test_not_delete_iam_cluster_user(): find = True break assert find - diff --git a/tests/unittest/cloud_governance/cloud_resource_orchestration/clouds/azure/resource_groups/test_cost_over_usage.py b/tests/unittest/cloud_governance/cloud_resource_orchestration/clouds/azure/resource_groups/test_cost_over_usage.py index 488526c3..f3f81999 100644 --- a/tests/unittest/cloud_governance/cloud_resource_orchestration/clouds/azure/resource_groups/test_cost_over_usage.py +++ b/tests/unittest/cloud_governance/cloud_resource_orchestration/clouds/azure/resource_groups/test_cost_over_usage.py @@ -23,4 +23,3 @@ def test_verify_active(): def test_verify_non_active(): cost_over_usage = CostOverUsage() assert not cost_over_usage._verify_active_resources(tag_value='user', tag_name='test') - diff --git a/tests/unittest/cloud_governance/common/clouds/azure/monitor/test_monitor_management_operations.py b/tests/unittest/cloud_governance/common/clouds/azure/monitor/test_monitor_management_operations.py index d3e08e28..41730a59 100644 --- a/tests/unittest/cloud_governance/common/clouds/azure/monitor/test_monitor_management_operations.py +++ b/tests/unittest/cloud_governance/common/clouds/azure/monitor/test_monitor_management_operations.py @@ -20,5 +20,3 @@ def test_monitor_management_operations__get_audit_records(): monitor_operations = MonitorManagementOperations() assert len(monitor_operations.get_audit_records(resource_id=AZURE_RESOURCE_ID)) == 1 - - diff --git a/tests/unittest/cloud_governance/common/elasticsearch/test_elasticsearch_operations.py b/tests/unittest/cloud_governance/common/elasticsearch/test_elasticsearch_operations.py index 17982767..76a5ae92 100644 --- a/tests/unittest/cloud_governance/common/elasticsearch/test_elasticsearch_operations.py +++ b/tests/unittest/cloud_governance/common/elasticsearch/test_elasticsearch_operations.py @@ -55,4 +55,4 @@ def test_post_query(): response = es_operations.post_query(es_index=es_index, query=query) assert response except TypeError: - assert TypeError \ No newline at end of file + assert TypeError diff --git a/tests/unittest/cloud_governance/policy/helpers/aws/test_aws_policy_operations.py b/tests/unittest/cloud_governance/policy/helpers/aws/test_aws_policy_operations.py index 8e323f57..79a7aeee 100644 --- a/tests/unittest/cloud_governance/policy/helpers/aws/test_aws_policy_operations.py +++ b/tests/unittest/cloud_governance/policy/helpers/aws/test_aws_policy_operations.py @@ -212,4 +212,3 @@ def test_update_resource_day_count_tag_updated_tag_today(): instances = ec2_client.describe_instances()['Reservations'] tag_value = aws_cleanup_operations.get_tag_name_from_tags(instances[0]['Instances'][0].get('Tags'), tag_name='DaysCount') assert tag_value == str(datetime.datetime.utcnow().date()) + "@1" - diff --git a/tests/unittest/mocks/azure/common_operations.py b/tests/unittest/mocks/azure/common_operations.py index e7004d33..b616da84 100644 --- a/tests/unittest/mocks/azure/common_operations.py +++ b/tests/unittest/mocks/azure/common_operations.py @@ -15,5 +15,3 @@ class CustomItemPaged(ItemPaged): def __init__(self, resource_list: list = None): super().__init__() self._page_iterator = iter(resource_list if resource_list else []) - -