Hah, I should learn to read before responding...   +1 your change.<br><br><div class="gmail_quote">On Tue, Feb 28, 2012 at 11:10 AM, Will <span dir="ltr">&lt;<a href="mailto:will.sterling@gmail.com">will.sterling@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I wrote the script and can make the change.  I just need to figure out how to tell if an account is inactive.<br><br><div class="gmail_quote">
<div><div class="h5">On Tue, Feb 28, 2012 at 10:51 AM, Kevin Fenzi <span dir="ltr">&lt;<a href="mailto:kevin@scrye.com" target="_blank">kevin@scrye.com</a>&gt;</span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div>On Tue, 28 Feb 2012 17:01:19 +0000 (UTC)<br>
Toshio Kuratomi &lt;<a href="mailto:toshio@tiki-lounge.com" target="_blank">toshio@tiki-lounge.com</a>&gt; wrote:<br>
<br>
</div><div><div>&gt; On bapp01 we have a script that checks whether the country code that<br>
&gt; people have in FAS is known to GeoIP.  This script runs once a week.<br>
&gt; The script sends out email if the country code is not known to GeoIP<br>
&gt; (this happens if we update GeoIP and a previous country code is<br>
&gt; removed).<br>
&gt;<br>
&gt; I&#39;d like to update this script in puppet so that it doesn&#39;t notify<br>
&gt; inactive accounts as we&#39;re currently sending out nagmail to accounts<br>
&gt; which are no longer used (but may point to valid email addresses):<br>
&gt;<br>
&gt; diff --git a/modules/fas/files/fas-invalid-cc.py<br>
&gt; b/modules/fas/files/fas-invalid-cc.py<br>
&gt; index 2e7d309..186049a 100755<br>
&gt; --- a/modules/fas/files/fas-invalid-cc.py<br>
&gt; +++ b/modules/fas/files/fas-invalid-cc.py<br>
&gt; @@ -86,14 +86,14 @@ def getusers():<br>
&gt;    country_codes = GeoIP.country_codes<br>
&gt;<br>
&gt;    data = []<br>
&gt; -  data = fas.people_by_key(key=&#39;id&#39;, fields=[&#39;human_name&#39;,<br>
&gt; &#39;username&#39;, &#39;country_code&#39;, &#39;email&#39;])<br>
&gt; +  data = fas.people_by_key(key=&#39;id&#39;, fields=[&#39;human_name&#39;,<br>
&gt; &#39;username&#39;, &#39;country_code&#39;, &#39;email&#39;, &#39;status&#39;])<br>
&gt;<br>
&gt;    if not email:<br>
&gt;<br>
&gt;      print &#39;\nSummary of accounts without valid Country Codes.&#39;<br>
&gt;      print &#39;\n------------------------------------------------&#39;<br>
&gt;<br>
&gt; -  for user_info in data.values():<br>
&gt; +  for user_info in [d for d in data.itervalues() if d[&#39;status&#39;] ==<br>
&gt; &#39;active&#39;]: if user_info[&#39;country_code&#39;] and user_info[&#39;country_code&#39;]<br>
&gt; not in country_codes:<br>
&gt;        if email:<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Could I get two +1s?<br>
<br>
</div></div>+1 here.<br>
<br></div></div><div class="im">_______________________________________________<br>
infrastructure mailing list<br>
<a href="mailto:infrastructure@lists.fedoraproject.org" target="_blank">infrastructure@lists.fedoraproject.org</a><br>
<a href="https://admin.fedoraproject.org/mailman/listinfo/infrastructure" target="_blank">https://admin.fedoraproject.org/mailman/listinfo/infrastructure</a><br></div></blockquote></div><br>
</blockquote></div><br>