From 9712dfbc3514ea952b9f98954ce0342b168229e6 Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: May 03 2018 02:17:59 +0000 Subject: Two more pylint fixes. One over-indentation. The other is about the "dangerous" use of `[]` as a default argument which can produce bizarro errors. --- diff --git a/greenwave/api_v1.py b/greenwave/api_v1.py index 7e45709..addbaf4 100644 --- a/greenwave/api_v1.py +++ b/greenwave/api_v1.py @@ -234,10 +234,10 @@ def make_decision(): if ('DIST_GIT_BASE_URL' not in current_app.config or 'DIST_GIT_URL_TEMPLATE' not in current_app.config or 'KOJI_BASE_URL' not in current_app.config): - raise InternalServerError("If you want to apply a RemoteOriginalSpecNvrRule" - " you need to configure 'DIST_GIT_BASE_URL'," - "'DIST_GIT_URL_TEMPLATE' and KOJI_BASE_URL in " - "your configuration.") + raise InternalServerError("If you want to apply a RemoteOriginalSpecNvrRule" + " you need to configure 'DIST_GIT_BASE_URL'," + "'DIST_GIT_URL_TEMPLATE' and KOJI_BASE_URL in " + "your configuration.") applicable_policies = [policy for policy in current_app.config['policies'] if policy.applies_to(decision_context, product_version)] diff --git a/greenwave/policies.py b/greenwave/policies.py index ec6827f..3d1e70b 100644 --- a/greenwave/policies.py +++ b/greenwave/policies.py @@ -6,7 +6,8 @@ from werkzeug.exceptions import InternalServerError import greenwave.resources -def validate_policies(policies, disallowed_rules=[]): +def validate_policies(policies, disallowed_rules=None): + disallowed_rules = disallowed_rules or [] for policy in policies: if not isinstance(policy, Policy): raise RuntimeError('Policies are not configured properly as policy %s '