Merge lp:~freyes/charms/trusty/nova-cloud-controller/lp1387073 into lp:~openstack-charmers-archive/charms/trusty/nova-cloud-controller/next

Proposed by Felipe Reyes
Status: Merged
Merged at revision: 193
Proposed branch: lp:~freyes/charms/trusty/nova-cloud-controller/lp1387073
Merge into: lp:~openstack-charmers-archive/charms/trusty/nova-cloud-controller/next
Diff against target: 97 lines (+23/-4)
7 files modified
config.yaml (+6/-0)
hooks/nova_cc_context.py (+1/-0)
templates/havana/nova.conf (+2/-1)
templates/icehouse/nova.conf (+1/-1)
templates/juno/nova.conf (+1/-1)
templates/kilo/nova.conf (+1/-1)
unit_tests/test_nova_cc_contexts.py (+11/-0)
To merge this branch: bzr merge lp:~freyes/charms/trusty/nova-cloud-controller/lp1387073
Reviewer Review Type Date Requested Status
Liam Young (community) Approve
Review via email: mp+271554@code.launchpad.net

Description of the change

Dear OpenStack Charmers,

This MP exposes the scheduler_default_filters from nova.conf as a config option. By default uses the same set of filters that was hardcoded in the template.

This MP adds a basic unit test for NovaConfigContext class.

Best Regards,

To post a comment you must log in.
Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #10195 nova-cloud-controller-next for freyes mp271554
    LINT FAIL: lint-test failed
    LINT FAIL: charm-proof failed

LINT Results (max last 2 lines):
make: *** [lint] Error 100
ERROR:root:Make target returned non-zero.

Full lint test output: http://paste.ubuntu.com/12441374/
Build: http://10.245.162.77:8080/job/charm_lint_check/10195/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #9353 nova-cloud-controller-next for freyes mp271554
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/9353/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #6484 nova-cloud-controller-next for freyes mp271554
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
make: *** [test] Error 1
ERROR:root:Make target returned non-zero.

Full amulet test output: http://paste.ubuntu.com/12441644/
Build: http://10.245.162.77:8080/job/charm_amulet_test/6484/

Revision history for this message
Liam Young (gnuoy) wrote :

