Skip to content

python script issues #32

Description

@mick-lue

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions