-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add support for archive folder being on SMB share #340
base: develop
Are you sure you want to change the base?
Conversation
…ed for ARCHIVE_PATH or not
…, isdir and create_archive_path_if_not_exists
…ones such as create_archive_path_if_not_exists
Codecov Report
@@ Coverage Diff @@
## develop #340 +/- ##
===========================================
- Coverage 96.38% 96.35% -0.04%
===========================================
Files 64 65 +1
Lines 5868 5918 +50
===========================================
+ Hits 5656 5702 +46
- Misses 212 216 +4
Continue to review full report at Codecov.
|
…called with the correct arguments
…sor and ExtractionHighlighter with it
This is now ready for review. The reason for the low coverage for the patch is that we're not testing against a live SMB server, so we can't test that we get particular exceptions raised under specific circumstances (eg. a |
…o archive-via-smb
Update before I leave: This is an extremely old PR that is basically working, but will probably need some changes to work with the latest version of Pepys. The users said at one point that they wanted all the data to be archived to a SMB (Samba - Windows File Sharing) share using a different username and password to the one the user is actually logged in to. This is so a secure archive of files could be created. The user's priorities changed, and we didn't have chance to properly test it on-site, so it got deprioritised. This was actually remarkably difficult to do, and required using a pure-Python SMB library rather than the in-built Windows methods. It's all been tested and benchmarks, and so with a few modifications for the latest Pepys it should 'just work'. |
Adds support for the archive folder being located on a Windows (SMB) share. See the updated
configuration.rst
file in the PR for details - but basically just set the archive path in the config file to something like\\SERVER\share\path\to\folder
, along with the right username and password, and it should all work.This is implemented by wrapper functions that are used whenever we write to the archive folder (principally in the
FileProcessor
, but also in theHighlightedFile
class) - and these dispatch to two different implementations, depending whether the archive is on a SMB share or not. All the SMB functions are wrapped intry...except
blocks to deal with authentication/network issues.Tests are written on the assumption that the
smbprotocol
library behaves as advertised - and thus the tests only check that the right SMB functions are called. This also means we don't need a SMB server available to run the tests, which makes life a lot easier.Fixes #189