From 602c5580d3243349e15a5eb3f06764eb4fe036f1 Mon Sep 17 00:00:00 2001 From: kevgliss Date: Mon, 6 Mar 2017 20:38:04 -0800 Subject: [PATCH] Only validates values if present in options. Fixing authority test to parse plugin information. (#713) --- lemur/schemas.py | 3 +++ lemur/tests/test_authorities.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lemur/schemas.py b/lemur/schemas.py index 7a5e62cc..bbc5fd0a 100644 --- a/lemur/schemas.py +++ b/lemur/schemas.py @@ -35,6 +35,9 @@ def validate_options(options): interval = get_plugin_option('interval', options) unit = get_plugin_option('unit', options) + if not interval and not unit: + return + if interval == 'month': unit *= 30 diff --git a/lemur/tests/test_authorities.py b/lemur/tests/test_authorities.py index 164f033b..6b2f86b2 100644 --- a/lemur/tests/test_authorities.py +++ b/lemur/tests/test_authorities.py @@ -13,7 +13,7 @@ def test_authority_input_schema(client, role): 'owner': 'jim@example.com', 'description': 'An example authority.', 'commonName': 'AnExampleAuthority', - 'pluginName': {'slug': 'verisign-issuer'}, + 'plugin': {'slug': 'verisign-issuer', 'plugin_options': [{'name': 'test', 'value': 'blah'}]}, 'type': 'root', 'signingAlgorithm': 'sha256WithRSA', 'keyType': 'RSA2048',