Download signature from hostname

def download_sig(opts, sig, version=None):
    """Download signature from hostname"""
    code = None
    downloaded = False
    useagent = 'ClamAV/0.101.1 (OS: linux-gnu, ARCH: x86_64, CPU: x86_64)'
    manager = PoolManager(
        headers=make_headers(user_agent=useagent),
        cert_reqs='CERT_REQUIRED',
        ca_certs=certifi.where(),
        timeout=Timeout(connect=10.0, read=60.0)
    )
    if version:
        path = '/%s.cvd' % sig
        filename = os.path.join(opts.workdir, '%s.cvd' % sig)
    else:
        path = '/%s.cdiff' % sig
        filename = os.path.join(opts.workdir, '%s.cdiff' % sig)
    try:
        req = manager.request('GET', 'http://%s%s' % (opts.hostname, path))
    except BaseException as msg:
        error("Request error: %s" % msg)
    data = req.data
    code = req.status
    if req.status == 200:
        with open(filename, 'w') as handle:
            handle.write(data)
        downloaded = os.path.exists(filename)
    return downloaded, code