Skip to content
  • Iustin Pop's avatar
    Add a function for all fields of a given OP_ID · 3929e782
    Iustin Pop authored
    
    
    This patch changes THH to export a new function which defines all
    fields of a given OP_ID. Not very clean, since for an invalid OP_ID we
    return empty list, but since it will only be used in tests it should
    be good enough.
    
    The generated code looks as follows:
    
        allOpFields :: String -> [String]
        allOpFields "OP_TEST_DELAY"
                      = ["duration", "on_master", "on_nodes", "repeat"]
        allOpFields "OP_INSTANCE_REPLACE_DISKS"
                      = ["disks", "early_release", "iallocator", "ignore_ipolicy",
                         "instance_name", "mode", "remote_node"]
        …
        allOpFields _ = []
    
    Signed-off-by: default avatarIustin Pop <iustin@google.com>
    Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
    3929e782