From 1ef6319decafc4194abd1571859e8bbc99550842 Mon Sep 17 00:00:00 2001 From: Trevor Bonas Date: Mon, 6 May 2024 17:16:51 -0700 Subject: [PATCH] Add debug logs to bucket_exists --- tools/python/influx-migration/influx_migration.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/python/influx-migration/influx_migration.py b/tools/python/influx-migration/influx_migration.py index c38d5353..fb3e93fd 100644 --- a/tools/python/influx-migration/influx_migration.py +++ b/tools/python/influx-migration/influx_migration.py @@ -256,17 +256,26 @@ def bucket_exists(host, token, bucket_name, skip_verify=False, org_name=None): logging.debug(f"{len(org_list)} orgs matched with name {org_name}") bucket = client.buckets_api().find_bucket_by_name(bucket_name) if bucket is None: + logging.debug(f"Bucket with name {bucket_name} could not be found " + f"in host {host}") return False if len(org_list) > 0: for org in org_list: if org.id == bucket.org_id: + logging.debug(f"Bucket with name {bucket_name} found in org " + f"{org_name} with org ID {org.id} in host {host}") return True # Bucket could not be found in any org with matching org_name + logging.debug(f"Bucket with name {bucket_name} could not be found " + f"in any org with name {org_name} in host {host}") return False # Org not specified and bucket has been found + logging.debug(f"Bucket with name {bucket_name} found in host {host}") return True except InfluxDBError as error: logging.error(str(error)) + logging.debug("An unexpected error occurred while checking the existence " + f"a bucket with name {bucket_name} in host {host}") return False def cleanup(mount_point=None, exec_s3_bucket_mount=None):