Should an instance key not be returned, generate a UUID instead. Fixes #9.

This commit is contained in:
Adam Coddington 2013-10-11 18:10:19 -07:00
parent 7ee870c329
commit 47f7c71b1b

View file

@ -63,7 +63,7 @@ class PyiCloudService(object):
if 'dsInfo' in resp:
dsid = resp['dsInfo']['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)
self.params.update({'id': sha.hexdigest().upper()})