12
12
13
13
from keystoneauth1 import loading as ks_loading
14
14
from oslo_config import cfg
15
+ from oslo_config import types
15
16
from oslo_log import log as logging
16
17
17
18
from ovn_octavia_provider .i18n import _
20
21
21
22
22
23
ovn_opts = [
23
- cfg .StrOpt ('ovn_nb_connection' ,
24
- default = 'tcp:127.0.0.1:6641' ,
25
- help = _ ('The connection string for the OVN_Northbound OVSDB.\n '
26
- 'Use tcp:IP:PORT for TCP connection.\n '
27
- 'Use ssl:IP:PORT for SSL connection. The '
28
- 'ovn_nb_private_key, ovn_nb_certificate and '
29
- 'ovn_nb_ca_cert are mandatory.\n '
30
- 'Use unix:FILE for unix domain socket connection.' )),
24
+ cfg .ListOpt ('ovn_nb_connection' ,
25
+ default = ['tcp:127.0.0.1:6641' ],
26
+ item_type = types .String (regex = r'^(tcp|ssl|unix):.+' ),
27
+ help = _ ('The connection string for the OVN_Northbound OVSDB.\n '
28
+ 'Use tcp:IP:PORT for TCP connection.\n '
29
+ 'Use ssl:IP:PORT for SSL connection. The '
30
+ 'ovn_nb_private_key, ovn_nb_certificate and '
31
+ 'ovn_nb_ca_cert are mandatory.\n '
32
+ 'Use unix:FILE for unix domain socket connection.' )),
31
33
cfg .StrOpt ('ovn_nb_private_key' ,
32
34
default = '' ,
33
35
help = _ ('The PEM file with private key for SSL connection to '
40
42
default = '' ,
41
43
help = _ ('The PEM file with CA certificate that OVN should use to'
42
44
' verify certificates presented to it by SSL peers' )),
43
- cfg .StrOpt ('ovn_sb_connection' ,
44
- default = 'tcp:127.0.0.1:6642' ,
45
- help = _ ('The connection string for the OVN_Southbound OVSDB.\n '
46
- 'Use tcp:IP:PORT for TCP connection.\n '
47
- 'Use ssl:IP:PORT for SSL connection. The '
48
- 'ovn_sb_private_key, ovn_sb_certificate and '
49
- 'ovn_sb_ca_cert are mandatory.\n '
50
- 'Use unix:FILE for unix domain socket connection.' )),
45
+ cfg .ListOpt ('ovn_sb_connection' ,
46
+ default = ['tcp:127.0.0.1:6642' ],
47
+ item_type = types .String (regex = r'^(tcp|ssl|unix):.+' ),
48
+ help = _ ('The connection string for the OVN_Southbound OVSDB.\n '
49
+ 'Use tcp:IP:PORT for TCP connection.\n '
50
+ 'Use ssl:IP:PORT for SSL connection. The '
51
+ 'ovn_sb_private_key, ovn_sb_certificate and '
52
+ 'ovn_sb_ca_cert are mandatory.\n '
53
+ 'Use unix:FILE for unix domain socket connection.' )),
51
54
cfg .StrOpt ('ovn_sb_private_key' ,
52
55
default = '' ,
53
56
help = _ ('The PEM file with private key for SSL connection to '
@@ -176,7 +179,7 @@ def list_opts():
176
179
177
180
178
181
def get_ovn_nb_connection ():
179
- return cfg .CONF .ovn .ovn_nb_connection
182
+ return ',' . join ( cfg .CONF .ovn .ovn_nb_connection )
180
183
181
184
182
185
def get_ovn_nb_private_key ():
@@ -192,7 +195,7 @@ def get_ovn_nb_ca_cert():
192
195
193
196
194
197
def get_ovn_sb_connection ():
195
- return cfg .CONF .ovn .ovn_sb_connection
198
+ return ',' . join ( cfg .CONF .ovn .ovn_sb_connection )
196
199
197
200
198
201
def get_ovn_sb_private_key ():
0 commit comments