Commit 991152cc authored by Rob Carleski's avatar Rob Carleski 🇮🇸
Browse files

More enhancements

* Make alias application more forgiving (in case of collision)

* Spew generic for collaboration failure, since GAM doesn't give us
* anything.

* Strip unacceptable special characters from shared account full_name
parent 4dd7a1fc
......@@ -272,6 +272,10 @@ https://documentation.its.umich.edu/node/339/
extra={'entity': self.account}
)
client.update_group_aliases(self.full_name)
except Exception as e:
self.logger.warning(e, extra={'entity': self.account})
try:
self.logger.info(
'Updating Mcommunity group membership',
extra={'entity': self.account}
......@@ -371,8 +375,11 @@ The password for your requested shared account is:
'role',
'reader'
])
except CalledProcessError as e:
self.logger.warning(e.output, extra={'entity': self.account})
except CalledProcessError:
self.logger.warning(
'Error sharing password file with {}'.format(owner),
extra={'entity': self.account}
)
continue
os.remove(passFilePath)
......@@ -394,7 +401,7 @@ The password for your requested shared account is:
)
self.account = re.sub(r'[^\w_-]', '.', self.account).lower().strip()
self.full_name = re.sub(r'[^\w_-]', '.', self.account).strip()
self.email = '{}@{}'.format(
self.account,
self.config['google']['domain']
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment