This change ensures that api services deployed with apache+uwsgi
by default with devstack. User can still deploy apache+mod_wsgi
by setting WSGI_MODE=mod_wsgi in local.conf.
Using HEAT_USE_APACHE=False or HEAT_USE_MOD_WSGI=False
(for backward compatibility) would deploy the services
without apache.
Change-Id: Ia5e28e2987b4aeab6c049a3bde3a956204ddc5d9
Depends-On: I3b77aafc6104119503363e5db36b0379964daba5
A bunch of tests in test_signal.py with names ending in _is_cached were
added in ffddeaa934 to test that we store the
signal URL in the resource_data, by retrieving the URL twice and confirming
that only one client call is made and that the same URL is returned.
In the course of converting from mox to mock, these tests were inexplicably
changed (by 34b49cea97) to test something
completely different - I'm not sure what, but some bizarro thing to do with
convergence lightweight stacks.
This changes the tests back to their original intent.
Change-Id: I062137ce46114b653b2877c1b04a74d96625283c
This is the final patch to switch from keystoneclient to
keystoneauth.
keystoneclient's auth session, plugins,and adapter code
has been deprecated. For more information:
[1] http://docs.openstack.org/developer/keystoneauth/migrating.html
Change-Id: If8449382aeccf51587d991f55a53c43742ad7a72
It makes no sense for an exception that is used for local flow control -
especially flow control between the Resource superclass and its
subclasses - to be defined in the heat.common.exceptions module where
user-facing exceptions whose definitions must be shared between the engine
and api are defined.
This patch moves it back to the original, correct location and adds
docstrings so people will actually know what it's for.
Technically both this and the original move were breaking changes to the
third-party Resource plugin API. This exception seems much less likely to
be in widespread use than UpdateReplace (c.f. preceding patch) though.
This reverts commit 5120f096d7.
Change-Id: I73dc671cd7e6e37ecb0f13545c7fa93d58e6e8ff
Related-Bug: #1611104
In some part in the code we import objects.
In the Openstack style guidelines they recommend to import only
modules.
We need to fix that.
Change-Id: I9c7481462ac7350bddae78c0a05af1e835a282e2
Instead of using a token that we need to create every time to poll the
Zaqar queue, create a signature and use it as an authentication
mechanism.
Change-Id: Ibf9f6c334eba024f6faa7d6bb708d6d9f778ee43
Heat makes a lot of variations to the basic oslo.context which are going
to make it very hard to reuse with features added to the base
oslo.context.
There are a number of changes here that will make the heat context
options more like those from oslo.context.
*) context.user and context.tenant are IDs, not names. This will be
important for policy credentials.
*) kwargs should be passed through to base context so it can be extended
in the base class.
Change-Id: Ib0d60c6af196ba5c00459110b7a6190cff916d6f
In Python3, dict.keys() returns a view object rather than a list. This
behaves differently in that changes to the dict also modify the view, and
in that the view type interacts with various operators in different ways to
lists.
One universally correct transformation to preserve Python2 behaviour in
Python3 would be to replace all instances of d.keys() with
list(six.iterkeys(d)), and indeed we did. However, like many automatic
transformations the results are usually unsightly, invariably inefficient,
and frequently absurd. Not least because list(d.keys()) and indeed list(d)
are also equivalent.
This patch changes to using the simplest correct method of accessing the
data we want in each case.
This reverts or rewrites most of commit
4ace95ad47.
Change-Id: Iba3cf48246d8cbc958d8fb577cd700a218b0bebf
Clearing a user hook is one class of signal that never results in a need to
recalculate the stack metadata, regardless of the resource type.
Change-Id: I555794e6ad3f6ffa43969f37d35766e3556e6fbb
Closes-Bug: #1542455
This change enhances Heat wait condition resources with selectable
signal types. The token based signal is kept for compatibility, but now
the user can opt for any of the other signal types supported by the
SignalResponder class.
Change-Id: Iafc28954b743f0dc46a49d29d42e7123827930b8
Implements: blueprint uniform-resource-signals
There are some situations:
1. User can run the command "heat hook-clear" on any
resource in the stack, even if there is no hook
defined on it, and no error or warning message is returned.
2. User run the command "heat hook-clear" on resource
to clear the hook which resource unset, and no error or
warning message is returned.
3. User run the command "heat hook-clear" on resource
even if the resource's action is not support to signal, and
no error or warning message is returned.
4. User run the command "heat hook-clear" to clear invalid
hooks, and no error or warnning message is returned.
This patch will check the situations above before call
resource.signal, and will return error messages to user.
Change-Id: Ifb9befad864ebe1bb5f8b419b95d1b3a95530573
Closes-Bug: #1472515
It is convenient to have all exceptions in exception module.
Also it is reduces namespace cluttering of resource module and decreases
the number of dependencies in other modules (we do not need to import resource
in some cases for now).
NoActionRequired exception is moved in this patch.
Change-Id: Idf9bfaa8a51dd6ea679a0148c712529e3c3b072a
Note: HEAT_SIGNAL and ZAQAR_SIGNAL transports for
SoftwareDeployment don't use deploy_signal_id. Therefore they
would work without this change. However, I've changed them to
make it consistent.
This is only useful for resources that override the handle_delete
method of SignalResponder(ex. Software Deplyment). SignalResponder
`handle_delete` by default deletes the signal urls.
Change-Id: I0f0e3f8084cdeb635621cd19e873fcc350268972
PYTHONHASHSEED was set to 0 to disable hash randomization, because some
tests assertions were order sensitive. This commit is to improve the
assertions, so the PYTHONHASHSEED hack in tox.ini is not needed.
Change-Id: I4ff09d202af818d27321e8e83718e82d0c48e3d2
Closes-Bug: 1348818
This change relocates the code that creates and deletes heat, swift and
zaqar signals out of SoftwareDeployment and into SignalResponder, as a
first step in making these signals available to all resources. As part of
this change the structure of the Swift URLs was changed to match that of
the SwiftSignal resource.
Change-Id: Id5701b3696b0ab41433a3f158fabce1f36aabe16
Implements: blueprint uniform-resource-signals
This patch moves registration of GenericResource to the main test class.
There are several places, where original registration was saved:
- heat/tests/autoscaling/test_lbutils.py - need to be consist with type
names of other resources which are used in test.
- heat/tests/test_environment.py - need special type name for testing
environment mapping.
- heat/tests/test_engine_service.py - need two different types fro mapping.
Change-Id: I33bdaf3d59e573526e5ffa24086ad55be6bbe6ae
If we get repeat signals that cause no concrete actions
this can cause large quantities of senseless events that
suppress useful events.
Change-Id: I79374d27648319f241f36ab041784fab37823ddb
Closes-bug: #1445361
Classes in parser.py are already split to stack.py and
template.py, it's not recommended to import it.
Closes-Bug: #1442011
Change-Id: Ia8cc0ca07e7926fe8b7d9f5c89b39053a799e689
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
Move the resources which inherit from 'Resource'
to engine/resources, such as stack_resource,
stack_user and signal_responder, and move
non-resources to engine/, such as iso_8601.py module.
Change-Id: Ic26c34cc8d34ca03ce674dc8c6ac32c10885b75f
Implements: blueprint reorganize-resources-code-structure
Fix the HeatTestCase import issue as required by H302,
a following patch of https://review.openstack.org/#/c/129846/
Change-Id: Iab9a508682e9fe2932b7d00b191c8a4cdea4738b
Move the determination of the signal reason string inside the resource
plugin so we don't need the resource-specific details handling in the
base-class.
Change-Id: I1eec87c2063a1958eba2ad32d43474c2ed435117
Related-Bug: #1340894
i.e. stop using parser.Template
this imports the template module as "templatem" to avoid
namespace clashes with the many local variables called "template".
Change-Id: I97cc893f630e46589ee71fc73c6bbbcaa86b3a62
Raise an appropriate exception, mapped to a 400 error for signals
to resources which cannot handle signals. In this case, the request
is inherently impossible to satisfy, because the plugin doesn't
support signals, so we should alert the user to this by saying it's
a bad request (rather than the current response which is a 500 error)
Change-Id: I8e47ee94e15309f378f62f2a9f6534a4eeddb389
Closes-Bug: #1346849
Currently, we have logic in the Resource.signal base-class implementation
which works out the reason string based on knowledge of some of the
signal-handling resources. This is invariably going to be fragile, and it
won't work at all with any out of tree or contrib plugins.
So instead, move towards a model where we accept an optional return value from
handle_signal, and use that as the reason string instead. Since no resources
yet return a reason, maintain the old logic as a fallback path, until this
gets migrated into the appropriate resources.
Change-Id: I45fdf112e6cd050bb1f4111977f653ba6440df02
Partial-Bug: #1340894
Adds an argument to stub_keystoneclient such that it can be used to
clean up the stubbing in test_signal
Change-Id: I5b29b0b2dd764c735aa0da7ee8d40d867c8b4f2f
This moves the client creation code out of Clients._keystone() into
its own client plugin.
This is the last client to convert to a plugin, so supporting code
to fetch a client from a non-plugin has been removed.
In a later change it would be worth considering moving methods
in heat_keystoneclient.KeystoneClient into KeystoneClientPlugin
so that calling Clients.client('keystone') returns the actual keystone
client rather than a wrapper.
The barbican TestClient has been removed; it had limited practical
value since it mocked all of the internal calls of the method it was
testing.
Change-Id: Ie4a616d6a2b056fe59877e2bec325f02b6d7a693
This change deprecates access to methods like clients.nova()
replacing them with calls to clients.client('nova')
This allows the memoization to be done in one place (the client()
method) and also establishes the preferred API for accessing clients
that are contributed by plugins.
All calls should now be going through the new client() method.
Any calls to the old methods will result in a deprecated log
warning.
Change-Id: I3dc45aaed2655536ed1558e03f468b0733527815
Add convenience function to allow easy stubbing of keystoneclient
in all tests where explicit control and verification is not required.
This is a precursor to making all clients use the auth_token property
from keystoneclient (instead of using the context auth_token in
preference) such that trust tokens can be refreshed before expiry.
Partial-Bug: #1306294
Change-Id: I9ba4595b8750ff769e76972cc30b55a68253e76d
This patch fixes all the missed and newly introduced violations of the H306
style checking rule and enables it in tox.
Change-Id: I5566e66421d5397c0103958f02ea38e6e3c68892
Implements: blueprint reduce-flake8-ignored-rules (partial)