0

Unable to Validate a template using Heat-API client,when used below method

   from heatclient.client import Client  
   heat = Client('1', endpoint=heat_url, token=auth_token)  
   heat.stacks.validate(template_file) 

Error mesage:

 TypeError: validate() takes exactly 1 argument (2 given)
kavya k
  • 31
  • 6

2 Answers2

1

Here is the source code for heat client api:

def validate(self, **kwargs):
        """Validate a stack template."""
        resp, body = self.client.json_request('POST', '/validate', data=kwargs)
        return body

So, you should not put any argument in the validate() function and I would try run: heat.stacks.validate() and see what it gives you

source code

Hang
  • 17
  • 6
0

Try

heat.stacks.validate(template=template_file) 

OR

heat.stacks.validate(template=template_file["template"])
#If your template is an inner dict  
Kashif Siddiqui
  • 1,476
  • 14
  • 26