def get_options_from_json(conf_json, ack, csr, acmd, crtf, chnf, ca):
    """Parse key-value options from config json and return the values sequentially.
    It takes prioritised values as params. Among these values, non-None values are
    preserved and their values in config json are ignored."""
    opt = {'AccountKey':ack, 'CSR':csr, 'AcmeDir':acmd, 'CertFile':crtf, 'ChainFile':chnf, 'CA':ca}
    for key in opt:
        if not opt[key] and key in conf_json and conf_json[key]:
            opt[key] = conf_json[key]
            continue
        opt[key] = None if opt[key] == '' or opt[key] == '.' or opt[key] == '..' else opt[key]
    return opt['AccountKey'], opt['CSR'], opt['AcmeDir'], opt['CertFile'], opt['ChainFile'],\
           opt['CA']