Invalid call of method EngineClient.create_software_config in RPC API

Bug #1392327 reported by Andrey Alekov
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
High
Steve Baker

Bug Description

Commit 7e1721dff3342721ee4ea69fe9e20b58b7426061 leads to error in test tempest.api.orchestration.stacks.test_templates.TemplateYAMLTestJSON.
As we see from Heat code, that method handle_create from heat/engine/resources/software_config/cloud_config.py doesn't provide "group" argument. You can reproduce bug by installation of default Devstack and run mentioned test.

Test log:
<failure type="testtools.testresult.real._StringException">
_StringException: Traceback (most recent call last): File "tempest/test.py", line 264, in setUpClass cls.resource_setup() File "tempest/api/orchestration/stacks/test_templates.py", line 36, in resource_setup 'CREATE_COMPLETE') File "tempest/services/orchestration/json/orchestration_client.py", line 214, in wait_for_stack_status stack_status_reason=body['stack_status_reason']) StackBuildErrorException: Stack %(stack_identifier)s is in %(stack_status)s status due to '%(stack_status_reason)s' Details: Stack heat-1370212178/0500ca3e-ebd8-4a2c-ae25-75bf76a1b06b is in CREATE_FAILED status due to 'Resource CREATE failed: TypeError: create_software_config() takes at least 5 arguments (4 given)'
</failure>

or formatted
_StringException: Traceback (most recent call last):
File "tempest/test.py", line 264, in setUpClass cls.resource_setup()
File "tempest/api/orchestration/stacks/test_templates.py", line 36, in resource_setup 'CREATE_COMPLETE')
File "tempest/services/orchestration/json/orchestration_client.py", line 214, in wait_for_stack_status stack_status_reason=body['stack_status_reason']) StackBuildErrorException:
Stack %(stack_identifier)s is in %(stack_status)s status due to '%(stack_status_reason)s'
Details: Stack heat-872035629/b576d7a5-ac32-4a5e-8e28-a8ae9fe72e90 is in CREATE_FAILED status due to
'Resource CREATE failed: TypeError: create_software_config() takes at least 5 arguments (4 given)'

