Skip to content

Commit

Permalink
LocalTransport: Fix typo for ignore_nonexisting in put (#6471)
Browse files Browse the repository at this point in the history
The `LocalTransport.put` method contained a typo and so would check for
the `ignore_noexisting` argument instead of `ignore_nonexisting`. The
typo is corrected but for backwards compatibility the method continues
to check for the misspelled version emitting a deprecation warning.
  • Loading branch information
MichaelGoulding authored Jul 17, 2024
1 parent a610460 commit de83e2c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/aiida/transports/plugins/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,18 @@ def put(self, localpath, remotepath, *args, **kwargs):
:raise OSError: if remotepath is not valid
:raise ValueError: if localpath is not valid
"""
from aiida.common.warnings import warn_deprecation

if 'ignore_noexisting' in kwargs:
# Backwards compatibility check for old keyword that was misspelled
warn_deprecation(
'Detected `ignore_noexisting` which is now deprecated. Use `ignore_nonexisting` instead.', version=3
)
ignore_nonexisting = kwargs.get('ignore_noexisting', args[2] if len(args) > 2 else False)

dereference = kwargs.get('dereference', args[0] if args else True)
overwrite = kwargs.get('overwrite', args[1] if len(args) > 1 else True)
ignore_nonexisting = kwargs.get('ignore_noexisting', args[2] if len(args) > 2 else False)
ignore_nonexisting = kwargs.get('ignore_nonexisting', args[2] if len(args) > 2 else False)
if not remotepath:
raise OSError('Input remotepath to put function must be a non empty string')
if not localpath:
Expand Down

0 comments on commit de83e2c

Please sign in to comment.