@@ -65,7 +65,7 @@ def _start_background_thread(self):
6565 Creates and starts a daemon thread - that calls DynamoDBLockClient.run() method.
6666 """
6767 background_thread = threading .Thread (
68- name = 'DynamoDBLockClient-' + uuid ,
68+ name = 'DynamoDBLockClient-' + self . uuid ,
6969 target = self
7070 )
7171 background_thread .daemon = True
@@ -80,7 +80,7 @@ def run(self):
8080 if self .shutting_down : return None
8181
8282 start_time = datetime .datetime .utcnow ()
83- for lock in self .locks .itervalues ():
83+ for id , lock in self .locks .items ():
8484 self .send_heartbeat (lock )
8585 end_time = datetime .datetime .utcnow ()
8686
@@ -99,7 +99,7 @@ def send_heartbeat(self, lock):
9999 with lock .lock :
100100 try :
101101 # TODO actual impl
102- print
102+ print ()
103103 # update
104104 # table
105105 # keys
@@ -110,11 +110,11 @@ def send_heartbeat(self, lock):
110110 except ClientError as e :
111111 if e .response ['Error' ]['Code' ] == 'ConditionalCheckFailedException' :
112112 # TODO: need to handle the case where the lock was "stolen" by someone else...
113- print
113+ print ()
114114 else :
115- print
115+ print ()
116116 except :
117- print
117+ print ()
118118
119119
120120 def close (self ):
@@ -158,18 +158,18 @@ def release_lock(self,
158158 except ClientError as e :
159159 if e .response ['Error' ]['Code' ] == 'ConditionalCheckFailedException' :
160160 # TODO: need to handle the case where the lock was "stolen" by someone else...
161- print
161+ print ()
162162 else :
163163 # if not best_effort: raise error
164- print
164+ print ()
165165 except :
166- print
166+ print ()
167167
168168
169169 # TODO: make this private?
170170 def release_all_locks (self ):
171171 """"""
172- for lock in self .locks .itervalues ():
172+ for id , lock in self .locks .items ():
173173 self .release_lock (lock )
174174
175175 # get_lock
0 commit comments