rose
rose copied to clipboard
File creation gives error when using checksum with mode=symlink
Trying to install a file with
mode=symlink
checksum=....
gives an error. Demonstrated by modifying a test in 04-stdin.t to add a symlink case https://github.com/MartinDix/rose/commit/4030fa5f0fae84fc69033caba2b214d2b331f708
not ok 13 - 04-stdin-md5-symlink
[FAIL] 'NoneType' object is not subscriptable
The problem is the same in 2019.01.5 (with python 2.7.17) and 2.0rc3.dev (python 3.7.4)
It seems that in fileinstall.py
copies go into a list of jobs whereas links are created immediately and that only the job processing sets target.paths
. With a symlink, target.paths
is None
at https://github.com/MartinDix/rose/blob/4030fa5f0fae84fc69033caba2b214d2b331f708/metomi/rose/config_processors/fileinstall.py#L386
Also repeatable as follows:
$ touch rose-app.conf
$ rose app-run -q --define="[command]default=true" --define="[file:installed]source=/etc/profile" --define="[file:installed]checksum=" --define="[file:installed]mode=symlink"
[FAIL] 'NoneType' object is not subscriptable
The documentation says checksum works "if TARGET is a regular file or a symbolic link to a regular file" so this is certainly meant to work.