> Even if hostnames longer than 255 characters are sometimes spotted in the wild, this is technically a broken configuration. I don't know if it's sensible to support that.

Fair point and I was only aware of the total length instead of the length between the delimiters.  We'll leave the proposed regex as is.  Right now the hostname length is [limited to 255](https://github.com/pyfarm/pyfarm-models/blob/master/pyfarm/models/core/cfg.py#L110) characters anyway because hostnames, at least on PyFarm, serve more as a human readable name.  Communication is generally done via the ip address because it's faster and less error prone.  The use_address column dictates how the master should talk to the host though the default right now is incorrect (I'll fix this after your merge).

> As a possible way to sidestep this whole issue, instead of validating the hostname with a regex, we might just try to resolve it once to see if that works. The downside to this would be, of course, that agents' hostnames will have to actually be resolvable, which might make deployment more complex for home users.
Yet another way would be to not have the agent submit a hostname in the first place and just do a reverse lookup on its IP address.

This is pretty close to what the agent does to resolve its own hostname to weed out any os dependent issues with the dns mapping before telling the master about itself.  I want to avoid adding much additional complexity here though because agents will typically add themselves at startup which means the regex just needs to validate the hostname looks real.  Later on we should consider adding some check to validate the combination of ip, hostname, and subnet but for now I think this will be fine.

> However, if you prefer the comma-on-previous-line style, that's fine, too.

I do for a couple of reasons, [PEP8](http://www.python.org/dev/peps/pep-0008/#indentation) (see a little below the start of the section) and because it keeps the style consistent with the rest of the project.  It will eval the same either way so I don't have a problem with it personally but I want to keep it consistent for anyone else who might have to read the code later.