Merge pull request #10 from latestrevision/ios-authentication-bugfix

Should an instance key not be returned, generate a UUID instead.  Fixes #9.
This commit is contained in:
Peter Evans 2013-10-12 13:47:00 -07:00
commit cdb72ec63b
2 changed files with 2 additions and 2 deletions

View file

@ -63,7 +63,7 @@ class PyiCloudService(object):
if 'dsInfo' in resp: if 'dsInfo' in resp:
dsid = resp['dsInfo']['dsid'] dsid = resp['dsInfo']['dsid']
self.params.update({'dsid': dsid}) self.params.update({'dsid': dsid})
instance = resp['instance'] instance = resp.get('instance', uuid.uuid4().hex)
sha = hashlib.sha1(self.user.get('apple_id') + instance) sha = hashlib.sha1(self.user.get('apple_id') + instance)
self.params.update({'id': sha.hexdigest().upper()}) self.params.update({'id': sha.hexdigest().upper()})

View file

@ -7,7 +7,7 @@ with open('requirements.txt') as f:
setup( setup(
name='pyicloud', name='pyicloud',
version='0.2', version='0.2.1',
url='https://github.com/picklepete/pyicloud', url='https://github.com/picklepete/pyicloud',
description=( description=(
'PyiCloud is a module which allows pythonistas to ' 'PyiCloud is a module which allows pythonistas to '