VPC: fix Python exception processing static routes with next hop when private gateway is also present#11967
VPC: fix Python exception processing static routes with next hop when private gateway is also present#11967DaanHoogland merged 1 commit intoapache:4.22apache/cloudstack:4.22from
Conversation
static routes that don't reference a private gateway don't have an
ip_address and therefore will throw a key error:
```
root@r-359-VM:/var/cache/cloud# update_config.py ip_associations.json.7407b8bd-21c6-4d99-aae0-f2193412650c
Traceback (most recent call last):
File "/opt/cloud/bin/update_config.py", line 147, in <module>
process_file()
File "/opt/cloud/bin/update_config.py", line 57, in process_file
finish_config()
File "/opt/cloud/bin/update_config.py", line 42, in finish_config
returncode = configure.main(sys.argv)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/cloud/bin/configure.py", line 1647, in main
config.address().process()
File "/opt/cloud/bin/cs/CsAddress.py", line 138, in process
ip.configure(address)
File "/opt/cloud/bin/cs/CsAddress.py", line 348, in configure
self.post_configure(address)
File "/opt/cloud/bin/cs/CsAddress.py", line 370, in post_configure
self.post_config_change("add")
File "/opt/cloud/bin/cs/CsAddress.py", line 824, in post_config_change
self.fw_vpcrouter()
File "/opt/cloud/bin/cs/CsAddress.py", line 606, in fw_vpcrouter
if static_route['ip_address'] == self.address['public_ip'] and not static_route['revoke']:
~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'ip_address'
```
Example static routes:
```
root@r-359-VM:/var/cache/cloud# cat /etc/cloudstack/staticroutes.json
{
"10.10.48.0/20": {
"gateway": "10.252.240.10",
"network": "10.10.48.0/20",
"revoke": false
},
"10.250.0.0/16": {
"gateway": "10.252.240.10",
"network": "10.250.0.0/16",
"revoke": false
},
"id": "staticroutes"
}
```
|
@bradh352 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 4.22 #11967 +/- ##
=========================================
Coverage 17.56% 17.56%
- Complexity 15542 15545 +3
=========================================
Files 5909 5909
Lines 529058 529056 -2
Branches 64617 64617
=========================================
+ Hits 92922 92948 +26
+ Misses 425683 425654 -29
- Partials 10453 10454 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
I'm not actually seeing a 4.22 branch upstream unless I'm missing it. I see some release-candidate branches. Is there any possibility in getting this into 4.22.0? This is actually a blocker for us. |
oh my bad. I thought there is already a 4.22 branch 🤦 |
I am not sure if this is a blocker for 4.22.0.0 release if this will not be in 4.22.0.0, you can refer to #10184 (reply in thread) how to patch the kvm hosts. |
pretty please? :) |
|
you can download the tarball and save as /usr/share/cloudstack-common/vms/cloud-scripts.tgz on all kvm hosts and mgmt servers (if you use other hypervisor types) note: ACS 4.22.0.0 only |
|
It looks like I didn't provide feedback on this, but I can confirm I'm using this in production and it does resolve this issue. |
* 4.22: Update templateConfig.sh to not break with directorys with space on t… (#10898) Fix VM and volume metrics listing regressions (#12284) packaging: use latest cmk release link directly (#11429) api:rename RegisterCmd.java => RegisterUserKeyCmd.java (#12259) Prioritize copying templates from other secondary storages instead of downloading them (#10363) Show time correctly in the backup schedule UI (#12012) kvm: use preallocation option for fat disk resize (#11986) Python exception processing static routes fixed (#11967) KVM memballooning requires free page reporting and autodeflate (#11932) api: create/register/upload template with empty template tag (#12234)
Description
static routes that don't reference a private gateway don't have an ip_address and therefore will throw a key error:
Example static routes:
Fixes #11965
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
Tested in a production environment by manually editing the file and observe the changes no longer cause an exception.
How did you try to break this feature and the system with this change?