durusmail: qp: QP 1.7 questions.
QP 1.7 questions.
2006-08-17
2006-08-17
2006-08-18
QP 1.7 questions.
Peter Wilkinson
2006-08-17
Hi,
I've noticed the new version of QP and QPY along with Durus, nice stuff.

One quick thing that I'm running into that might be an issue is the
new get_durus_address method.

     def get_durus_address(self):
         """() -> (host:str, port:int)|str
         The address at which the Durus StorageServer listens.
         """
         address = self.get('durus_address')
         if type(address) is tuple:
             return address
         if bool(address):
             return join(self.get_var_directory(),
                 address or '%s.durus_server' % self.get_name())
         else:
             return None

Given that, my reading is that durus_address=('localhost', 8002) will
do the usual socket thing, and to get a unix socket I need to set a
string value. Is the section that does "address or '%s.durus_server'
% self.get_name()" slightly wrong as I can't see a way to get it to
generate the name automatically? durus_address=True fails as True
will then get passed into join which tries to do a .startswith() on
it and durus_address=False stops Durus from starting at all.

The logic that makes sense to me would be:
durus_address=('localhost', 8002) -> usual
durus_address=False (or no setting) -> off
durus_address=True -> Unix socket, '%s.durus_server' % self.get_name()
durus_address="string" -> Unix socket, whatever that value is.

I hope I'm not missing something obvious here.

pw.




Peter Wilkinson
pw@thirdfloor.com.au

Thirdfloor Software Works Pty. Ltd.
ph: 02 9016 2884
fax: 02 9016 2885
65 Hume St, Crows Nest, NSW, 2065






reply