Static method for getting the state of a subdomain, given its fully-qualified name.
    Return the subdomain record on success.
    Return None if not found.

def get_subdomain_info(fqn, db_path=None, atlasdb_path=None, zonefiles_dir=None, check_pending=False, include_did=False):
    """
    Static method for getting the state of a subdomain, given its fully-qualified name.
    Return the subdomain record on success.
    Return None if not found.
    """
    opts = get_blockstack_opts()
    if not is_subdomains_enabled(opts):
        log.warn("Subdomain support is disabled")
        return None

    if db_path is None:
        db_path = opts['subdomaindb_path']

    if zonefiles_dir is None:
        zonefiles_dir = opts['zonefiles']

    if atlasdb_path is None:
        atlasdb_path = opts['atlasdb_path']

    db = SubdomainDB(db_path, zonefiles_dir)
    try:
        subrec = db.get_subdomain_entry(fqn)
    except SubdomainNotFound:
        log.warn("No such subdomain: {}".format(fqn))
        return None

    if check_pending:
        # make sure that all of the zone files between this subdomain's
        # domain's creation and this subdomain's zone file index are present,
        # minus the ones that are allowed to be missing.
        subrec.pending = db.subdomain_check_pending(subrec, atlasdb_path)

    if include_did:
        # include the DID 
        subrec.did_info = db.get_subdomain_DID_info(fqn)

    return subrec