Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mrdata common public
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hpc-kyb
mrdata common public
Commits
f8b3dbf9
Commit
f8b3dbf9
authored
1 year ago
by
Blake Fitch
Browse files
Options
Downloads
Patches
Plain Diff
reduce log lines on object mismatch to one
parent
2768f7f8
No related branches found
Branches containing commit
Tags
STAG-2024-04-15-20-30-24
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pymods/irods_utils/irods_utils.py
+5
-3
5 additions, 3 deletions
pymods/irods_utils/irods_utils.py
with
5 additions
and
3 deletions
pymods/irods_utils/irods_utils.py
+
5
−
3
View file @
f8b3dbf9
...
@@ -445,18 +445,20 @@ def confirmed_put( irods_sesh, file_pathname, new_obj_ipath, metadata_dict=None,
...
@@ -445,18 +445,20 @@ def confirmed_put( irods_sesh, file_pathname, new_obj_ipath, metadata_dict=None,
if
existing_obj
.
checksum
!=
new_obj_hash_256
:
if
existing_obj
.
checksum
!=
new_obj_hash_256
:
mismatch
=
True
mismatch
=
True
logging
.
error
(
"
Object prexists but data mismatches.
"
mismatch_reason
=
"
data csm
"
logging
.
debug
(
"
Object prexists but data mismatches.
"
+
"
file_pathname
"
+
file_pathname
)
+
"
file_pathname
"
+
file_pathname
)
else
:
else
:
# Get the existing objects metadata as a python dict
# Get the existing objects metadata as a python dict
existing_obj_dict
=
irods_avus_to_pydict
(
existing_obj
)
existing_obj_dict
=
irods_avus_to_pydict
(
existing_obj
)
if
existing_obj_dict
!=
metadata_dict
:
if
existing_obj_dict
!=
metadata_dict
:
logging
.
error
(
"
Object matches on data but mismatches metadata.
"
logging
.
debug
(
"
Object matches on data but mismatches metadata.
"
+
"
new avu dict:
"
+
str
(
metadata_dict
)
+
"
new avu dict:
"
+
str
(
metadata_dict
)
+
"
existing dict:
"
+
str
(
existing_obj_dict
)
+
"
existing dict:
"
+
str
(
existing_obj_dict
)
+
"
file_pathname:
"
+
file_pathname
)
+
"
file_pathname:
"
+
file_pathname
)
mismatch
=
True
mismatch
=
True
mismatch_reason
=
"
metadata
"
if
mismatch
:
if
mismatch
:
# Mismatch existing object. Move the old object out of the way and date it.
# Mismatch existing object. Move the old object out of the way and date it.
...
@@ -468,7 +470,7 @@ def confirmed_put( irods_sesh, file_pathname, new_obj_ipath, metadata_dict=None,
...
@@ -468,7 +470,7 @@ def confirmed_put( irods_sesh, file_pathname, new_obj_ipath, metadata_dict=None,
+
"
path
"
+
existing_obj
.
path
+
"
path
"
+
existing_obj
.
path
+
"
ex:
"
+
str
(
ex
)
)
+
"
ex:
"
+
str
(
ex
)
)
return
None
return
None
logging
.
warn
(
"
Moved mismatching existing object to ipath:
"
+
dup_ipath
)
logging
.
warn
(
f
"
Moved mismatching existing object
(reason:
{
mismatch_reason
}
)
to ipath:
{
dup_ipath
}
"
)
# Fall through to move newly uploaded object into place.
# Fall through to move newly uploaded object into place.
else
:
else
:
# Matching existing object. Remove the tmp object we just uploaded and leave the old one.
# Matching existing object. Remove the tmp object we just uploaded and leave the old one.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment