220 Commits

Author SHA1 Message Date
Steven Hardy
f9d9fae233 tests add stub_keystoneclient to base test class
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
2014-06-18 10:55:41 +01:00
Jenkins
51be0dea77 Merge "Add AllowedValues constraint to Rackspace::Cloud::LoadBalancer" 2014-06-17 19:51:54 +00:00
Zane Bitter
ead7117331 Unit tests: Always use ResourceDefinition for updates
Change-Id: I85ab9d0a3ed824020c7a38f7a814e7755a437b1a
2014-06-16 11:05:24 -04:00
Steve Baker
97720037c2 Assume compute service_type for nova client
This change removes the ability to specify a non-compute service
type when requesting a nova client. The only non-compute service
type actually requested was the fallback path for cinder. However
nova volumes was completely removed from nova in grizzly, so we
do not need to support this any more.

Change-Id: I9e15f31979d44f018db69ebc8109f707b0f51671
2014-06-16 09:57:11 +12:00
Jenkins
1a68cd8880 Merge "Support of regional endpoinds using Keystone v2" 2014-06-13 04:39:47 +00:00
Jenkins
9d9c6f59a0 Merge "Check that personality is provided before iterating" 2014-06-11 10:11:54 +00:00
Randall Burt
f5cb0ecb13 Add AllowedValues constraint to Rackspace::Cloud::LoadBalancer
The Rackspace Cloud Load Balancer service only allows certain
values for the algorithm property. This patch adds constraints
so that users get validation feedback prior to creating the
resource.

Closes-Bug: #1328654
Change-Id: Id24b426b1d3e49b09b3e468ea9e9675c05eaa160
2014-06-10 17:21:25 -05:00
Jenkins
b38752beb9 Merge "Implement caching of resource attributes" 2014-06-10 20:28:26 +00:00
Jenkins
0261c144e4 Merge "remove default=None for config options" 2014-06-10 14:31:33 +00:00
Zane Bitter
ff76cbd6d8 Unit tests: Create resources with ResourceDefinition
Stop creating Resources with dicts that are snippets of templates, and
instead always use ResourceDefinition objects to create Resources.

Change-Id: I1587f1edf9b04f06bd435857d7c1ea2c1cc26058
2014-06-05 13:45:14 -04:00
Fabien Boucher
e7d3454c2d Support of regional endpoinds using Keystone v2
Handles the configuration region_name_for_services
with the keystone V2 authentication.

Change-Id: Ibba4d617937da8ba6018471e9614259e90409a47
2014-06-02 18:58:13 +02:00
Anderson Mesquita
2606bc6ec6 Add OS:Barbican:Order resource
This adds a Barbican Order resource to contrib plugins allowing
orders for secrets to be issued using barbican's infrastructure.

Implements: blueprint barbican-resources
Change-Id: I8c9bc4bc2c1fecc9c3a5263af74e739dd9eea2ab
2014-05-30 09:28:07 -04:00
Richard Lee
9777be8f37 Add OS:Barbican:Secret resource
This adds a Barbican Secret resource to contrib plugins allowing secrets
to be created using barbican's infrastructure.

Co-Authored-By: Anderson Mesquita <andersonvom@gmail.com>
Implements: blueprint barbican-resources
Change-Id: Ie9d345b8a1186cd9e00f6a083652f4f0466e94c3
2014-05-30 09:20:34 -04:00
Jenkins
9e01f480d4 Merge "Unit tests: remove resolve_runtime_data() call" 2014-05-30 07:39:49 +00:00
Steve Baker
ab412fee30 Implement caching of resource attributes
The default caching mode cache_local will return the previously
resolved value if it is available.

Whenever any resource changes state, all resource attribute caches
are cleared just in case the state change has side-effects in
other resources.

The caching mode cache_none performs no caching, and is chosen
for attributes which are one of the following:
* Derived from any resource's metadata, resource data or resource_id
* An API call which returns a secret

Caching currently only exists for the duration of the parser.Stack
object, but there is future potential for a caching mode which
caches attributes spanning multiple requests.

Closes-Bug: #1321970

Change-Id: I01bf2983b726f0e81a2b8d5be94627353bdeb406
2014-05-30 13:14:27 +12:00
Jason Dunsmore
67567e2c7c Check that personality is provided before iterating
Change-Id: I3453dee8ce3ec1fd7fba9de16c82f9a6788a7be2
Closes-Bug: #1324619
2014-05-29 12:08:45 -05:00
Christian Berendt
105a806493 all non debug log messages should be translated
Updated a set of files to add missing translation support in the
log messages.

