-
Notifications
You must be signed in to change notification settings - Fork 24
add support for availability zone in OVN cms options #82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,7 @@ | |
| import collections | ||
| import copy | ||
| import io | ||
| import os | ||
| import textwrap | ||
| import subprocess | ||
| import unittest.mock as mock | ||
|
|
@@ -764,6 +765,7 @@ def setUp(self): | |
| 'vpd-device-spec': '', | ||
| 'pmd-cpu-set': '', | ||
| 'ovn-source': 'distro', | ||
| 'customize-failure-domain': False, | ||
| }) | ||
| self.patch_object(ovn_charm.OVNConfigurationAdapter, | ||
| '_ovs_dpdk_cpu_overlap_check') | ||
|
|
@@ -1097,6 +1099,7 @@ def setUp(self): | |
| '[{"bus": "pci", "vendor_id": "beef", "device_id": "cafe"}]', | ||
| 'ovn-source': 'distro', | ||
| 'ovs-exporter-channel': '', | ||
| 'customize-failure-domain': False, | ||
| }) | ||
|
|
||
| def test_optional_openstack_metadata(self): | ||
|
|
@@ -1734,6 +1737,13 @@ def test_assess_exporter_no_channel_not_installed(self): | |
| self.refresh.assert_not_called() | ||
| self.remove.assert_not_called() | ||
|
|
||
| @mock.patch.dict(os.environ, {"JUJU_AVAILABILITY_ZONE": "az1"}, clear=True) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please refrain from using the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @fnordahl seems I cannot use it for self.patch
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, @fnordahl The mock won't get the values of the dict if called get() it will be empty. We may need add
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no need for a separate method to patch dicts, the generic provisions is sufficient. You can for example use
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok. I was thinking about using side_effect, but I was not sure how to use it. Let me look at that and go back to you. Thank you.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. var = somevalue
self.patch_object(module, 'attribute')
self.attribute.side_effect = var |
||
| def test_configure_customize_failure_domain(self): | ||
| self.target.options.customize_failure_domain = True | ||
| self.assertEqual( | ||
| self.target._get_ovn_cms_options(), | ||
| ['enable-chassis-as-gw', 'availability-zones=az1']) | ||
|
|
||
|
|
||
| class TestOVNChassisCharmOvsExporter(Helper): | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 307 and 308 appear to contain copy pasta that does not apply to the
ovn-dedicated-chassisnorovn-chassischarms.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I addressed that now @fnordahl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see it, the text still mentions configuration options not available in these charms.