-
Type:
Bug
-
Status: Open
-
Priority:
Low
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Promise type: files
-
Labels:None
When promising that a file in a sub directory that does not exist is a symlink to another file the agent emits an error indicating it was unable to change into the directory. However the agent does go ahead and create the subdirectory in order to satisfy the promise for the link.
I believe that the agent should not emit an error for an issue that it automatically resolves.
Steps to reprouce:
find /tmp | grep subdir rm -rf /tmp/subdir/
Policy:
bundle agent main { files: "/tmp/subdir/doesnt/exist" link_from => ln_s("/tmp"); }
The above policy produces this output:
error: Failed to chdir into '/tmp/subdir/doesnt'. (chdir: 'No such file or directory')
Review state after policy run:
find /tmp | grep subdir stat /tmp/subdir/doesnt/exist rm -rf /tmp/subdir/
Commands produce this output: Note that the promised file is indeed a symlink to /tmp as promised.
/tmp/subdir /tmp/subdir/doesnt /tmp/subdir/doesnt/exist File: /tmp/subdir/doesnt/exist -> /tmp Size: 4 Blocks: 0 IO Block: 4096 symbolic link Device: fd01h/64769d Inode: 13238454 Links: 1 Access: (0777/lrwxrwxrwx) Uid: ( 1000/nickanderson) Gid: ( 1000/nickanderson) Access: 2017-09-11 12:44:50.677903994 -0500 Modify: 2017-09-11 12:44:50.677903994 -0500 Change: 2017-09-11 12:44:50.677903994 -0500 Birth: -