Issue #20435 has been updated by Arnoud de Jonge.

Status changed from Unreviewed to Accepted
Assignee set to alice nodelman

Confirmed for 3.2.2. Takes 3 turns to clean up the directory as well:

root@ubuntu-server-12042-x64-vbox4210-nocm:~# mkdir -p /tmp/tidydir && touch 
/tmp/tidydir/tidyfile{1,2,3,4,5,6,7,8}
root@ubuntu-server-12042-x64-vbox4210-nocm:~# puppet resource tidy /tmp age="0" 
matches="tidy*" recurse=2 rmdirs=true
Notice: /Tidy[/tmp]: Tidying File[/tmp/tidydir/tidyfile7]
Notice: /Tidy[/tmp]: Tidying File[/tmp/tidydir/tidyfile6]
Notice: /Tidy[/tmp]: Tidying File[/tmp/tidydir/tidyfile1]
Notice: /Tidy[/tmp]: Tidying File[/tmp/tidydir/tidyfile4]
Notice: /Tidy[/tmp]: Tidying File[/tmp/tidydir/tidyfile3]
Notice: /Tidy[/tmp]: Tidying File[/tmp/tidydir/tidyfile5]
Notice: /Tidy[/tmp]: Tidying File[/tmp/tidydir/tidyfile8]
Notice: /Tidy[/tmp]: Tidying File[/tmp/tidydir/tidyfile2]
Notice: /File[/tmp/tidydir/tidyfile5]/ensure: removed
Notice: /File[/tmp/tidydir/tidyfile6]/ensure: removed
Notice: /File[/tmp/tidydir/tidyfile1]/ensure: removed
Notice: /File[/tmp/tidydir/tidyfile2]/ensure: removed
Notice: /File[/tmp/tidydir/tidyfile8]/ensure: removed
Notice: /File[/tmp/tidydir/tidyfile7]/ensure: removed
Notice: /File[/tmp/tidydir/tidyfile4]/ensure: removed
Notice: /File[/tmp/tidydir/tidyfile3]/ensure: removed
tidy { '/tmp':
}
root@ubuntu-server-12042-x64-vbox4210-nocm:~# ls /tmp
ssh-OQBQYPX992  tidydir
root@ubuntu-server-12042-x64-vbox4210-nocm:~# puppet resource tidy /tmp age="0" 
matches="tidy*" recurse=2 rmdirs=true
tidy { '/tmp':
}
root@ubuntu-server-12042-x64-vbox4210-nocm:~# puppet resource tidy /tmp age="0" 
matches="tidy*" recurse=2 rmdirs=true
Notice: /Tidy[/tmp]: Tidying File[/tmp/tidydir]
Notice: /File[/tmp/tidydir]/ensure: removed
tidy { '/tmp':
}


----------------------------------------
Bug #20435: resource tidy recurse does not behave correctly
https://projects.puppetlabs.com/issues/20435#change-94657

* Author: alice nodelman
* Status: Accepted
* Priority: Normal
* Assignee: alice nodelman
* Category: 
* Target version: 
* Affected Puppet version: 
* Keywords: 
* Branch: 
----------------------------------------
I created the following directory structure:
/tmp/tidydir
/tmp/tidydir/tidyfile1
/tmp/tidydir/tidyfile2
/tmp/tidydir/tidyfile3

Then ran:
>puppet resource tidy /tmp age="0" matches="tidy*" recurse=2 rmdirs=true

The expected behavior would be to have /tmp/tidydir removed along with all the 
tidyfiles.  The tidyfiles were removed but the tidydir was left alone.  Running 
the command again did not help (in case it does directory removal before file 
removal).  It looks like it is the recurse depth which is the problem, as it 
will remove the dir with recurse=1.  This is not the expected behavior for 
recurse.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to