The amulet fail looks to do with a known race and other tests did pass. The lint error is a minor charm proof issue unrelated to this change, so LGTM! Thanks for the mp

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'config.yaml'
2--- config.yaml 2015-07-24 12:29:29 +0000
3+++ config.yaml 2015-09-17 20:44:10 +0000
4@@ -395,3 +395,9 @@
5
6 If memcached is being used to store the tokens, then it's recommended to
7 change this configuration to False.
8+ scheduler-default-filters:
9+ type: string
10+ default: "RetryFilter,AvailabilityZoneFilter,CoreFilter,RamFilter,ComputeFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,ServerGroupAntiAffinityFilter,ServerGroupAffinityFilter"
11+ description: |
12+ List of filter class names to use for filtering hosts when not specified in
13+ the request.
14
15=== modified file 'hooks/nova_cc_context.py'
16--- hooks/nova_cc_context.py 2015-07-24 12:29:29 +0000
17+++ hooks/nova_cc_context.py 2015-09-17 20:44:10 +0000
18@@ -304,6 +304,7 @@
19 class NovaConfigContext(context.WorkerConfigContext):
20 def __call__(self):
21 ctxt = super(NovaConfigContext, self).__call__()
22+ ctxt['scheduler_default_filters'] = config('scheduler-default-filters')
23 ctxt['cpu_allocation_ratio'] = config('cpu-allocation-ratio')
24 ctxt['ram_allocation_ratio'] = config('ram-allocation-ratio')
25 addr = resolve_address(INTERNAL)
26
27=== modified file 'templates/havana/nova.conf'
28--- templates/havana/nova.conf 2014-12-16 14:08:58 +0000
29+++ templates/havana/nova.conf 2015-09-17 20:44:10 +0000
30@@ -22,7 +22,8 @@
31 compute_driver=libvirt.LibvirtDriver
32 osapi_compute_workers = {{ workers }}
33 ec2_workers = {{ workers }}
34-scheduler_default_filters = RetryFilter,AvailabilityZoneFilter,CoreFilter,RamFilter,ComputeFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,ServerGroupAntiAffinityFilter,ServerGroupAffinityFilter
35+
36+scheduler_default_filters = {{ scheduler_default_filters }}
37 cpu_allocation_ratio = {{ cpu_allocation_ratio }}
38 use_syslog={{ use_syslog }}
39 my_ip = {{ host_ip }}
40
41=== modified file 'templates/icehouse/nova.conf'
42--- templates/icehouse/nova.conf 2015-08-25 15:34:46 +0000
43+++ templates/icehouse/nova.conf 2015-09-17 20:44:10 +0000
44@@ -31,7 +31,7 @@
45 osapi_compute_workers = {{ workers }}
46 ec2_workers = {{ workers }}
47
48-scheduler_default_filters = RetryFilter,AvailabilityZoneFilter,CoreFilter,RamFilter,ComputeFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,ServerGroupAntiAffinityFilter,ServerGroupAffinityFilter
49+scheduler_default_filters = {{ scheduler_default_filters }}
50 cpu_allocation_ratio = {{ cpu_allocation_ratio }}
51 ram_allocation_ratio = {{ ram_allocation_ratio }}
52
53
54=== modified file 'templates/juno/nova.conf'
55--- templates/juno/nova.conf 2015-08-25 15:34:46 +0000
56+++ templates/juno/nova.conf 2015-09-17 20:44:10 +0000
57@@ -31,7 +31,7 @@
58 osapi_compute_workers = {{ workers }}
59 ec2_workers = {{ workers }}
60
61-scheduler_default_filters = RetryFilter,AvailabilityZoneFilter,CoreFilter,RamFilter,ComputeFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,ServerGroupAntiAffinityFilter,ServerGroupAffinityFilter
62+scheduler_default_filters = {{ scheduler_default_filters }}
63 cpu_allocation_ratio = {{ cpu_allocation_ratio }}
64 ram_allocation_ratio = {{ ram_allocation_ratio }}
65
66
67=== modified file 'templates/kilo/nova.conf'
68--- templates/kilo/nova.conf 2015-08-25 15:34:46 +0000
69+++ templates/kilo/nova.conf 2015-09-17 20:44:10 +0000
70@@ -30,7 +30,7 @@
71 osapi_compute_workers = {{ workers }}
72 ec2_workers = {{ workers }}
73
74-scheduler_default_filters = RetryFilter,AvailabilityZoneFilter,CoreFilter,RamFilter,ComputeFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,ServerGroupAntiAffinityFilter,ServerGroupAffinityFilter
75+scheduler_default_filters = {{ scheduler_default_filters }}
76 cpu_allocation_ratio = {{ cpu_allocation_ratio }}
77 ram_allocation_ratio = {{ ram_allocation_ratio }}
78
79
80=== modified file 'unit_tests/test_nova_cc_contexts.py'
81--- unit_tests/test_nova_cc_contexts.py 2015-07-24 12:29:29 +0000
82+++ unit_tests/test_nova_cc_contexts.py 2015-09-17 20:44:10 +0000
83@@ -296,3 +296,14 @@
84 self.assertEqual(ctxt['ssl_key'], '/etc/nova/ssl/nova_key.pem')
85 self.assertEqual(ctxt['html5proxy_base_url'],
86 'https://10.5.0.1:6082/spice_auto.html')
87+
88+ @mock.patch('charmhelpers.core.hookenv.local_unit')
89+ def test_nova_config_context(self, local_unit):
90+ local_unit.return_value = 'nova-cloud-controller/0'
91+ ctxt = context.NovaConfigContext()()
92+ self.assertEqual(ctxt['scheduler_default_filters'],
93+ self.config('scheduler-default-filters'))
94+ self.assertEqual(ctxt['cpu_allocation_ratio'],
95+ self.config('cpu-allocation-ratio'))
96+ self.assertEqual(ctxt['ram_allocation_ratio'],
97+ self.config('ram-allocation-ratio'))

Subscribers

People subscribed via source and target branches