Changeset 093448c for asadb/util
- Timestamp:
- Apr 29, 2015, 9:41:07 PM (10 years ago)
- Branches:
- master, stable
- Children:
- 798afa8
- Parents:
- 356174b
- git-author:
- Alex Dehnert <adehnert@…> (04/29/15 21:37:49)
- git-committer:
- ASA Group Database <asa-db@…> (04/29/15 21:41:07)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
asadb/util/mailinglist.py
rfbdde0b r093448c 28 28 29 29 def list_members(self, ): 30 raise NotImplementedError30 env = dict(KRB5CCNAME=self.ccache.name) 31 31 res = subprocess.Popen( 32 32 [BLANCHE_PATH, self.name, ], 33 33 stdout=subprocess.PIPE, 34 34 stderr=subprocess.PIPE, 35 env=env, 35 36 ) 36 37 stdout, stderr = res.communicate() 37 38 if res.returncode: 38 39 raise RuntimeError("Failed to list members: %s" % (stderr, )) 39 members = stdout.strip().split("\n")40 members = [self.convert_moira_to_email(m) for m in stdout.strip().split("\n")] 40 41 return members 42 43 def convert_moira_to_email(self, email): 44 typ, colon, val = email.partition(":") 45 if typ in ('STRING', 'USER', 'LIST'): 46 email = val + "@mit.edu" 47 # Leave untouched: KERBEROS (shouldn't exist), untagged strings 48 assert email.count('@') == 1, "%s has wrong number of @'s" % (email, ) 49 return email 41 50 42 51 def strip_mit(self, email):
Note: See TracChangeset
for help on using the changeset viewer.