def update_leases(transform, persistence_service):
 config = persistence_service.get()
 new_leases = transform(config.leases)
 if (new_leases != config.leases):
  new_config = config.set('leases', new_leases)
  d = persistence_service.save(new_config)
  d.addCallback((lambda _: new_config.leases))
  return d
 return succeed(new_leases)

def update_leases ( transform , persistence_service ) : config = persistence_service . get ( ) new_leases = transform ( config . leases ) if ( new_leases != config . leases ) : new_config = config . set ( 'leases' , new_leases ) d = persistence_service . save ( new_config ) d . addCallback ( ( lambda _ : new_config . leases ) ) return d return succeed ( new_leases )
update the leases configuration in the persistence service .