# "Not going to happen" error

**URL:** <https://forum.ansible.com/t/not-going-to-happen-error/11965>\
**Category:** Ansible Project\
**Tags:** ansible-project\
**Created:** [October 10, 2012, 12:02pm UTC](https://forum.ansible.com/t/not-going-to-happen-error/11965 "2012-10-10T12:02:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [October 10, 2012, 12:02pm UTC](https://forum.ansible.com/t/not-going-to-happen-error/11965/1 "2012-10-10T12:02:38Z")

</div>

Hi Arun,

The "Not going to happen error" is a safeguard around some code that  
is designed to clean up temp dirs on remote systems. What is  
happening in 0.7 is that a unicode string was returned, and a check  
for the type of the return was not considering that possibility.

This is assuredly fixed in 0.8/devel, though we haven't backported the  
fix, which I'll be doing to the 0.7 branch very shortly as it needs to  
be done.

This was the 0.7 function:

&nbsp;&nbsp;&nbsp;&nbsp;def \_delete\_remote\_files(self, conn, files):  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;''' deletes one or more remote files '''

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if os.getenv("ANSIBLE\_KEEP\_REMOTE\_FILES","0") == "1":  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# ability to turn off temp file deletion for debug purposes  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if type(files) == str:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;files = [files]  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for filename in files:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if filename.find('/tmp/') == -1:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;raise Exception("not going to happen")  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.\_low\_level\_exec\_command(conn, "rm -rf %s" % filename, None)

and here it is in 0.8:

&nbsp;&nbsp;&nbsp;&nbsp;def \_delete\_remote\_files(self, conn, files):  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;''' deletes one or more remote files '''

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if os.getenv("ANSIBLE\_KEEP\_REMOTE\_FILES","0") == "1":  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# ability to turn off temp file deletion for debug purposes  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if type(files) in [str, unicode]:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;files = [files]  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for filename in files:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if filename.find('/tmp/') == -1:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;raise Exception("safeguard deletion, removal of %s is  
not going to happen" % filename)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.\_low\_level\_exec\_command(conn, "rm -rf %s" % filename, None)

I'll go ahead and apply this fix to the release branch.

--Michael

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [October 10, 2012, 12:15pm UTC](https://forum.ansible.com/t/not-going-to-happen-error/11965/2 "2012-10-10T12:15:26Z")

</div>

Ok, I've pushed a new tag for release-0.7.2 which contains this fix on  
the release branch, which should be sufficient if installing from  
source (i.e. checkout git, make install).

I may not build an official tarball and since the 0.8 release is so  
close, I don't think we need to get the distributions to update.

My general feeling on this is that most people are already consuming  
0.8 from source, and there are numerous other bugfixes in 0.8 and it's  
pretty stable, so I would recommend running from 0.8 devel.

It's currently getting ready for release (in about a week and a half)  
and is in a pretty conservative state where we are just closing out  
tickets in the tracker and occasionally adding a new module here and  
there.

--Michael

---

<div class="post-metadata">

**Author:** ![Arun\_Thampi](https://avatars.discourse-cdn.com/v4/letter/a/90db22/32.png) [@Arun\_Thampi](https://forum.ansible.com/u/Arun_Thampi)\
**Post date:** [October 14, 2012, 12:06pm UTC](https://forum.ansible.com/t/not-going-to-happen-error/11965/3 "2012-10-14T12:06:13Z")

</div>

Hey Michael - Apologies for the delay in responding. I got this error even while testing it out with the “edge” version of ansible. FWIW, the problem completely goes away when I use paramiko instead of SSH - I haven’t gotten that error at all even with v0.7.1. Was on a deadline last week, will try and spend more time this week to see if I can find a pattern for the error.

Cheers  
Arun

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [October 14, 2012, 2:49pm UTC](https://forum.ansible.com/t/not-going-to-happen-error/11965/4 "2012-10-14T14:49:21Z")

</div>

If you are using 0.8 tip it will give you output when this happens — let me know what it says.
