486 Commits

Author SHA1 Message Date
Thomas Herve
df674a715b Add filter function
Add a new HOT intrinsic function to filter out values from lists.

Closes-Bug: #1633512
Change-Id: Ie90001e6436b5ed5b29db7d3c166aba42299d3df
2016-11-04 10:46:12 +01:00
Jenkins
708bda5152 Merge "Add a modulo core constraint" 2016-10-26 04:12:29 +00:00
Jenkins
99df5cba64 Merge "Fix typo in documentation" 2016-10-26 03:27:25 +00:00
Peter Razumovsky
a7c7945d01 Add info to docs about heat devstack plugin
Since Newton release heat devstack plugin will be available,
so need to add info about that to documentation.

Change-Id: Ie2503fbdd9e3f72c20889a675664fb5149d2b287
Closes-bug: #1610987
2016-10-24 12:27:52 +03:00
Ana Krivokapic
b1144b22ce Add a modulo core constraint
A modulo constraint will be used to restrict numeric values to
leave a certain remainder when divided with certain divisor.
E.g. we can use this to constrain values to even/odd numbers.

Change-Id: I9d7db4307be2a2b93cc928cf5912af7b49c72076
2016-10-11 16:55:11 +02:00
Crag Wolfe
aac3e7aae6 Add new hot function str_replace_strict
In many cases, a user would rather see an error result if a
str_replace param is not substituted in the template, rather than the
function silently doing nothing.

Since str_replace is set in its ways, introduce a new function
str_replace_strict which behaves identically to str_replace except
that a ValueError is raised if any of the param's are not found
in the template.

Change-Id: I8b8c69bb49dfeb74e05af4871602c20493b081eb
2016-10-10 10:24:55 -07:00
Pierre Riteau
cd69fe37d5 Fix typo in documentation
Change-Id: I91edba9a3570580fdb2ee649be20996993e3b7c7
2016-10-08 14:28:50 -05:00
Jenkins
38b3d4349e Merge "Add a new HOT template version for Ocata" 2016-09-28 03:44:24 +00:00
Sylvain Baubeau
eaedf85c99 Fix indentation in get_param example
Change-Id: I116228897c1709b7cc0a8d0ec30020bb5588262a
2016-09-23 17:13:44 +02:00
ricolin
aa90b5a7ec Add a new HOT template version for Ocata
Add new template version `heat_template_version.2017-02-24`, and
add version `heat_template_version.ocata` refering to
`heat_template_version.2017-02-24`.

Change-Id: Ic89fc1a02988091dd2833cc50abee61edfabbb00
2016-09-22 09:34:07 +08:00
huangtianhua
2ca07d14b7 Add Ocata version '8.0.0' in doc
Change-Id: I06208036b2eb43eb6d40887a1dd66850b5f04c15
2016-09-21 14:53:36 +08:00
Ha Van Tu
7b6ac8a04e Update link reference
This patch update the outdated link reference inside the doc.

Change-Id: I0b27aecade2a4b37bdf1e52c9f049075ed18a2ce
2016-09-15 14:37:34 +07:00
Jenkins
9df7ee3a09 Merge "Allows condition name using boolean or function" 2016-09-15 05:11:02 +00:00
Jenkins
e80062b6ea Merge "Allow referencing conditions by name" 2016-09-14 22:43:56 +00:00
huangtianhua
4a92678f18 Allows condition name using boolean or function
This change supports:
1. Allow boolean value or condition function as
   condition name of 'if' function:
   resources:
     r1:
        ...
	properties:
	  a: {if: [true, 'value_true', 'value_false']}
     r2:
       ...
       properties:
         b: {if: [{equals: [...]}, 'value_true', 'value_false']}
2. Allow boolean value or condition function as
   condtiion name in resource definition:
   resources:
     r1:
       ...
       condition: false
     r2:
       ...
       condition: {and: [cd1, cd2]}
3. Allow boolean value or condition function as
   condition name in outputs:
   outputs:
     output1:
       value: ...
       condition: true
     output2:
       value: ...
       condition: {not: cd3}

Change-Id: I2bf9bb0b608788c928d12425cbfdaf658df9e880
Co-Authored-By: Zane Bitter <zbitter@redhat.com>
Blueprint: support-conditions-function
2016-09-12 21:40:06 -04:00
Zane Bitter
bca8b8e804 Allow referencing conditions by name
This change allows reference with other conditions by name in
definition of a condition, something like:
   conditions:
     cd1: {equals: [{get_param: env_type}, 'prod']}
     cd2: {not: cd1}
     cd3: {equals: [{get_param: zone}, 'fujian']}
     cd4: {and: [cd1, cd3]}

Change-Id: I6a0a00c23aa7d559dedd6998adaa7962d607f315
Co-Authored-By: huangtianhua <huangtianhua@huawei.com>
Blueprint: support-conditions-function
Related-Bug: #1621529
2016-09-12 21:39:01 -04:00
Peter Razumovsky
0d3bed1696 Update plugin-guide documentation page
Current plugin-guide page is obsolete and needed in
updating. This patch adds all necessary info to page.