Change-Id: I58d561c5e1ecff550483ee0be696999e927c98ad
Partial-Bug: #1321283
2014-05-29 11:11:46 +02:00
Jenkins
8d080373e4 Merge "Replacing variable logger on LOG" 2014-05-28 16:57:25 +00:00
Jenkins
57fac39bc4 Merge "All resources to use Schema update_allowed" 2014-05-28 09:49:47 +00:00
Christian Berendt
ca1ea053e4 remove default=None for config options
In the cfg module default=None is set as the default value.

Change-Id: Idb78d3e25c79aba0d74fdd747efe2e17b6faa129
Closes-Bug: #1323975
2014-05-28 09:29:30 +02:00
Jenkins
855340570f Merge "Fixes personality support in Rackspace ASG resource" 2014-05-28 03:50:45 +00:00
Zane Bitter
95e4b7c548 Unit tests: remove resolve_runtime_data() call
This was accidentally reintroduced after a merge conflict.

Change-Id: Ibae58aae1520d8f934b59eb9dae6979d95a0a312
2014-05-27 22:18:41 -04:00
Sergey Kraynev
ecd8d3999d Replacing variable logger on LOG
Commit https://review.openstack.org/#/c/94255/1 introduces check for
translating log messages. This check uses in pattern name 'LOG', so in
heat code also should be used this name intead of 'logger'. Also same
name is used in other projects.

Change-Id: Iba24c7eb1c13e68a91d090d7bcdbcb40d6e16071
Partial-Bug: #1321283
2014-05-27 15:48:33 -04:00
huangtianhua
2e2c01bcf8 Migrate to glanceclient to get image id
We should call the glanceclient to get_image_id instead novaclient.

Implements: blueprint migrate-to-glance-client
Change-Id: I2f5e4dfbe405b1ac74eb3864870b8e4873aeee9a
2014-05-27 14:46:37 +08:00
Steve Baker
42410ddbfd All resources to use Schema update_allowed
No in-tree resources now use the property update_allowed_properties

Change-Id: I63bb9b5c3fab6f898619cddc3f64f00820fe4f12
2014-05-27 13:18:31 +12:00
Chris Roberts
df1aa8281d Fixes personality support in Rackspace ASG resource
The Rackspace ASG API expects server personality to be defined
as an Array of dicts. It was being passed as a flat dict which
caused all creations of ASG resources to fail if a personality
was defined.

Change-Id: Idf0c1e8898a613f9b979312e080200dcc28cc7e9
Closes-Bug: #1322675
2014-05-23 11:20:25 -07:00
Pavlo Shchelokovskyy
50ff4ec2fe Order imports in alphabetical order (9/9)
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)
2014-05-22 16:49:51 +03:00
Jenkins
61290febf7 Merge "Refactor neutron resources lookup" 2014-05-22 08:43:27 +00:00
Jenkins
41a0108dd9 Merge "Make attributes definition similar on properties" 2014-05-22 00:42:57 +00:00
Jenkins
5115246885 Merge "Using new attribute schema for all resources" 2014-05-22 00:42:49 +00:00
Pavlo Shchelokovskyy
a13ab4d35d Refactor neutron resources lookup
This patch moves new neutron resources resolution methods
of basic neutron resource to a separate module neutron_utils
(similar to nova_utils) for easier usage in other parts of the code.

Change-Id: Ifb2e103e6b66dd021e24eb48c816b8c46da921e1
2014-05-20 19:42:40 +03:00
Jenkins
42acc9d175 Merge "Remove update_allowed_keys definition and usage" 2014-05-19 21:25:22 +00:00
Thomas Herve
65e068557d Remove update_allowed_keys definition and usage
The update_allowed_keys attribute didn't really define any useful
policy, and prevented automatic update which should be handled by the
base Resource class like DeletionPolicy. This patch removes the usage
and the various definitions around the code base.

Change-Id: I78494aba07b6badeca8e95f1875ca8e4b9b0290c
Co-Authored-By: ala.rezmerita@cloudwatt.com
Partial-Bug: #1316171
2014-05-16 10:04:07 -04:00
Christian Berendt
94920c5551 debug level logs should not be translated
According to the OpenStack translation policy available at
https://wiki.openstack.org/wiki/LoggingStandards debug messages
should not be translated. Like mentioned in several changes in
Nova by garyk this is to help prioritize log translation.

Change-Id: I770dfc2fd474123a8ccc37311ef69d0c03e85545
Closes-Bug: #1318713
2014-05-14 21:28:27 +02:00
Sergey Kraynev
2d31330ade Make attributes definition similar on properties
Current attributes_schema contains hard codeded names of attributes.
This patch replaces all hard coded names on variables defined in
ATTRIBUTE tuple.