Heat API log:
screen-h-api.log:2014-11-13 11:08:27.899 DEBUG heat.common.serializers [req-78409b01-8a97-4b91-8800-d328281d2589 None demo] JSON response : {"stack": {"parent": null, "disable_rollback": true, "description": "Template which creates only a new cloud config", "links": [{"href": "http://192.168.70.2:8004/v1/a16ccc74b42240839ccdc85522d01185/stacks/heat-1142016754/23b8d3a6-dbf6-4014-ad0a-349d69f49c66", "rel": "self"}], "stack_status_reason": "Resource CREATE failed: TypeError: create_software_config() takes at least 5 arguments (4 given)", "stack_name": "heat-1142016754", "outputs": [], "stack_owner": "demo", "creation_time": "2014-11-13T11:08:25Z", "capabilities": [], "notification_topics": [], "updated_time": null, "timeout_mins": 60, "stack_status": "CREATE_FAILED", "parameters": {"AWS::StackId": "arn:openstack:heat::a16ccc74b42240839ccdc85522d01185:stacks/heat-1142016754/23b8d3a6-dbf6-4014-ad0a-349d69f49c66", "AWS::Region": "ap-southeast-1", "AWS::StackName": "heat-1142016754"}, "id": "23b8d3a6-dbf6-4014-ad0a-349d69f49c66", "template_description": "Template which creates only a new cloud config"}} from (pid=22249) to_json /opt/stack/heat/heat/common/serializers.py:43
2014-11-13 11:05:13.401 DEBUG heat.engine.scheduler [-] Task stack_task from Stack "heat-260109052" [15ff9b5a-7326-4698-ab24-8875146ecafe] starting from (pid=22207) start /opt/stack/heat/heat/engine/scheduler.py:1903.402 DEBUG heat.engine.scheduler [-] Task stack_task from Stack "heat-260109052" [15ff9b5a-7326-4698-ab24-8875146ecafe] running from (pid=22207) step /opt/stack/heat/heat/engine/scheduler.py:218:13.411 INFO heat.engine.stack [-] Stack CREATE IN_PROGRESS (heat-260109052): Stack CREATE started
2014-11-13 11:05:13.445 INFO heat.engine.resource [-] CREATE: CloudConfig "CfnCloudConfig" Stack "heat-260109052" [15ff9b5a-7326-4698-ab24-8875146ecafe]
2014-11-13 11:05:13.445 TRACE heat.engine.resource Traceback (most recent call last):
2014-11-13 11:05:13.445 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 453, in _action_recorder
2014-11-13 11:05:13.445 TRACE heat.engine.resource yield
2014-11-13 11:05:13.445 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 523, in _do_action
2014-11-13 11:05:13.445 TRACE heat.engine.resource yield self.action_handler_task(action, args=handler_args)
2014-11-13 11:05:13.445 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/scheduler.py", line 294, in wrapper
2014-11-13 11:05:13.445 TRACE heat.engine.resource step = next(subtask)
2014-11-13 11:05:13.445 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 494, in action_handler_task
2014-11-13 11:05:13.445 TRACE heat.engine.resource handler_data = handler(*args)
2014-11-13 11:05:13.445 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resources/software_config/cloud_config.py", line 58, in handle_create
2014-11-13 11:05:13.445 TRACE heat.engine.resource sc = self.rpc_client().create_software_config(self.context, **props)
2014-11-13 11:05:13.445 TRACE heat.engine.resource TypeError: create_software_config() takes at least 5 arguments (4 given)
2014-11-13 11:05:13.445 TRACE heat.engine.resource
2014-11-13 11:05:14.555 INFO heat.engine.stack [-] Stack CREATE FAILED (heat-260109052): Resource CREATE failed: TypeError: create_software_config() takes at least 5 arguments (4 given)

Method handle_request:
    def handle_create(self):
        props = {self.NAME: self.physical_resource_name()}
        cloud_config = yaml.dump(self.properties.get(
            self.CLOUD_CONFIG), Dumper=yaml_dumper)
        props[self.CONFIG] = '#cloud-config\n%s' % cloud_config
        sc = self.rpc_client().create_software_config(self.context, **props)
        self.resource_id_set(sc[rpc_api.SOFTWARE_CONFIG_ID])

Signature of method create_software_config:
    def create_software_config(self, cnxt, group, name, config,
                               inputs=None, outputs=None, options=None):

Tags: heat
Andrey Alekov (aalekov)
summary: - Invalid signature of method EngineClient.create_software_config in RPC
- API
+ Invalid call of method EngineClient.create_software_config in RPC API
Andrey Alekov (aalekov)
description: updated
Revision history for this message
Steven Hardy (shardy) wrote :

umm, any idea why didn't this tempest failure get caught in the gate?

Changed in heat:
status: New → Triaged
importance: Undecided → High
assignee: nobody → Steve Baker (steve-stevebaker)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

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

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

Reviewed: https://review.openstack.org/134399
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=550683b8af0d229e90ae80adb687a2980bc98e40
Submitter: Jenkins
Branch: master

commit 550683b8af0d229e90ae80adb687a2980bc98e40
Author: Steve Baker <email address hidden>
Date: Fri Nov 14 13:14:54 2014 +1300

    Include group argument in calls to create_software_config

    group is a mandatory argument, and was missing from some calls.

    This change also adds tests which checks all arguments to
    create_software_config for cloud_config and multi_part

    Change-Id: I64aba8c31bfa69fa209aefb3d86adfa6313a6621
    Closes-Bug: #1392327

Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
milestone: none → kilo-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: kilo-1 → 2015.1.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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