def _get_tag(config):
    """
    Fetch the current deploy file from the repo on the deployment server and
    return the current tag associated with it.

    :param config: Config hash as fetched from get_config.
    :type config: hash
    :rtype: str
    """
    # Fetch the .deploy file from the server and get the current tag
    deployfile = config['url'] + '/.git/deploy/deploy'
    try:
        f = urllib.urlopen(deployfile)
        deployinfo = f.read()
    except __HOLE__:
        return None
    try:
        deployinfo = json.loads(deployinfo)
        tag = deployinfo['tag']
    except (KeyError, ValueError):
        return None
    # tags are user-input and are used in shell commands, ensure they are
    # only passing alphanumeric, dashes, or /.
    if re.search(r'[^a-zA-Z0-9_\-/]', tag):
        return None
    return tag
dataset/ETHPy150Open trebuchet-deploy/trebuchet/modules/deploy.py/_get_tag