Impossible to create cluster template with no node groups

Bug #1265609 reported by Andrew Lazarev
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Sahara
Fix Released
Low
Andrew Lazarev

Bug Description

2014-01-02 11:33:11.687 49817 ERROR savanna.utils.api [-] Request aborted with status code 500 and message 'Internal Server Error'
2014-01-02 11:33:11.689 49817 ERROR savanna.utils.api [-] Traceback (most recent call last):
  File "/Users/andrew/Savanna/savanna/savanna/utils/api.py", line 86, in handler
    return func(**kwargs)
  File "/Users/andrew/Savanna/savanna/savanna/service/validation.py", line 50, in handler
    return func(*args, **kwargs)
  File "/Users/andrew/Savanna/savanna/savanna/api/v10.py", line 78, in cluster_templates_create
    return u.render(api.create_cluster_template(data).to_wrapped_dict())
  File "/Users/andrew/Savanna/savanna/savanna/service/api.py", line 248, in create_cluster_template
    return conductor.cluster_template_create(context.ctx(), values)
  File "/Users/andrew/Savanna/savanna/savanna/conductor/resource.py", line 40, in handle
    ret = func(*args, **kwargs)
  File "/Users/andrew/Savanna/savanna/savanna/conductor/api.py", line 164, in cluster_template_create
    return self._manager.cluster_template_create(context, values)
  File "/Users/andrew/Savanna/savanna/savanna/conductor/manager.py", line 235, in cluster_template_create
    return self.db.cluster_template_create(context, values)
  File "/Users/andrew/Savanna/savanna/savanna/db/api.py", line 94, in decorator
    res = func(*args, **kwargs)
  File "/Users/andrew/Savanna/savanna/savanna/db/api.py", line 203, in cluster_template_create
    return IMPL.cluster_template_create(context, values)
  File "/Users/andrew/Savanna/savanna/savanna/db/sqlalchemy/api.py", line 356, in cluster_template_create
    for ng in node_groups:
TypeError: 'NoneType' object is not iterable

summary: - Impossible to create cluster template with no node groups
+ Missed validation for creating cluster template with no node groups
Changed in savanna:
status: New → Confirmed
importance: Undecided → Low
milestone: none → icehouse-2
Revision history for this message
Andrew Lazarev (alazarev) wrote :

Cluster template with no node groups is fully valid. Changed title back.

summary: - Missed validation for creating cluster template with no node groups
+ Impossible to create cluster template with no node groups
Revision history for this message
Matthew Farrellee (mattf) wrote :

Why should we allow a cluster with no node groups to be valid?

Revision history for this message
Andrew Lazarev (alazarev) wrote :

We should not allow cluster with no node group. But cluster template with no node groups is fully valid. As were discussed some time ago we allow cluster templates that don't represent valid cluster. User can add node groups during cluster create.

Revision history for this message
Matthew Farrellee (mattf) wrote :

So there should be two types of validity checks, one for node group template & cluster template and one for cluster. The one for a cluster should run before cluster start to make sure the user isn't asking Savanna to create something that has no hope of being functional enough to...run EDP?

Revision history for this message
Andrew Lazarev (alazarev) wrote :

Yes, and this is how it works right now. The error above is because of runtime error.

Changed in savanna:
assignee: nobody → Andrew Lazarev (alazarev)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to savanna (master)

Fix proposed to branch: master
Review: https://review.openstack.org/65823

Changed in savanna:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to savanna (master)

Reviewed: https://review.openstack.org/65823
Committed: https://git.openstack.org/cgit/openstack/savanna/commit/?id=4fa4b97f6d3be71af5e103acb04d61cc00b688a9
Submitter: Jenkins
Branch: master

commit 4fa4b97f6d3be71af5e103acb04d61cc00b688a9
Author: Andrew Lazarev <email address hidden>
Date: Thu Jan 9 15:51:25 2014 -0800

    Fixed cluster template with no nodegroups creation

    Fixes: bug #1265609

    Change-Id: I25dafd0439ab743cc5bb6f0c36d212c7cc3d1c83

Changed in savanna:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in savanna:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in sahara:
milestone: icehouse-2 → 2014.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.