def _check_neutron_floating_ip():
    parser = argparse.ArgumentParser(
        description='Check an Floating ip creation. Note that it is able '
                    + 'to delete *all* floating ips from a account, so '
                    + 'ensure that nothing important is running on the '
                    + 'specified account.')
    parser.add_argument('--auth_url', metavar='URL', type=str,
                        default=os.getenv('OS_AUTH_URL'),
                        help='Keystone URL')

    parser.add_argument('--username', metavar='username', type=str,
                        default=os.getenv('OS_USERNAME'),
                        help='username to use for authentication')

    parser.add_argument('--password', metavar='password', type=str,
                        default=os.getenv('OS_PASSWORD'),
                        help='password to use for authentication')

    parser.add_argument('--tenant', metavar='tenant', type=str,
                        default=os.getenv('OS_TENANT_NAME'),
                        help='tenant name to use for authentication')

    parser.add_argument('--endpoint_url', metavar='endpoint_url', type=str,
                        help='Override the catalog endpoint.')

    parser.add_argument('--endpoint_type', metavar='endpoint_type', type=str,
                        default="publicURL",
                        help='Endpoint type in the catalog request. '
                        + 'Public by default.')

    parser.add_argument('--force_delete', action='store_true',
                        help='If matching floating ip are found, delete them '
                        + 'and add a notification in the message instead of '
                        + 'getting out in critical state.')

    parser.add_argument('--timeout', metavar='timeout', type=int,
                        default=120,
                        help='Max number of second to create/delete a '
                        + 'floating ip (120 by default).')

    parser.add_argument('--floating_ip', metavar='floating_ip', type=fip_type,
                        default=None,
                        help='Regex of IP(s) to check for existance. '
                        + 'This value can be "all" for conveniance (match '
                        + 'all ip). This permit to avoid certain floating '
                        + 'ip to be kept. Its default value prevents the '
                        + 'removal of any existing floating ip')

    parser.add_argument('--ext_router_name', metavar='ext_router_name',
                        type=str, default='public',
                        help='Name of the "public" router (public by default)')

    parser.add_argument('--verbose', action='count',
                        help='Print requests on stderr.')

    args = parser.parse_args()

    # this shouldn't raise any exception as no connection is done when
    # creating the object.  But It may change, so I catch everything.
    try:
        nova_client = client.Client(
            username=args.username,
            tenant_name=args.tenant,
            password=args.password,
            auth_url=args.auth_url,
        )
        nova_client.authenticate()
    except Exception as e:
        utils.critical("Authentication error: %s\n" % e)

    try:
        endpoint = nova_client.service_catalog.get_endpoints(
            'network')['network'][0][args.endpoint_type]
        if args.endpoint_url:
            endpoint = mangle_url(endpoint, args.endpoint_url)

        token = nova_client.service_catalog.get_token()['id']
        if args.verbose:
            logging.basicConfig(level=logging.DEBUG)
        neutron_client = neutron.Client('2.0', endpoint_url=endpoint,
                                        token=token)

    except Exception as e:
        utils.critical(e % "Error creating neutron object: %s\n")
    util = Novautils(neutron_client, nova_client.tenant_id)

    # Initiate the first connection and catch error.
    util.check_connection()

    if args.floating_ip:
        util.check_existing_floatingip(args.floating_ip, args.force_delete)
    util.get_network_id(args.ext_router_name)
    util.create_floating_ip()
    util.delete_floating_ip()

    if util.msgs:
        utils.critical(", ".join(util.msgs))

    duration = util.get_duration()
    notification = ""

    if util.notifications:
        notification = "(" + ", ".join(util.notifications) + ")"

    utils.ok("Floating ip created and deleted %s| time=%d"
             % (notification, duration))
dataset/ETHPy150Open openstack/monitoring-for-openstack/oschecks/neutron.py/_check_neutron_floating_ip/swapped operands of `%`