From 622f084bd910a947078e84f312ef37f9ccbc3252 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Fri, 24 May 2024 14:57:12 +0200 Subject: [PATCH] Adding default values and error classes for lib/create_terraform/consul.py --- lib/create_terraform/__init__.py | 12 +++++++++++- lib/create_terraform/errors.py | 8 +++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/lib/create_terraform/__init__.py b/lib/create_terraform/__init__.py index f3a87f4..f5c7034 100644 --- a/lib/create_terraform/__init__.py +++ b/lib/create_terraform/__init__.py @@ -1,7 +1,7 @@ #!/bin/env python3 # -*- coding: utf-8 -*- -__version__ = '1.8.10' +__version__ = '1.9.0' MIN_VERSION_TERRAFORM = '1.6.5' MAX_VERSION_TERRAFORM = '1.9.0' @@ -10,4 +10,14 @@ MIN_VERSION_VSPHERE_PROVIDER = '2.5.1' CFGFILE_BASENAME = 'create-terraform.ini' +DEFAULT_CONSUL_API_KV_ROOTPATH = '/v1/kv/terraform' +DEFAULT_CONSUL_API_TIMEOUT = 20 +DEFAULT_CONSUL_PORT = 8500 +DEFAULT_CONSUL_SERVER = 'terraform.pixelpark.com' + +# This library name will be used as a part of the user agent in HTTP(S) requests +LIBRARY_NAME = 'create-terraform' + +MAX_PORT_NUMBER = (2 ** 16) - 1 + # vim: ts=4 et list diff --git a/lib/create_terraform/errors.py b/lib/create_terraform/errors.py index bd0034d..fd84da7 100644 --- a/lib/create_terraform/errors.py +++ b/lib/create_terraform/errors.py @@ -16,7 +16,7 @@ from fb_tools.config import ConfigError from .xlate import XLATOR -__version__ = '1.3.0' +__version__ = '1.4.0' _ = XLATOR.gettext ngettext = XLATOR.ngettext @@ -119,6 +119,12 @@ class AbortExecution(ExpectedHandlerError): return _("Aborting after {!r}.").format(self.step) +# ============================================================================= +class ConsulHandlerError(TerraformHandlerError): + """Indicating a general error in ConsulHandler object.""" + + pass + # ============================================================================= if __name__ == "__main__": -- 2.39.5