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"><<a href="mailto:will.sterling@gmail.com">will.sterling@gmail.com</a>></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"><<a href="mailto:kevin@scrye.com" target="_blank">kevin@scrye.com</a>></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 <<a href="mailto:toshio@tiki-lounge.com" target="_blank">toshio@tiki-lounge.com</a>> wrote:<br>
<br>
</div><div><div>> On bapp01 we have a script that checks whether the country code that<br>
> people have in FAS is known to GeoIP. This script runs once a week.<br>
> The script sends out email if the country code is not known to GeoIP<br>
> (this happens if we update GeoIP and a previous country code is<br>
> removed).<br>
><br>
> I'd like to update this script in puppet so that it doesn't notify<br>
> inactive accounts as we're currently sending out nagmail to accounts<br>
> which are no longer used (but may point to valid email addresses):<br>
><br>
> diff --git a/modules/fas/files/fas-invalid-cc.py<br>
> b/modules/fas/files/fas-invalid-cc.py<br>
> index 2e7d309..186049a 100755<br>
> --- a/modules/fas/files/fas-invalid-cc.py<br>
> +++ b/modules/fas/files/fas-invalid-cc.py<br>
> @@ -86,14 +86,14 @@ def getusers():<br>
> country_codes = GeoIP.country_codes<br>
><br>
> data = []<br>
> - data = fas.people_by_key(key='id', fields=['human_name',<br>
> 'username', 'country_code', 'email'])<br>
> + data = fas.people_by_key(key='id', fields=['human_name',<br>
> 'username', 'country_code', 'email', 'status'])<br>
><br>
> if not email:<br>
><br>
> print '\nSummary of accounts without valid Country Codes.'<br>
> print '\n------------------------------------------------'<br>
><br>
> - for user_info in data.values():<br>
> + for user_info in [d for d in data.itervalues() if d['status'] ==<br>
> 'active']: if user_info['country_code'] and user_info['country_code']<br>
> not in country_codes:<br>
> if email:<br>
><br>
><br>
><br>
> 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>