From f8541cc532abc381d20b6e8679a8b45d7a3372e3 Mon Sep 17 00:00:00 2001 From: Michael Shimkus Date: Tue, 28 Feb 2023 10:54:41 -0800 Subject: [PATCH] fix python error in bigip modules --- examples/modules/bigip-autoscale/bigip_autoscale.py | 2 +- examples/modules/bigip-standalone/bigip_standalone.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/modules/bigip-autoscale/bigip_autoscale.py b/examples/modules/bigip-autoscale/bigip_autoscale.py index b0ff9bfb..3aaa9e04 100644 --- a/examples/modules/bigip-autoscale/bigip_autoscale.py +++ b/examples/modules/bigip-autoscale/bigip_autoscale.py @@ -68,7 +68,7 @@ def create_instance_template(context, instance_template): 'bigIqSecretId' in context.properties else '' secret_id = str(context.properties['secretId']) if \ 'secretId' in context.properties else '' - source_image = ''.join([COMPUTE_URL_BASE, 'projects/', context.properties['customImageId'],]) if context.properties['customImageId'] else \ + source_image = ''.join([COMPUTE_URL_BASE, 'projects/', context.properties['customImageId'],]) if 'customImageId' in context.properties and context.properties['customImageId'] else \ ''.join([COMPUTE_URL_BASE, 'projects/f5-7626-networks-public/global/images/', context.properties['imageName'],]) telemetry_flag = '' if context.properties['allowUsageAnalytics'] else '--skip-telemetry' properties = {} diff --git a/examples/modules/bigip-standalone/bigip_standalone.py b/examples/modules/bigip-standalone/bigip_standalone.py index 5e55dfcc..c7645e4d 100644 --- a/examples/modules/bigip-standalone/bigip_standalone.py +++ b/examples/modules/bigip-standalone/bigip_standalone.py @@ -101,7 +101,7 @@ def create_instance(context): name = context.properties.get('name') or \ context.env['name'] instance_name = generate_name(context.properties['uniqueString'], name) - source_image = ''.join([COMPUTE_URL_BASE, 'projects/', context.properties['customImageId'],]) if context.properties['customImageId'] else \ + source_image = ''.join([COMPUTE_URL_BASE, 'projects/', context.properties['customImageId'],]) if 'customImageId' in context.properties and context.properties['customImageId'] else \ ''.join([COMPUTE_URL_BASE, 'projects/f5-7626-networks-public/global/images/', context.properties['imageName'],]) properties = {} # Setup Defaults - property updated to given value when property exists in config