Merge lp:~springfield-team/charms/precise/openstack-dashboard/trunk into lp:~openstack-charmers-archive/charms/precise/openstack-dashboard/trunk

Proposed by ChingWei Chang
Status: Superseded
Proposed branch: lp:~springfield-team/charms/precise/openstack-dashboard/trunk
Merge into: lp:~openstack-charmers-archive/charms/precise/openstack-dashboard/trunk
Diff against target: 127 lines (+46/-3)
6 files modified
config.yaml (+3/-0)
hooks/horizon_contexts.py (+11/-1)
hooks/horizon_utils.py (+9/-0)
templates/havana/local_settings.py (+7/-1)
templates/icehouse/_40_router.py (+10/-0)
templates/icehouse/local_settings.py (+6/-1)
To merge this branch: bzr merge lp:~springfield-team/charms/precise/openstack-dashboard/trunk
Reviewer Review Type Date Requested Status
Shiv Prasad Rao (community) Needs Resubmitting
James Page Needs Fixing
Marco Ceppi Pending
Review via email: mp+218170@code.launchpad.net

This proposal supersedes a proposal from 2014-04-29.

This proposal has been superseded by a proposal from 2014-07-28.

Description of the change

This merge proposal is prepared for supporting Cisco Nexus 1000V dashboard for its related extension tab/panel.
config.yaml
New parameter for supporting Cisco N1KV specific policy profile profile-support.

hooks/horizon_contexts.py
Context logic to retrieve profile-support

templates/havana/local_settings.py
For profile-support setting

To post a comment you must log in.
Revision history for this message
Marco Ceppi (marcoceppi) wrote : Posted in a previous version of this proposal

Leaving for openstack-charmers, thanks!!

review: Abstain
Revision history for this message
ChingWei Chang (cwchang) wrote :

We have merged with latest Icehouse merge to charm store now.
Please re-review this version

Revision history for this message
James Page (james-page) wrote :

Thanks for this proposal.

I think you need to tweak the way that the profile_support is handled. Specifically

1) config.yaml

Don't provide a default on "None" - the default is null which translates into None in python once parsed.

Also lets drop "-support" from the configuration key - its really just the profile.

Some comments in the description as to which values work would be nice as well.

2) local_settings.py

Rather than dropping the value directly into local settings, I'd prefer to see a conditional code block in the template that sets the profile_support value if its not None, and defaults the the original code if its None.

3) hooks/horizon_contexts.py

Please validate that the profile-support config is a supported value - 'cisco' or None should be right I think.

Thanks!

review: Needs Fixing
32. By Shiv Prasad Rao

Bug fix for havana deployment

33. By Shiv Prasad Rao

Chaning profile-support to profile
changes to address review comments

34. By Shiv Prasad Rao

sync revision 31 from lp:charms/openstack-dashboard

Revision history for this message
Shiv Prasad Rao (shivrao) wrote :

Addressed the comments:

1) changed the config parameter to "profile" in config.yaml. It was originally created as profile-support because the parameter in the local_setting is profile-support.

2) Added conditional code block in local_settings.py

3) added validation for supported value. Currently it is only cisco.

review: Needs Resubmitting
35. By Dulanjalie Ganegedara

adding charmhelper support to use --keyserver option for public PPA

