[CHANGE REQUEST] Update country-code script on bapp01

Will will.sterling at gmail.com
Tue Feb 28 19:16:23 UTC 2012


Hah, I should learn to read before responding...   +1 your change.

On Tue, Feb 28, 2012 at 11:10 AM, Will <will.sterling at gmail.com> wrote:

> I wrote the script and can make the change.  I just need to figure out how
> to tell if an account is inactive.
>
> On Tue, Feb 28, 2012 at 10:51 AM, Kevin Fenzi <kevin at scrye.com> wrote:
>
>> On Tue, 28 Feb 2012 17:01:19 +0000 (UTC)
>> Toshio Kuratomi <toshio at tiki-lounge.com> wrote:
>>
>> > On bapp01 we have a script that checks whether the country code that
>> > people have in FAS is known to GeoIP.  This script runs once a week.
>> > The script sends out email if the country code is not known to GeoIP
>> > (this happens if we update GeoIP and a previous country code is
>> > removed).
>> >
>> > I'd like to update this script in puppet so that it doesn't notify
>> > inactive accounts as we're currently sending out nagmail to accounts
>> > which are no longer used (but may point to valid email addresses):
>> >
>> > diff --git a/modules/fas/files/fas-invalid-cc.py
>> > b/modules/fas/files/fas-invalid-cc.py
>> > index 2e7d309..186049a 100755
>> > --- a/modules/fas/files/fas-invalid-cc.py
>> > +++ b/modules/fas/files/fas-invalid-cc.py
>> > @@ -86,14 +86,14 @@ def getusers():
>> >    country_codes = GeoIP.country_codes
>> >
>> >    data = []
>> > -  data = fas.people_by_key(key='id', fields=['human_name',
>> > 'username', 'country_code', 'email'])
>> > +  data = fas.people_by_key(key='id', fields=['human_name',
>> > 'username', 'country_code', 'email', 'status'])
>> >
>> >    if not email:
>> >
>> >      print '\nSummary of accounts without valid Country Codes.'
>> >      print '\n------------------------------------------------'
>> >
>> > -  for user_info in data.values():
>> > +  for user_info in [d for d in data.itervalues() if d['status'] ==
>> > 'active']: if user_info['country_code'] and user_info['country_code']
>> > not in country_codes:
>> >        if email:
>> >
>> >
>> >
>> > Could I get two +1s?
>>
>> +1 here.
>>
>> _______________________________________________
>> infrastructure mailing list
>> infrastructure at lists.fedoraproject.org
>> https://admin.fedoraproject.org/mailman/listinfo/infrastructure
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.fedoraproject.org/pipermail/infrastructure/attachments/20120228/eb150b67/attachment.html>


More information about the infrastructure mailing list