Hostname template format + PEP8 fixes

Change-Id: I5ebbd2622440b006ee073b7eb29e80db6d968f0e