예제 #1
0
파일: vli.py 프로젝트: spandanb/orange_vino
                    help="provide info on the queryied server(s)")
parser.add_argument('-d', '--delete', nargs='?', const="ALL",
                    help="delete the server(s) with matching prefix")
parser.add_argument('-m', '--mesh', action='store_true',
                    help="create a mesh topology. Must be used with --create")

args = parser.parse_args()

if args.mesh and not args.create:
    parser.error( "--[m]esh must be used with --[c]reate")

orc = Orc(mesh=args.mesh)

if args.create:
    #Create topology
    orc.create_topology()
    #Print output
    map(ut.format_and_print, orc.get_topology())

if args.info:
    if args.info == "ALL":
       map(ut.format_and_print, orc.get_topology())
    else:
       orc.get_topology() #args.info

if args.delete:
    orc.delete_topology()

if not(args.create or args.info or args.delete):
    parser.print_help()