import yaml 

def get_data_from_yaml(filename):
    try:
        with open(filename, 'r') as f:
            data = yaml.safe_load(f)
    except IOError:
        raise IOError(f"Error opening file: {filename}")

    return data

def check_bucket(minio_client, bucket_names):
    # Check if bucket exists
    for bucket_name in bucket_names:
        found = minio_client.bucket_exists(bucket_name)
        if not found:
            # Create bucket
            minio_client.make_bucket(bucket_name)
            print(f"Bucket '{bucket_name}' created successfully.")
        else:
            print(f"Bucket '{bucket_name}' already exists.")