Skip to content
  • Geoff Lawler's avatar
    First cut of xdctool utility. · 0a32ad27
    Geoff Lawler authored and Ryan Goodfellow's avatar Ryan Goodfellow committed
    Meant to run on XDCs, the xdctool does an ecileltic numver of things.
    Currently it:
    
    * attaches and detaches to and from a materalization
    * spits out an ansible ID file based on an attached mtz
    
    Once this is in the XDC, we can remove the confusing `mergetb attach`
    command as the `xdctool attach` will take its place.
    
    The ansible id created honors the `group` prop on a node.
    
    Ex:
    ```
    glawler@xdc:/tmp# mergetb pull hi 9db9a824-bf1a-464f-8e55-bea06b629c46
    PUSH DATE: Thu Apr 23 19:14:56 UTC 2020
    CREATOR: glawler
    MODEL SOURCE:
    import mergexp as mx
    
    net = mx.Topology('lan3')
    
    nodes = [net.device(name) for name in ['a', 'B', 'c']]
    lan = net.connect(nodes)
    
    for i,e in enumerate(lan.endpoints, 1):
        e.ip.addrs = ['10.0.0.%d/24'%i]
        e.ip.mtu = 9000
    
    nodes[0].props['group'] = "server"
    nodes[1].props['group'] = "client"
    nodes[2].props['group'] = "client"
    
    mx.experiment(net)
    
    glawler@xdc:/tmp# ./xdctool ansible identity glawler hi one
    [all]
    B
    a
    c
    
    [server]
    a
    
    [client]
    B
    c
    glawler@xdc:/tmp#
    ```
    0a32ad27