After database migration 056, it became possible to have an environment
of None. Check that env is not None before looking inside it.
Change-Id: Ic498e8e630608886178df83d1e7a503525834573
Closes-Bug: #1464379
This is to prevent the decrypted values from being written to the
database.
Change-Id: Iab8d4d737e3fd839a12d8782367ff0b731f93fe7
Closes-Bug: #1463929
Co-Authored-By: Thomas Herve <therve@redhat.com>
The count is performed in 2 parts
- A function which builds a list of all nested stacks
by recursively calling stack_get_all_by_owner_id
- A query which counts resources which belong to the list
of stacks
Considering this will be the basis for fixing bug #1455589 then this
approach is appropriate for backporting to stable/kilo, but master would
ideally replace this soon with a new Stack attribute that stores the
calculated resource count.
Partial-Bug: #1455589
Change-Id: Ifa2e5609fd9a6853e20037e94a5e16696bb378ee
Currently, the patch does the following:
Kicks off workflow from stack.update_or_create:
Once the dependency graph is calculated, the leaves
of the graph are all casted into the RPC worker bus.
Worker RPC check_resource worfklow:
Workers will then start working on each resource
individually. Once a resource operation is finished,
sync points are used to check if the parent resource
can be worked on. Resources that finish early will
wait for their siblings to finish. The sibling that
finishes last will trigger the creation/updation/deletion
of it's parent. This process then goes on for all nodes
until the roots of the graph are processed.
Marks stack as complete when roots have finished.
Once the roots of the graph are successfully processed,
the previous raw template which was needed for rollback
in case something went wrong will now be deleted from the
database. The stack is then marked as complete.
Largely follows the convergence prototype code in
github.com/zaneb/heat-convergence-prototype/blob/resumable/converge/converger.py
Implements blueprint convergence-check-workflow
Change-Id: I67cfdc452ba406198c96afba57aa4e756408105d
Encrypt properties data before storing it in database and decrypt it
when the resource is being loaded from the database.
Change-Id: I646542b1d03296f62a83041dc2a0ca2719775289
Implements: blueprint encrypt-hidden-parameters
If unencrypted data exists in the database, there will be no
'encrypted_param_names' key in the environment. Check for this key
before referencing it.
Change-Id: Ie8c593818a64d150e815487e1449a52173f1ab5d
Closes-Bug: #1456700
This change adds a (currently unused) database function
stack_get_root_id to find the root stack ID for any stack.
Scheduler hints are moved to using Stack.root_stack_id() in this change.
Remaining uses of Stack.root_stack() will switch to using
Stack.root_stack_id() later in the series.
Change-Id: I9914b0df5af119edea6346db0d7c62124fbb1313
Partial-Bug: #1455589
1. Add a configuration option to enable/disable template parameters
encryption.
2. Encrypt hidden parameters before storing them in the database and
decrypt on stack load.
Change-Id: Ie46c6a149f414f655600616da8deee463e55671c
Implements: blueprint encrypt-hidden-parameters
Co-Authored-By: Jason Dunsmore <jasondunsmore@gmail.com>
Check the snapshot belongs to stack when deleting and showing
stack's snapshot, and restoring from snapshot.
Change-Id: I8ce170b40b05ae17669524d75f80e06e39986673
Closes-Bug: #1437602
We are persisting for a number of reasons:
- so we don't have to pass this through ever rpc call
- the API exposes parent_resource (currently always None as
it is not persisted)
Closes-bug: #1438978
Change-Id: Id2db36c0234a085ec4f0ce2ab114ec483ea29d81
In Heat objects, the default value of nullable attribute is
set in many of the object's fields, which is not required
as oslo object Field defines nullable as False by default
Change-Id: I0164b64c043816f624aeba19561a4a5f8d36689d
Closes-bug: #1439957
When stack is in status IN_PROGRESS and engine service went down,
the status of stack will forever remain in IN_PROGRESS. This patch
add a db apid to get engine_id from stacklock and try to reset the
stack status to FAILED when engine is back.
Closes-Bug: #1382320
Change-Id: Ica856bb0d56c23a4423fb9476c1986aaacf24108
The current Stack object refresh doesn't actually do any refreshing,
which explains the functional test speed regression since the RPC
nested stack code relies on stack.refresh() to poll for state change.
With this change AutoScalingSignalTest.test_signal_with_policy_update
locally takes ~60s consistently. Without this change ~50% of test runs
have some form of execution delay, taking 80s -> 300s+.
Change-Id: Ie06851fd5b0d8b802ebf701e8bf621562d9b6d88
Closes-Bug: #1433555
Prototype implementation of oslo.versionedobjects.
This patch adds WatchRule and WatchData object.
Implements: blueprint versioned-objects
Co-Authored-By: ShaoHe Feng <shaohe.feng@intel.com>
Co-Authored-By: He Jie Xu <hejie.xu@intel.com>
Co-Authored-By: Grzegorz Grasza <grzegorz.grasza@intel.com>
Change-Id: I29fc0fc99c0c425291246dc3889393cbcc0b82cf
Adds versioned-object support for SyncPoint model
Implements blueprint versioned-objects
Co-Authored-by: Rakesh H S <rh-s@hp.com>
Change-Id: Iccfa7553630090f1e9bf6983519009c7d1c7d2a4
This patch adds following columns for resource table:
- `needed_by` (a list of Resource keys)
- `requires` (a list of Resource keys)
- `replaces` (a single Resource key, Null by default)
- `replaced_by` (a single Resource key, Null by default)
- `current_template_id` (a single RawTemplate key)
Co-Authored-by: Angus Salkeld <asalkeld@mirantis.com>
Co-Authored-By: Qiming Teng <tengqim@cn.ibm.com>
Change-Id: I65e1032e84b40cb7ae3126fa6b63c914988cc970
Implements: blueprint convergence-resource-table
Prototype implementation of oslo.versionedobjects.
This patch adds SoftwareDeployment object.
Partially implements bp versioned-objects
Co-Authored-By: ShaoHe Feng <shaohe.feng@intel.com>
Co-Authored-By: He Jie Xu <hejie.xu@intel.com>
Change-Id: I3666a8b2552d8c0c9dcf05efd9c423ff5252f77d
Adds support for versioning object support for StackTag
and add it to the Stack object
Closes-bug: #1432477
Implements blueprint versioned-object
Change-Id: I7cc39c1e1ce913c35862a52592e55b9f484c7e68
Few object methods misses _from_db_object. To enable it to make
schema valid, we need to fix that.
Change-Id: I2e5ff22cd40be56ebc5f3a7095887be773ddb809
Closes-Bug: #1431353
implementation for versioned objects. This contains UserCreds
Co-Authored-By: Michal Jastrzebski (inc0) <michal.jastrzebski@intel.com>
Co-Authored-By: Grzegorz Grasza <grzegorz.grasza@intel.com>
Change-Id: Ibae5504060d2c714225cd8b735b430c7da52e0fa
Implementation for blueprint versioned-objects.
This contains ResourceData.
Co-Authored-By: Grzegorz Grasza <grzegorz.grasza@intel.com>
Co-Authored-By: Michal Jastrzebski (inc0) <michal.jastrzebski@intel.com>
Change-Id: I129f3b891a8efd728ed55c03286dcc1f8b68c4aa
Implementation of oslo.versionedobjects.
This commit consists basic mechanism and first objects.
This should be base of implementation versoning to other objects
Implements: blueprint versioned-objects
Co-Authored-By: ShaoHe Feng <shaohe.feng@intel.com>
Co-Authored-By: Grzegorz Grasza <grzegorz.grasza@intel.com>
Change-Id: I554162cf3681fe559c75f54c61c6f32c91f5c2f8