Change-Id: I72f81cc9e1d48458f677c4056da69ed79bb71fd9
2016-09-09 13:53:56 +03:00
Zane Bitter
e417fc3b86 Revert "Allow reference conditions by name"
This reverts commit 4a8ad39a3881c0743916f016b4763015946f127d.

There was no protection against circular references causing infinite
recursion.

Change-Id: I35226420c458474e75716591d587e73a82e75688
Closes-Bug: #1621529
2016-09-08 11:37:19 -04:00
Jenkins
45bbec711e Merge "Allow reference conditions by name" 2016-09-07 10:10:59 +00:00
huangtianhua
4a8ad39a38 Allow reference conditions by name
This change allows reference with other conditions by name in
definition of a condition, something like:
   conditions:
     cd1: {equals: [{get_param: env_type}, 'prod']}
     cd2: {not: cd1}
     cd3: {equals: [{get_param: zone}, 'fujian']}
     cd4: {and: [cd1, cd3]}

Change-Id: I4fbc3839977d2d4299d65d4d56e3d41d56d07aef
Blueprint: support-conditions-function
2016-09-06 09:10:46 +08:00
Jenkins
4292b5ea3a Merge "Minor fix for hot_spec.rst" 2016-09-04 07:12:53 +00:00
Jenkins
67298193f7 Merge "Non-destructive upgrade for deprecated resources" 2016-09-03 06:04:39 +00:00
ricolin
3aeaefc29f Non-destructive upgrade for deprecated resources
If you attempt to update a stack containing
OS::Heat::SoftwareDeployments resources, so it uses the new
non-deprecated OS::Heat::SoftwareDeploymentGroup type instead, it
deletes the group, and all of the deployments.

This means that any deployment "actions" property will be
misinterpreted, e.g if you have actions: CREATE, all the deployments
will re-run on the update, even though it's an update, not a create.

This issue exists on all deprecated resoruces, when we trying to upgrade
to new version of it by update.

This patch fix above update issue by check if resoruce was deprecated
and been update by replacing resource (which is the parent class of
existing resource).

Change-Id: Ib7880120a90c4497a7ceea53eee55c220a28d14e
Closes-Bug: #1528958
2016-09-02 13:09:11 +08:00
Ha Van Tu
d8260b7882 Correct link reference in heat/doc
Currently we are using the new address for api reference. But
heat/doc/source/index.rst still uses the old one.

Change-Id: Ie1423e01a39b1f24fd3fa12368abcb87c8b1ac7c
2016-08-31 18:14:57 +07:00
Dmitriy Uvarenkov
6522de8368 Minor fix for hot_spec.rst
Fixed some minor typos.

Change-Id: I8489e0b8e67103d0e6877264cbd4c179d17fc21a
2016-08-30 17:33:12 +03:00
Jenkins
4b4c4a3f28 Merge "Provide 'or' function" 2016-08-30 04:17:54 +00:00
Jenkins
4b42dd3077 Merge "Add doc and reno note for environment merging" 2016-08-29 20:45:30 +00:00
huangtianhua
bfd8d7b2ab Provide 'or' function
Provides condition function 'or' for templates:
AWSTemplateFormatVersion.2010-09-09
heat_template_version.2016-10-14

Change-Id: I6888453404a2cba5127e5d89f7445c5dfe2b7a37
Blueprint: support-conditions-function
2016-08-29 14:31:19 -04:00
rabi
3f646800dd Add doc and reno note for environment merging
Change-Id: I1427e394975baac3377a4a8d67f44f65d404f8b4
Blueprint: environment-merging
2016-08-29 20:20:07 +05:30
huangtianhua
6fa325e34e Provide 'and' function
Provides condition function 'and' for templates:
AWSTemplateFormatVersion.2010-09-09
heat_template_version.2016-10-14

Blueprint: support-conditions-function
Change-Id: I7a9a10b871f50a5a2885adc72d60d626f960557c
2016-08-26 01:44:24 +00:00
huangtianhua
aeb15bf818 Provides 'not' condition function
Support 'not' and 'Fn::Not' for templates:
AWSTemplateFormatVersion.2010-09-09
heat_template_version.2016-10-14

Change-Id: I6a9c89a23160a2cf06c37677871bcfbfab9599be
Blueprint: support-conditions-function
2016-08-25 01:14:34 +00:00
huangtianhua
4c4d790c62 Provides 'if' intrinsic function
Provides condition function 'if' for templates:
AWSTemplateFormatVersion.2010-09-09
heat_template_version.2016-10-14

Change-Id: I34c342de176bc87c9cde41aa32478e386f045422
Blueprint: support-conditions-function
2016-08-25 01:14:14 +00:00
huangtianhua
4552e08767 Support condition for output
Provides output condition for cfn/hot templates,
if the condition of output evaluates to false, will
set output value to None.

