- vim_item_create_parser = subparsers.add_parser(commnad_name + '-create', parents=[parent_parser], help="create a "+item+" at vim")
- vim_item_create_parser.add_argument("file", nargs='?', help="descriptor of the %s. Must be a file or yaml/json text" % item).completer = FilesCompleter
- vim_item_create_parser.add_argument("--name", action="store", help="name of the %s" % item )
- vim_item_create_parser.add_argument("--datacenter", action="store", help="specifies the datacenter")
- if item=="network":
- vim_item_create_parser.add_argument("--type", action="store", help="type of network, data, ptp, bridge")
- vim_item_create_parser.add_argument("--shared", action="store_true", help="Private or shared")
- vim_item_create_parser.add_argument("--bind-net", action="store", help="For openvim datacenter type, net to be bind to, for vlan type, use sufix ':<vlan_tag>'")
- else:
- vim_item_create_parser.add_argument("--description", action="store", help="description of the %s" % item)
- vim_item_create_parser.set_defaults(func=vim_action, item=item, action="create")
+ if item == "network" or item == "tenant":
+ vim_item_create_parser = subparsers.add_parser(commnad_name + '-create', parents=[parent_parser], help="create a "+item+" at vim")
+ vim_item_create_parser.add_argument("file", nargs='?', help="descriptor of the %s. Must be a file or yaml/json text" % item).completer = FilesCompleter
+ vim_item_create_parser.add_argument("--name", action="store", help="name of the %s" % item )
+ vim_item_create_parser.add_argument("--datacenter", action="store", help="specifies the datacenter")
+ if item=="network":
+ vim_item_create_parser.add_argument("--type", action="store", help="type of network, data, ptp, bridge")
+ vim_item_create_parser.add_argument("--shared", action="store_true", help="Private or shared")
+ vim_item_create_parser.add_argument("--bind-net", action="store", help="For openvim datacenter type, net to be bind to, for vlan type, use sufix ':<vlan_tag>'")
+ else:
+ vim_item_create_parser.add_argument("--description", action="store", help="description of the %s" % item)
+ vim_item_create_parser.set_defaults(func=vim_action, item=item, action="create")