From b8c76301debe965924b57b7881fcb8f3046429e5 Mon Sep 17 00:00:00 2001 From: Richard Bywater Date: Wed, 17 Jan 2018 13:20:59 +1300 Subject: [PATCH] Add validation to ensure leading fullstop for suffix --- awx/plugins/inventory/cloudforms.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/awx/plugins/inventory/cloudforms.py b/awx/plugins/inventory/cloudforms.py index 25bc032efd..25b8d23159 100755 --- a/awx/plugins/inventory/cloudforms.py +++ b/awx/plugins/inventory/cloudforms.py @@ -29,6 +29,7 @@ from time import time import requests from requests.auth import HTTPBasicAuth import warnings +from ansible.errors import AnsibleError try: import json @@ -176,6 +177,8 @@ class CloudFormsInventory(object): if config.has_option('cloudforms', 'suffix'): self.cloudforms_suffix = config.get('cloudforms', 'suffix') + if self.cloudforms_suffix[0] != '.': + raise AnsibleError('Leading fullstop is required for Cloudforms suffix') else: self.cloudforms_suffix = None