Change-Id: I0398e39541a4176ef5699331c10536c59f1cb3e7
Blueprint: support-conditions-function
2016-08-25 09:10:33 +08:00
huangtianhua
59476f63bc Support condition for resource
Support condition section in resource definition.

Change-Id: Ic63debbf71c158e397ca3d9b9047eafdd598830b
Blueprint: support-conditions-function
Closes-Bug: #1605485
2016-08-24 09:57:07 +00:00
Jenkins
0803639788 Merge "Add support for a resource level external_id" 2016-08-15 04:00:27 +00:00
Jenkins
a6d8b95db5 Merge "Fix path_in_stack for scheduler hints" 2016-08-14 22:00:21 +00:00
Jenkins
b996edfab2 Merge "Support maps as argument for repeat/for_each" 2016-08-14 21:51:44 +00:00
Giulio Fidente
9fc7b1de43 Support maps as argument for repeat/for_each
Turns out we just need to count collection.Mapping as valid arg.

Change-Id: Id450e777930bb0b749c0ecfab0679a52a84fd7fe
2016-08-12 15:30:16 +02:00
ricolin
c385388ea1 Add support for a resource level external_id
This adds support for the following to the template:
 heat_template_version: 2016-10-14
 resources:
   ...
   res_a:
     type: OS::Nova::Server
     external_id: the-new-server-id
     properties:
     ...

Co-Authored-By: Rico Lin <rico.l@inwinstack.com>

blueprint external-resources
Change-Id: I8fda1380504d1d8b1e96649bf20b86d6309fdeca
2016-08-12 15:59:14 +08:00
Rabi Mishra
372a2376b8 Fix path_in_stack for scheduler hints
Nova expects scheduler_hints to be a DictOfListOfStrings in
the object layer(versioned objects), though there is no
limitation for this in the api layer. Thefore sending a
list of tuples as a scheduler_hint results in error.

This also sets stack_scheduler_hints=true for integration
tests.

Change-Id: Id7575f67657fab86acb22d86807127dda45305d5
Closes-Bug: #1608452
2016-08-05 10:21:10 +00:00
huangtianhua
70c4ab3fcf Support 'conditions' section for templates
This changes:
1. Support 'Conditions' for AWSTemplateFormatVersion: 2010-09-09
2. Support 'conditions' for heat_template_version: 2016-10-14
3. There is no need to add a new HeatTemplateFormatVersion template,
   because we decide to support conditions in AWSTemplateFormatVersion
   and heat_template_version: 2016-10-14, so remove the
   HeatTemplateFormatVersion.2016-10-14
4. Move the definition of function 'equals' to hot/functions.py
5. Mark 'equals' as condition function which supported in conditions.

Change-Id: I2e7bdfa1c2052e75f35f2bd0003cdc170188d8b8
Blueprint: support-conditions-function
2016-08-03 09:17:31 +08:00
Jenkins
e1178a3120 Merge "Fix two typos" 2016-08-02 11:50:33 +00:00
Atsushi SAKAI
d87c8befb4 Fix two typos
examnple   => example
restrcited => restricted

Change-Id: I22bc1d317892047dd6179defa915af09ddc5ac9a
2016-08-02 19:09:38 +09:00
Jenkins
8cd5f64dfb Merge "Purge deleted stacks for specific project" 2016-08-02 09:34:56 +00:00
Jenkins
7fced683cb Merge "Correct doc about os-collect-config metadata polling" 2016-08-02 06:37:45 +00:00
Steven Hardy
f019fb002e Fix some map_replace issues
While testing I discovered a couple of corner cases not previously
handled:
- If you provide values/keys via a get_attr reference it's possible for
them to be None during validation
- If the input map has an unhashable value, it breaks the values replacement
so we need to tolerate a failure to lookup an unhashable key in the values
data.

Change-Id: I14d92056e0a07816a216aba752711887e8ac0aa5
2016-07-21 18:55:21 +01:00
Ala Rezmerita
61836dbf42 Purge deleted stacks for specific project
Add project-id argument to heat-manage purge_deleted command in order
to be able to hard delete DB entries for a specific project.

Change-Id: Ifffe5657a40ce97db9d059ff1516b8e1eb801132
Implements: bp heat-manage-purge-deleted-tenant
2016-07-20 17:02:12 +00:00
Steven Hardy
ab57f5478a Add reno for map_replace and fix docs nit
I missed adding the reno in https://review.openstack.org/#/c/343731/
and there was a minor docs nit mentiond also.

Change-Id: Ib78ca19b96a239c0a06758c259e2e74e10ed26e5
2016-07-20 08:46:36 +01:00
Steven Hardy
b862945889 Implement map_replace intrinsic function
This adds a new map_replace function that can iterate over a map
(e.g json parameter) doing key/value replacements.

Change-Id: I29f0e438c398fda715c79727ed5de8383e5b5d7b
Implements-Blueprint: blueprint map-replace-function
2016-07-19 17:07:45 +01:00
Jenkins
95a359ab3e Merge "Add information about Resolve rule to docs" 2016-07-07 23:36:03 +00:00