Change-Id: I1ea7b33bd598dba07f2190c282497c573463b0dd
Partial-Bug: #1307319
2014-05-14 03:52:22 -04:00
Sergey Kraynev
e01251b605 Using new attribute schema for all resources
Currently resources use old style of attribute schema. For example:

    attribute_name: _('Description')

This patch contains changes to migrate for new attribute Schema class.
For example:

    attribute_name: attributes.Schema(_('Descriprion'))

Partial-Bug: #1307319

Change-Id: I54c7b9d481655b0051d0f7ff668672011ac882e9
2014-05-12 05:22:43 -04:00
Rabi Mishra
4bf2a1fad2 Provides ability to reference existing neutron resources
Additional properties 'network' and 'subnet' are added to
the resources (existing properties 'network_id' and
'subnet_id' are deprecated). 'network'  and 'subnet' can
now carry name or id. Pre-existing neutron resources
can now be referenced in heat templates by their name
and not necessarily by their UUID. This would help porting
templates across deployments.

Change-Id: I644f5d6ee2e5ccabde190bd73eacc71daaf41f4d
Closes-Bug: #1286128
2014-05-09 13:54:50 +05:30
Jenkins
11c99d7b06 Merge "Don't use SSH in Rackspace::Cloud::Server" 2014-05-07 02:54:58 +00:00
Jenkins
aca822a7a1 Merge "Deprecate Stack.resolve_runtime_data()" 2014-05-06 11:54:02 +00:00
Jenkins
90b24b01b2 Merge "Add a Nova Flavor resource." 2014-05-05 23:29:06 +00:00
Jason Dunsmore
285f2cbc28 Don't use SSH in Rackspace::Cloud::Server
Rackspace Cloud Servers now supports config drive and the Rackspace
images have cloud-init installed by default, so we no longer have to SSH
to the Cloud Server to install dependencies and run the user-data
script.

Closes-Bug: #1298050
Change-Id: I5cb6a93c5b34b0a8cfe7480211da70d65638de54
2014-05-05 12:15:45 -05:00
Zane Bitter
b8cb6ed087 Deprecate Stack.resolve_runtime_data()
This no longer needs to be done in the context of a stack, because all of
the required context is embedded in the lazily-evaluated functions at the
time they are parsed into Functions. Reduce confusion by eliminating all
uses of it and marking it as deprecated.

Change-Id: I9d89b5201df5b05d03a295eaf6605da65397f565
2014-05-02 21:51:01 -04:00
Zane Bitter
062b5e99ca Unit tests: tidy up resolve_runtime_data() calls
It's not clear whether these were ever needed or just cargo-culting, but
they are definitely not doing anything now.

Change-Id: I9dd409332a93e39640da93a22cf7d3c676f398ac
2014-05-02 21:51:01 -04:00
Dimitri Mazmanov
60f07fbdac Add a Nova Flavor resource.
This will allow using more fine-grained specification of computational
resources (RAM, CPU, disk, etc.).

A nova flavor resource has the following format:

  heat_template_version: 2013-05-23
  description:  Heat Flavor creation example
    resources:
      test_flavor:
        type: OS::Nova::Flavor
        properties:
          ram: 1024
          vcpus: 1
          disk: 20
          swap: 2

Change-Id: I79812f0ef0d0dc616ccb3361e9b5864faa877df1
Implements: blueprint dynamic-flavors
2014-05-02 20:47:35 +02:00
Jenkins
c83d6c2a83 Merge "Remove unused logger" 2014-05-02 16:09:27 +00:00
Steven Hardy
d75324646c tests remove stack_delete_after decorator
This is no longer required because cleanup is provided via reset
of the dummy db in all tests which call the base-class setUp.

Change-Id: I49cbfce0b2880d0318114df35d4abaed61d03bfc
2014-04-30 16:14:59 +01:00
Jenkins
ff3e5b9c97 Merge "Port all resources to new resource data methods" 2014-04-30 10:02:11 +00:00
Jenkins
e4f829671c Merge "tests make dummy db setup/reset consistent" 2014-04-29 09:23:40 +00:00
Steven Hardy
93d9594d7a tests make dummy db setup/reset consistent
Move the setup/reset of the dummy DB into the test common base-class,
which ensures the setup/recent happens consistently (some tests setup
but then don't reset for example), and ensures there's always a clean
dummy DB per test.

Change-Id: I8e3bdd23399cb0d1d3c93daae66e6509b12b4e72
2014-04-28 14:17:33 +01:00
Steve Baker
9bd4f3fcc5 Port all resources to new resource data methods
Change-Id: I9f7e984f5224cee16a2ffd3e9d6b118304766701
Related-Bug: #1306743
2014-04-28 17:01:28 +12:00