Merge pull request #246 from taers232c/branch-3.63

Pythonic way to initialize dictionary entry that may/may not already exist
This commit is contained in:
Jay Lee
2016-08-21 15:35:04 -04:00
committed by GitHub

View File

@@ -6558,13 +6558,11 @@ def getUserAttributes(i, updateCmd=False):
while i < len(sys.argv):
myarg = sys.argv[i].lower()
if myarg == u'firstname':
if u'name' not in body:
body[u'name'] = {}
body.setdefault(u'name', {})
body[u'name'][u'givenName'] = sys.argv[i+1]
i += 2
elif myarg == u'lastname':
if u'name' not in body:
body[u'name'] = {}
body.setdefault(u'name', {})
body[u'name'][u'familyName'] = sys.argv[i+1]
i += 2
elif myarg in [u'username', u'email', u'primaryemail'] and updateCmd: