Skip to content
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

python script issues #32

Open
mick-lue opened this issue Jan 19, 2024 · 0 comments
Open

python script issues #32

mick-lue opened this issue Jan 19, 2024 · 0 comments

Comments

@mick-lue
Copy link

While troubleshooting, I found two bugs in the python script:

if pipeline_type == 'i':
create_es_connection = True

If you input 'ingest', then this variable will not be set to True here, although 'ingest' and 'i' are supposed to be the same. This might not be much of a problem, as the script seems to be working, but might be unexpected behaviour.


with zipfile.ZipFile( filename, 'r' ) as zip_ref:
unzip_name = zip_ref.namelist()[ 0 ]
zip_ref.extractall( Temp_Output_Dir )
shutil.move( os.path.join( Temp_Output_Dir, unzip_name ), os.path.join( git_unzip_dir_name ) )
os.remove( filename )
logger.debug(f"Successfully unzipped and removed Git file {fname} to: {git_unzip_dir_name}")
return git_unzip_dir_name

The last three lines should not be indented below the with statement. This breaks the os.remove( filename ) line on Windows. The indentation for all three lines should be reduced by 1 like so:

        with zipfile.ZipFile( filename, 'r' ) as zip_ref:
            unzip_name = zip_ref.namelist()[ 0 ]
            zip_ref.extractall( Temp_Output_Dir )
            shutil.move( os.path.join( Temp_Output_Dir, unzip_name ), os.path.join( git_unzip_dir_name ) )
        os.remove( filename )
        logger.debug(f"Successfully unzipped and removed Git file {fname} to: {git_unzip_dir_name}")
        return git_unzip_dir_name
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

No branches or pull requests

1 participant