Merge lp:~gnuoy/openstack-mojo-specs/mojo-openstack-specs-fix-flavors into lp:openstack-mojo-specs

Proposed by Liam Young
Status: Merged
Merged at revision: 276
Proposed branch: lp:~gnuoy/openstack-mojo-specs/mojo-openstack-specs-fix-flavors
Merge into: lp:openstack-mojo-specs
Diff against target: 53 lines (+36/-0)
1 file modified
helper/tests/simple_os_checks.py (+36/-0)
To merge this branch: bzr merge lp:~gnuoy/openstack-mojo-specs/mojo-openstack-specs-fix-flavors
Reviewer Review Type Date Requested Status
Ryan Beisner Approve
Review via email: mp+307411@code.launchpad.net
To post a comment you must log in.
276. By Liam Young

Create flavors if they are absent (Newton+ deploys)

Revision history for this message
Ryan Beisner (1chb1n) wrote :

FYI - It looks good. I'm exercising this in OSCI mojo spec runners and will merge ASAP if all goes well. Thank you :)

review: Needs Information
Revision history for this message
Ryan Beisner (1chb1n) wrote :

Merging. I'll add a trivial debug log addition ahead of nova_client.flavors.create() for observability and retro-analysis. Thanks again!

review: Approve
Revision history for this message
Ryan Beisner (1chb1n) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'helper/tests/simple_os_checks.py'
2--- helper/tests/simple_os_checks.py 2016-09-22 21:25:04 +0000
3+++ helper/tests/simple_os_checks.py 2016-10-03 10:22:24 +0000
4@@ -4,6 +4,41 @@
5 import utils.mojo_os_utils as mojo_os_utils
6 import argparse
7
8+FLAVORS = {
9+ 'm1.tiny': {
10+ 'flavorid': 1,
11+ 'ram': 512,
12+ 'disk': 1,
13+ 'vcpus': 1},
14+ 'm1.small': {
15+ 'flavorid': 2,
16+ 'ram': 2048,
17+ 'disk': 20,
18+ 'vcpus': 1},
19+ 'm1.medium': {
20+ 'flavorid': 3,
21+ 'ram': 4096,
22+ 'disk': 40,
23+ 'vcpus': 2},
24+ 'm1.large': {
25+ 'flavorid': 4,
26+ 'ram': 8192,
27+ 'disk': 40,
28+ 'vcpus': 4},
29+}
30+
31+
32+def init_flavors(nova_client):
33+ names = [flavor.name for flavor in nova_client.flavors.list()]
34+ for flavor in FLAVORS.keys():
35+ if flavor not in names:
36+ nova_client.flavors.create(
37+ name=flavor,
38+ ram=FLAVORS[flavor]['ram'],
39+ vcpus=FLAVORS[flavor]['vcpus'],
40+ disk=FLAVORS[flavor]['disk'],
41+ flavorid=FLAVORS[flavor]['flavorid'])
42+
43
44 def main(argv):
45 mojo_utils.setup_logging()
46@@ -25,6 +60,7 @@
47 keystone_session = mojo_os_utils.get_keystone_session(overcloud_novarc,
48 scope='PROJECT')
49 novac = mojo_os_utils.get_nova_session_client(keystone_session)
50+ init_flavors(novac)
51
52 priv_key = mojo_os_utils.create_keypair(novac, 'mojo')
53 mojo_os_utils.add_secgroup_rules(novac)

Subscribers

People subscribed via source and target branches