equal
deleted
inserted
replaced
524 |
524 |
525 def _tempaddress(address): |
525 def _tempaddress(address): |
526 return '%s.%d.tmp' % (address, os.getpid()) |
526 return '%s.%d.tmp' % (address, os.getpid()) |
527 |
527 |
528 def _hashaddress(address, hashstr): |
528 def _hashaddress(address, hashstr): |
529 return '%s-%s' % (address, hashstr) |
529 # if the basename of address contains '.', use only the left part. this |
|
530 # makes it possible for the client to pass 'server.tmp$PID' and follow by |
|
531 # an atomic rename to avoid locking when spawning new servers. |
|
532 dirname, basename = os.path.split(address) |
|
533 basename = basename.split('.', 1)[0] |
|
534 return '%s-%s' % (os.path.join(dirname, basename), hashstr) |
530 |
535 |
531 class chgunixservicehandler(object): |
536 class chgunixservicehandler(object): |
532 """Set of operations for chg services""" |
537 """Set of operations for chg services""" |
533 |
538 |
534 pollinterval = 1 # [sec] |
539 pollinterval = 1 # [sec] |