]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
common/ceph_argparse: make parse_ip_port_vec handle list of addrs or addrvecs
authorSage Weil <sage@redhat.com>
Thu, 10 Jan 2019 20:18:55 +0000 (14:18 -0600)
committerSage Weil <sage@redhat.com>
Wed, 16 Jan 2019 14:33:03 +0000 (08:33 -0600)
commitce7670938a6072d62e7a9ea779f8b1526bfa526d
tree59bd8c31fc6a0242a76bfad09b7dccfc6fc6e9f6
parent8da9f5e759fc62c4a3dad0ddab5edf734a6b7edf
common/ceph_argparse: make parse_ip_port_vec handle list of addrs or addrvecs

This helper is only used for mon_host.

We want to be able to list addrs or addrvecs.  It is slight wonky because
you could parse something like

 "1.2.3.4,5.6.7.8"

as either a list of addrs or a list of addrvecs.  Since the addr parse
takes a default type, it is preferred, so first try parsing as an addr
before proceeding.  Addrvecs that are size >1 must have brackets, so we
will always parse "[1.2.3.4,5.6.7.8]" unambiguously (since "[1.2.3.4"
won't parse as an addr).

Signed-off-by: Sage Weil <sage@redhat.com>
src/common/ceph_argparse.cc
src/test/ceph_argparse.cc