Unmerged revisions

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 2014-02-03 12:34:56 +0000
3+++ config.yaml 2014-07-22 07:19:40 +0000
4@@ -87,3 +87,6 @@
5 secret:
6 type: string
7 description: Secret for Horizon to use when securing internal data; set this when using multiple dashboard units.
8+ profile:
9+ type: string
10+ description: Default profile for the dashboard. Eg. cisco
11
12=== modified file 'hooks/horizon_contexts.py'
13--- hooks/horizon_contexts.py 2014-02-27 10:07:57 +0000
14+++ hooks/horizon_contexts.py 2014-07-22 07:19:40 +0000
15@@ -83,7 +83,8 @@
16 'default_role': config('default-role'),
17 "webroot": config('webroot'),
18 "ubuntu_theme": config('ubuntu-theme') in ['yes', True],
19- "secret": config('secret') or pwgen()
20+ "secret": config('secret') or pwgen(),
21+ 'support_profile': config('profile') if config('profile') in ['cisco'] else None,
22 }
23 return ctxt
24
25@@ -119,3 +120,12 @@
26 'ssl_configured': False,
27 }
28 return ctxt
29+
30+class RouterSettingContext(OSContextGenerator):
31+ def __call__(self):
32+ ''' Enable/Disable Router Tab on horizon '''
33+ ctxt = {
34+ 'disable_router': False if config('profile') in ['cisco'] else True
35+ }
36+ return ctxt
37+
38
39=== modified file 'hooks/horizon_utils.py'
40--- hooks/horizon_utils.py 2014-05-21 10:06:19 +0000
41+++ hooks/horizon_utils.py 2014-07-22 07:19:40 +0000
42@@ -40,6 +40,7 @@
43 APACHE_24_DEFAULT = "%s/sites-available/000-default.conf" % (APACHE_CONF_DIR)
44 APACHE_SSL = "%s/sites-available/default-ssl" % (APACHE_CONF_DIR)
45 APACHE_DEFAULT = "%s/sites-available/default" % (APACHE_CONF_DIR)
46+ROUTER_SETTING = "/usr/share/openstack-dashboard/openstack_dashboard/enabled/_40_router.py"
47
48 TEMPLATES = 'templates'
49
50@@ -86,6 +87,10 @@
51 'hook_contexts': [horizon_contexts.HorizonHAProxyContext()],
52 'services': ['haproxy'],
53 }),
54+ (ROUTER_SETTING, {
55+ 'hook_contexts': [horizon_contexts.RouterSettingContext()],
56+ 'services': ['apache2'],
57+ }),
58 ])
59
60
61@@ -122,6 +127,10 @@
62 configs.register(APACHE_SSL,
63 CONFIG_FILES[APACHE_SSL]['hook_contexts'])
64
65+ if os.path.exists(os.path.dirname(ROUTER_SETTING)):
66+ configs.register(ROUTER_SETTING,
67+ CONFIG_FILES[ROUTER_SETTING]['hook_contexts'])
68+
69 return configs
70
71
72
73=== modified file 'templates/havana/local_settings.py'
74--- templates/havana/local_settings.py 2014-05-28 16:05:37 +0000
75+++ templates/havana/local_settings.py 2014-07-22 07:19:40 +0000
76@@ -160,10 +160,16 @@
77 # The profile_support option is used to detect if an external router can be
78 # configured via the dashboard. When using specific plugins the
79 # profile_support can be turned on if needed.
80+ #'profile_support': None,
81+ #'profile_support': 'cisco', # Example of value set to support Cisco
82+ {% if support_profile -%}
83+ 'profile_support': '{{ support_profile }}',
84+ {% else -%}
85 'profile_support': None,
86- #'profile_support': 'cisco',
87+ {% endif -%}
88 }
89
90+
91 # The OPENSTACK_IMAGE_BACKEND settings can be used to customize features
92 # in the OpenStack Dashboard related to the Image service, such as the list
93 # of supported image formats.
94
95=== added file 'templates/icehouse/_40_router.py'
96--- templates/icehouse/_40_router.py 1970-01-01 00:00:00 +0000
97+++ templates/icehouse/_40_router.py 2014-07-22 07:19:40 +0000
98@@ -0,0 +1,10 @@
99+#The name of the dashboard to be added to HORIZON['dashboards']. Required.
100+DASHBOARD = 'router'
101+
102+# A list of applications to be added to INSTALLED_APPS.
103+ADD_INSTALLED_APPS = [
104+ 'openstack_dashboard.dashboards.router',
105+]
106+
107+# If set to True, this dashboard will not be added to the settings.
108+DISABLED = {{ disable_router }}
109
110=== modified file 'templates/icehouse/local_settings.py'
111--- templates/icehouse/local_settings.py 2014-05-28 16:05:37 +0000
112+++ templates/icehouse/local_settings.py 2014-07-22 07:19:40 +0000
113@@ -163,8 +163,13 @@
114 # The profile_support option is used to detect if an external router can be
115 # configured via the dashboard. When using specific plugins the
116 # profile_support can be turned on if needed.
117+ #'profile_support': None,
118+ #'profile_support': 'cisco', # Example of value set to support Cisco
119+ {% if support_profile -%}
120+ 'profile_support': '{{ support_profile }}',
121+ {% else -%}
122 'profile_support': None,
123- #'profile_support': 'cisco',
124+ {% endif -%}
125 }
126
127 # The OPENSTACK_IMAGE_BACKEND settings can be used to customize features

Subscribers

People subscribed via source and target branches