cpobj fails to download (and rename) single file
When trying to copy a single file out of the object store to a different name we currently fail with something like this:
vpn-082:Desktop rleimens$ cpobj rleimens:tcors-header.png tcors-header-1.png
Traceback (most recent call last):
File "/usr/local/bin/cpobj", line 5, in <module>
pkg_resources.run_script('umobj==1.4.1', 'cpobj')
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 742, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 1674, in run_script
exec(script_code, namespace, namespace)
File "/Library/Python/2.7/site-packages/umobj-1.4.1-py2.7.egg/EGG-INFO/scripts/cpobj", line 99, in <module>
File "build/bdist.macosx-10.11-intel/egg/umobj/transfer.py", line 169, in obj_download
File "build/bdist.macosx-10.11-intel/egg/umobj/transfer.py", line 100, in download_file
File "build/bdist.macosx-10.11-intel/egg/umobj/transfer.py", line 70, in _create_needed_parent_directories
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
<type 'type'>: [Errno 2] No such file or directory: ''
I think the answer here is that if there is no prefixing path component in the dest filename, _create_needed_parent_directories
should do nothing. Ie, in the above case, since there is no directory structure (its a filename), we should not try to create any directories.