Skip to content

util/managedfile: fix symlink creation for local case#1900

Open
saschahauer wants to merge 1 commit into
labgrid-project:masterfrom
saschahauer:managed-file-fix
Open

util/managedfile: fix symlink creation for local case#1900
saschahauer wants to merge 1 commit into
labgrid-project:masterfrom
saschahauer:managed-file-fix

Conversation

@saschahauer

Copy link
Copy Markdown
Contributor

When a HTTPProvider driver is used a second time the link to the file already exists, so instead of just creating it we must replace it as done with the ln -f flag in the remote case. In the local case we currently get a FileExistsError when creating the link over an already existing one. Fix this by removing the old link before re-creating it.

Fixes: 18646f7 ("util/managedfile: replace ssh usage for local case")

Description

Checklist

  • Documentation for the feature
  • Tests for the feature
  • The arguments and description in doc/configuration.rst have been updated
  • Add a section on how to use the feature to doc/usage.rst
  • Add a section on how to use the feature to doc/development.rst
  • PR has been tested
  • Man pages have been regenerated

When a HTTPProvider driver is used a second time the link to the file
already exists, so instead of just creating it we must replace it as
done with the ln -f flag in the remote case. In the local case we
currently get a FileExistsError when creating the link over an already
existing one. Fix this by removing the old link before re-creating it.

Fixes: 18646f7 ("util/managedfile: replace ssh usage for local case")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 45.9%. Comparing base (be8f3a2) to head (e057597).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
labgrid/util/managedfile.py 66.6% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##           master   #1900   +/-   ##
======================================
  Coverage    45.9%   45.9%           
======================================
  Files         180     180           
  Lines       14496   14498    +2     
======================================
+ Hits         6666    6667    +1     
- Misses       7830    7831    +1     
Flag Coverage Δ
3.10 45.9% <66.6%> (+<0.1%) ⬆️
3.11 45.9% <66.6%> (+<0.1%) ⬆️
3.12 45.9% <66.6%> (+<0.1%) ⬆️
3.13 45.9% <66.6%> (+<0.1%) ⬆️
3.14 45.9% <66.6%> (+<0.1%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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