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

Use TMPDIR environment variable for temporary file path in createAndRunScript #1882

Merged
merged 12 commits into from
Jan 24, 2024

Conversation

camlyall
Copy link
Contributor

Fixes use of hardcoded temp directory.
This fixes issue archivematica/Issues#1425

Reviewed in AM1.14

  • Transfer with compression
  • Reingest
  • Fixity run

Users facing the issue 7z when mounting /tmp directory with noexec can set the environment variable TMPDIR=/path/to/dir in /etc/default/archivematica-mcp-client

Copy link
Member

@replaceafill replaceafill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @camlyall, this looks good. I wonder if we could improve that function a bit and since it lacks test coverage at the moment add a test for it. Maybe we could use pytest monkeypatch.setenv and tmp_path to test the TMPDIR case.

src/archivematicaCommon/lib/executeOrRunSubProcess.py Outdated Show resolved Hide resolved
@replaceafill
Copy link
Member

@camlyall Out of curiosity, are you planning to address this in the Storage Service which I think has a similar problem when compressing packages?

@replaceafill replaceafill added AMAUAT Issues relating to the improvement of the AM Automated Acceptance tests and removed AMAUAT Issues relating to the improvement of the AM Automated Acceptance tests labels Jan 23, 2024
Copy link
Member

@replaceafill replaceafill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @camlyall! Great work.

src/archivematicaCommon/lib/executeOrRunSubProcess.py Outdated Show resolved Hide resolved
@replaceafill replaceafill merged commit 5c64ba1 into artefactual:qa/1.x Jan 24, 2024
20 checks passed
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.

2 participants