File tree Expand file tree Collapse file tree 2 files changed +26
-4
lines changed
python/nova-understack/ironic_understack Expand file tree Collapse file tree 2 files changed +26
-4
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,26 @@ def setup_conf():
2727 help = "Controls if Nova should inject storage IPs to config drive." ,
2828 default = True ,
2929 ),
30+ cfg .StrOpt (
31+ "storage_target_a_prefix" ,
32+ help = "Storage Networking Target Prefix A-side" ,
33+ default = "100.127.0.0/17" ,
34+ ),
35+ cfg .StrOpt (
36+ "storage_target_b_prefix" ,
37+ help = "Storage Networking Target Prefix B-side" ,
38+ default = "100.127.128.0/17" ,
39+ ),
40+ cfg .StrOpt (
41+ "storage_client_a_prefix" ,
42+ help = "Storage Networking Client Prefix A-side" ,
43+ default = "100.126.0.0/17" ,
44+ ),
45+ cfg .StrOpt (
46+ "storage_client_b_prefix" ,
47+ help = "Storage Networking Client Prefix B-side" ,
48+ default = "100.126.128.0/17" ,
49+ ),
3050 ]
3151 cfg .CONF .register_group (grp )
3252 cfg .CONF .register_opts (opts , group = grp )
Original file line number Diff line number Diff line change 44from uuid import UUID
55
66import requests
7+ from oslo_config import cfg
78
89
910@dataclass
@@ -30,10 +31,11 @@ def address(self) -> str:
3031 @property
3132 def target_network (self ) -> ipaddress .IPv4Network :
3233 """Returns the respective target-side network."""
33- target_a_prefix = ipaddress .IPv4Network ("100.127.0.0/17" )
34- target_b_prefix = ipaddress .IPv4Network ("100.127.128.0/17" )
35- client_a_prefix = ipaddress .IPv4Network ("100.126.0.0/17" )
36- client_b_prefix = ipaddress .IPv4Network ("100.126.128.0/17" )
34+ nova_us_cfg = cfg .CONF .nova_understack
35+ target_a_prefix = ipaddress .IPv4Network (nova_us_cfg .storage_target_a_prefix )
36+ target_b_prefix = ipaddress .IPv4Network (nova_us_cfg .storage_target_b_prefix )
37+ client_a_prefix = ipaddress .IPv4Network (nova_us_cfg .storage_client_a_prefix )
38+ client_b_prefix = ipaddress .IPv4Network (nova_us_cfg .storage_client_b_prefix )
3739
3840 if self .interface .ip in client_a_prefix :
3941 return target_a_prefix
You can’t perform that action at this time.
0 commit comments