]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
mgr/orch: improve commandline parsing
authorJoshua Schmid <jschmid@suse.de>
Thu, 14 Nov 2019 16:57:31 +0000 (17:57 +0100)
committerJoshua Schmid <jschmid@suse.de>
Fri, 15 Nov 2019 11:59:58 +0000 (12:59 +0100)
commit16f281d21f31919fdbff0925d99f4ba3420a0bb4
tree7b0ccdfab86d7562b46e2e51935a00f6545538e1
parentbbfc1d435e8a45ec3efe1788e000437692dc27f0
mgr/orch: improve commandline parsing

We have to parse options like hostname, network and optional name

Examples:

"myhost"
"myhost=name"
"myhost:1.2.3.4"
"myhost:1.2.3.4=name"
"myhost:1.2.3.0/24"
"myhost:1.2.3.4/24=name"
"myhost:v2:1.2.3.4:3000/24=name"
"myhost:v2:1.2.3.4:3000,v1:1.2.3.4:6789/24=name"

This patch improves the durability of the code by using
regexes and adds validations for ip_addresses and subnets.

This will now also act as the single parser for all inputs.

Signed-off-by: Joshua Schmid <jschmid@suse.de>
(cherry picked from commit 4812167228813adc2fa45ff502257ca38ed53530)
src/pybind/mgr/orchestrator.py