jplana / python-etcd

A python client for etcd
Other
522 stars 210 forks source link

No way to get lock sequence number without exposing internals #249

Open garbled1 opened 7 years ago

garbled1 commented 7 years ago

Need a function or similar to get the lock sequence number when acquiring a lock. If you want to do something like a shell script that utilizes the lock, you can't:

!/bin/bash

SEQ=$(take_lock.py) do_something_that_needs_locking release_lock.py -s ${SEQ}

Currently I do this by printing lock._sequence, but that is obviously bad form. Would like lock.get_sequence() or similar please.