Commit Graph

15 Commits

Author SHA1 Message Date
Marcus Schäfer
3669d8cad5
Fixed check for extended attributes
Only if libc reports errno 95 Operation not supported the method
should return that extended attributes are not supported. Also
add a debug information about the result of the call to get further
information in the log file
2023-07-25 17:24:36 +02:00
Marcus Schäfer
b7a64febea
Delete (py)xattr module requirement
The required functionality is provided by the core os library
2023-07-20 17:07:08 +02:00
Marcus Schäfer
f163081d5e
Fix use of xattrs for container sync
when syncing data for containers only a subset of xattr
attributes can be applied. This Fixes #2009
2022-01-29 14:23:20 +01:00
Marcus Schäfer
bbb7efdf2f
Added force_trailing_slash argument to sync_data
A speciality of the rsync tool is that it behaves differently
if the given source_dir ends with a '/' or not. If it ends
with a slash the data structure below will be synced to the
target_dir. If it does not end with a slash the source_dir
and its contents are synced to the target_dir. For example:

    source
      └── some_data

1. $ rsync -a source target

    target
      └── source
            └── some_data

2. $ rsync -a source/ target

    target
      └── some_data

The parameter force_trailing_slash in the DataSync::sync_data
method can be used to make sure rsync behaves like shown in
the second case. This Fixes #1786
2021-09-06 11:18:30 +02:00
Marcus Schäfer
7ffabbbc6e
Added type hints for DataSync class 2021-09-06 10:24:41 +02:00
Marcus Schäfer
bdb7123fa1
Refactor use of logging facility
Use getLogger method instead of a global log object
Also use caplog fixture to capture log messages in
unit tests. This Fixes #1244
2019-10-23 17:54:27 +02:00
Dan Čermák
b015b91679
Stop inheriting from object
This is no longer required in Python3
2019-08-22 15:43:27 +02:00
David Cassany
9eab3eebf9 Cleanup of the utils API docs 2018-04-17 18:05:09 +02:00
Marcus Schäfer
e91ace3f16
Apply target permissions only if target dir exists 2017-12-06 16:25:12 +01:00
Marcus Schäfer
d1fb751b60
Fixed use of stat result in os.chmod
oct method returns a string representation which was mistakenly
used in a subsequent os.chmod call. This Fixes #564
2017-12-06 15:59:14 +01:00
Marcus Schäfer
f17b6e41f0
Make sure toplevel target dir keeps permissions
When syncing data via rsync we make sure the toplevel target
directory the data gets synced to does not change it's origin
permissions. This Fixes #557
2017-12-04 17:17:35 +01:00
Marcus Schäfer
1a5257a0e8 Prevent use of project relative import statements
For details on the motivation of this change please visit:
https://wiki.python.org/moin/FutureProofPython
2017-03-07 11:23:37 +01:00
Marcus Schäfer
c429c18289
Added xattr checker for DataSync class
The method target_supports_extended_attributes() checks if the
sync target directory supports extended filesystem attributes.
The method is called on sync_data() and will remove the -X / -A
options if provided. A warning message is issued to the caller
if the rsync option list has changed because of the underlaying
filesystem limitations
2016-05-02 11:16:10 +02:00
Marcus Schäfer
b7cf1aa302
Update utils inline API documentation
References #49
2016-04-15 11:58:44 +02:00
Marcus Schäfer
e246e72a52
Refactor data subpackage
Move from data to utils, data is generally considered
as text data and not code
2016-03-17 10:42:08 +01:00