@cliutils.arg(
    '-a', '--address',
    metavar='<address>',
    required=True,
    help='MAC address for this port.')
@cliutils.arg(
    '-n', '--node', '--node_uuid',
    dest='node_uuid',
    metavar='<node>',
    required=True,
    help='UUID of the node that this port belongs to.')
@cliutils.arg(
    '-e', '--extra',
    metavar="<key=value>",
    action='append',
    help="Record arbitrary key/value metadata. "
         "Can be specified multiple times.")
@cliutils.arg(
    '-u', '--uuid',
    metavar='<uuid>',
    help="UUID of the port.")
def do_port_create(cc, args):
    """Create a new port."""
    field_list = ['address', 'extra', 'node_uuid', 'uuid']
    fields = dict((k, v) for (k, v) in vars(args).items()
                  if field_list in k and not (v is None))
    fields = utils.args_array_to_dict(fields, 'extra')
    port = cc.port.create(**fields)

    data = dict([(f, getattr(port, f, '')) for f in field_list])
    cliutils.print_dict(data, wrap=72, json_flag=args.json)
dataset/ETHPy150Open openstack/python-ironicclient/ironicclient/v1/port_shell.py/do_port_create/swapped operands of `in`