Closed aaaaalbert closed 9 years ago
To clarify what the fix does, here is a seash
transcript showing detailed errors when trying to upload files with problematic names. Without the fix, the error message would be An error occurred: Node Manager error 'Internal Error'
only.
albert@%17 !> upload /tmp/abcDEF
An error occurred: Node Manager error 'Filename has disallowed character 'D''
Affected vessels: c7e5745b6780e9c130ed4d561a7e915cbf4ef3d4:1224:v1.
albert@%17 !> upload /tmp/private_file
An error occurred: Node Manager error 'User is not allowed to use file names starting with 'private_''
Affected vessels: c7e5745b6780e9c130ed4d561a7e915cbf4ef3d4:1224:v1.
albert@%17 !> upload /tmp/.hidden
An error occurred: Node Manager error 'Filename starts with a period, this is not allowed!'
Affected vessels: c7e5745b6780e9c130ed4d561a7e915cbf4ef3d4:1224:v1.
On testing it, I found that it can't upload a directory but it was able to upload individual files. Here is a traceback:
comp@%1 !> upload /Users/compDoc/Desktop/abcDEF/traverse.py
comp@%1 !> upload /Users/compDoc/Desktop/abcDEF/
Traceback (most recent call last):
File "seash.py", line 263, in command_loop
File "/Users/compDoc/Documents/seattle/seattle_repy/seash_dictionary.py", line 1837, in command_dispatch
File "/Users/compDoc/Documents/seattle/seattle_repy/command_callbacks.py", line 1808, in upload_filename
File "/Users/compDoc/Documents/seattle/seattle_repy/emulfile.py", line 149, in emulated_open
File "/Users/compDoc/Documents/seattle/seattle_repy/emulfile.py", line 333, in __init__
IOError: [Errno 21] Is a directory: '/Users/compDoc/Desktop/abcDEF/'
comp@%1 !>
You cannot upload a directory because the Repy sandbox does not allow directories to be created. Therefore, the local directory you are uploading files from can be named whatever; only the filename is checked for conformance.
So seash
's complaint is correct in this regard. Uploading directories is not supported. See also the RepyV2 API documentation, stating
Filenames may only be in the current directory (...)
and
There is no concept of a directory or a folder in repy.
Okay, that makes sense! I will merge this now as the issue is fixed by your modifications.
(Note: This is a re-commit of aaaaalbert@312af3fdb40f4e0fc22b9442059dcbd7acb9fc64, made to use the correct parent commit for easier merging with SeattleTestbed/nodemanager's master branch).
nmAPI
except
ed TypeError's before, and thus never caught anything, resulting in the RepyArgumentError reaching callers like thenmrequesthandler
(line 111) and missing clauses for the appropriate e errors. This would cause a nodemanager to report an "Internal Error" with no further details, as could be observed by uploading throughseash
a file conflicting withemulfile
's filename checks -- in the case of RepyV2, using disallowed characters, a name starting with "." or "private_", or a too long name.Thanks go to Rohan Dalvi for reporting the issue!