Skip to content

[fix][issue #293] versions array has another level of nesting to be broken into #297

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sujalcodes3
Copy link

@sujalcodes3 sujalcodes3 commented Jul 31, 2025

fixes #293
@antifuchs @gustavosoares @aerickson @suhlig @danrue Can you verify?

Previously, without this fix, I tried printing versions using the following code piece:

def get_individual_versions(versions, folder_path, log_file, grafana_url, http_get_headers, verify_ssl, client_cert, debug, pretty_print):
    file_path = folder_path + '/' + log_file
    



    # I added this part
    #########################
    with open("versions.txt", "w") as f:


        f.write(f"{folder_path} -> {repr(versions)}\n")
    #############################
    
    if versions:
        with open(u"{0}".format(file_path), 'w') as f:
            for version in versions:
                print(f"{{  versions: {type(version)}: {version} }}")
                (status, content) = get_version(version['dashboardId'], version['version'], grafana_url, http_get_headers, verify_ssl, client_cert, debug)
                if status == 200:
                    save_version(str(version['version']), content, folder_path, pretty_print)
                    f.write('{0}\n'.format(version['version']))

and we needed access to versions['versions'].

@sujalcodes3
Copy link
Author

@ysde Can you take a look at this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeError: string indices must be integers, not 'str'
1 participant