Commit Graph

273 Commits

Author SHA1 Message Date
Jenkins
442e79b559 Merge "Switch heat resources & db & tests to oslo.i18n" 2014-09-19 04:23:49 +00:00
Jenkins
736484b238 Merge "Add user data and config drive properties" 2014-09-18 07:26:18 +00:00
Ethan Lynn
6d0cd62172 Switch heat resources & db & tests to oslo.i18n
Use oslo.i18n in resources & db & tests directories.

blueprint oslo-i18n

Change-Id: Idaf718b9d762b9ae89d6045557eadb758b552bd5
2014-09-17 14:28:56 +08:00
Jenkins
ab7f642844 Merge "Replace marconi by zaqar in heat plugins" 2014-09-14 03:31:28 +00:00
Randall Burt
e685af1d0e Add user data and config drive properties
Added these missing properties and upgraded the client
library requirements to support them. This upgrade breaks
Swift compatability, but we don't need to override that
client any more anyway, so client registration for
Swift-via-pyrax is also removed.

Change-Id: I8e07092adf58da2a39330789fb170986176f47e3
Closes-Bug: 1336498
2014-09-08 18:31:35 +00:00
Jenkins
eca7ad1c21 Merge "Improve docker resource deletion" 2014-09-04 18:48:57 +00:00
Jenkins
af1de565ab Merge "Fix a wrong argument name at Heat keystoneclient plugin" 2014-09-04 07:16:42 +00:00
Hongbin Lu
0224f0d0a3 Fix a wrong argument name at Heat keystoneclient plugin
After this fix, the Heat keystoneclient plugin should pick up
the right region to authenticate.

Change-Id: I9bb5fe5fd767997b4118cf674a17de9f8be503fe
Closes-Bug: #1213291
2014-09-03 03:21:48 +00:00
Jenkins
c9422ccd42 Merge "correctly implement volumes_from property" 2014-09-02 17:31:08 +00:00
Pierre Padrixe
8307f1e075 Replace marconi by zaqar in heat plugins
Change-Id: I9eb68c27e79782f0da0d9a79bf231e09f2f679bc
2014-09-02 11:36:08 +02:00
Jenkins
c6198872e7 Merge "Fix marconi plugin registration" 2014-09-01 18:56:15 +00:00
Lars Kellogg-Stedman
03638b3e73 correctly implement volumes_from property
The Docker plugin incorrectly implements the 'volumes_from' option:

- The property is marked as a string when it should be a list, and
- The property needs to be passed to start_container rather than
  create_container.

Change-Id: I617a4d29a9edbb45d80c7b8abb8f87eeaf795a8b
closes-bug: #1364041
closes-bug: #1364039
2014-09-01 11:34:52 -04:00
Randall Burt
d80c73f375 Fix marconi plugin registration
Add client plugin registration and fix packages and
files section.

Closes-Bug: 1363148
Change-Id: Ide5467bf622262d5c0deceaad2270068b8b3e3db
2014-08-29 12:51:31 -05:00
Jeff Peeler
ebc6cd9a26 Improve docker resource deletion
handle_delete and check_delete_complete were not handling NotFound
exceptions

Change-Id: I6e8100ff37157f6a06837307cea31af66a3403af
Closes-Bug: #1296758
2014-08-29 09:19:55 -04:00
Jeff Peeler
69c662ac24 Rename docker directory to heat_docker
This directory was renamed in 4e8231, which made importing docker
(that is docker-py) difficult if not impossible in Python 2.x. So
rename it to something other than 'docker' to avoid that problem.

(setup.cfg has been modified with the new path)

Change-Id: I3cbb7c5d4b53f70e1dc6102881f8e05852341a9a
Related-bug: #1296758
2014-08-28 23:42:24 -04:00
Jenkins
b630251b28 Merge "Use the template module to access the Template class" 2014-08-28 13:24:04 +00:00
Randall Burt
6a9a6a07ef Allow for setting ViP ID
Allows the user to specify the id of an existing
virtual ip rather than create a new one. This
allows devices listening on different ports using
the same ip addresses.

Change-Id: Ieba48abc0470cc5b596245efa51e9919ef37e0ca
2014-08-26 21:42:50 +00:00
Angus Salkeld
ff45aba3c4 Use the template module to access the Template class
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
2014-08-21 12:53:45 +10:00
Thomas Herve
5760718ba5 Remove resource_id_set(None) calls
This removes resetting resource_id in delete, as the state is storing
that information properly, and it doesn't provide any additional value.

Change-Id: I71f17ab79adbad5286389c87f1fbd5c60c4a8d7f
Closes-Bug: #1358492
2014-08-19 11:30:32 -04:00
Steve Baker
fd191b7e48 Implement barbican client plugin
This moves the client creation code out of a Clients subclass into
its own client plugin.

Barbican is not an integrated project so the plugin is not registered
if barbicanclient cannot be imported.

The code which prevented client errors in _resolve_attribute from being raised
has been removed. This will prevent invalid attribute values from being
memoized.

The base package has been renamed to heat_barbican since stevedore
is used for client plugin loading and the base package will be
installed by setuptools, the package barbican might clash with
the actual Barbican project.

Change-Id: I5788fb4618fef0d1c3e39cc98094bb2813e842c5
2014-08-13 20:12:29 -05:00
Steve Baker
23893088f1 Implement marconi client plugin
This moves the client creation code out of a Clients subclass into
its own client plugin.

The base package has been renamed to heat_marconi since stevedore
is used for client plugin loading and the base package will be
installed by setuptools, the package marconi might clash with
the actual marconi project.

Change-Id: Ie824d961fcfa9dafd72cc40ccf207d1c1e0501ad
2014-08-13 20:12:29 -05:00
Steve Baker
1a44187fdf Port rackspace clients to client plugins
This change converts the rackspace client code to be contributed
via client plugins. This is the last change required for all in-tree
clients to be contributed via plugins.

A RackspaceTest base class which adds the rackspace directory
to the client plugins path which ensures any rackspace variants
are loaded. Plugin loading precedence is used to ensure rackspace
versions will override core plugins with the same name.

The nova plugin will fallback to returning the core nova client
so that CloudServersTest will run even when pyrax is not installed.

The cloud_backed configuration option will no longer have any effect
on whether rackspace clients will be loaded. Instead they will be loaded
by stevedore via the setup.cfg heat.clients entry point.

Change-Id: I312de40064cc00896dba1835117ff67003e57938
2014-08-13 20:12:29 -05:00
Steve Baker
0eb93cbf33 Use setuptools to install contrib plugins
This change creates a pbr setup.cfg and specifies a data_files
entry to install the contrib plugin source into the /usr/lib/heat
plugin directory.

This change also temporarily disables docs building for contrib
resoures until the transition to stevedore is fully complete.

Change-Id: I1c91aee20f72dc2a5a049e67de1d6d7cbabda241
2014-08-13 20:12:29 -05:00
Steve Baker
60e6eeb075 Move nova_utils functions to nova client plugin
All uses of nova_utils functions have been migrated to using
the nova client plugin version.

Existing functions now have a deprecation warning which is
suppressed during nova_utils unit tests.

nova_utils.get_flavor_id was being called with the trove
client, so there is now a dedicated trove plugin method
get_flavor_id.

Change-Id: Ic8120022a1f9117c783f6422069f94614bcbb3c6
2014-08-13 20:12:29 -05:00
Steve Baker
93c8dc9b54 Neutron use ClientPlugin.ignore_not_found etc
Change-Id: Ie1e75ac1537a8c0d800e4e381eac9f866576bb9d
2014-08-11 17:29:38 -05:00
Steve Baker
98003258a8 Nova use ClientPlugin.ignore_not_found
Change-Id: I6be9c3d46c3c763468b6e9eb2250eecfd6308c79
2014-08-11 17:27:50 -05:00
Pavlo Shchelokovskyy
3d65dba163 Improve mocking in HeatTestCase
As the mock lib is going to be used more actively, there is a need
to improve our boilerplate code in respect to mock.

Changes in this patch include:
* `patchobject` now accepts kwargs and passes them to `mock.patch.object`;
* added `patch` method that uses mock.patch (similar to `patchobject`)
  - NOTE: this shadows `testtools.TestCase.patch` method that uses
    simple monkey-patching in favor of mock-based patching,
    relevant comment added in the code;
* test code changed accordingly where needed.

Change-Id: I779cab63249d5eb1962e9ec388cd31f3df4a4189
2014-08-07 11:41:47 +03:00
Christian Berendt
58e141b2ac replace dict.iteritems() with six.iteritems(dict)
According to https://wiki.openstack.org/wiki/Python3 dict.iteritems()
should be replaced with six.iteritems(dict).

Change-Id: I9e2881a006433c8b44a3caccebc73bae4973a041
2014-08-06 10:56:09 +08:00
Ethan Lynn
10a00d3ee4 Replace str() with six.text_type() where exception is used
When switching to oslo.i18n, tests where used str(exc) will failed
with unicodeerror, so before switching to oslo.i18n, need to
replace str with six.text_type where exception is used. And it's
recommanded to use six.text_type instead of str in openstack.

Change-Id: Ie37a6ef74a12b2580ce72afc75c99bcd19d4cf97
2014-07-29 10:34:26 +08:00
Jenkins
96b8a3f078 Merge "Move glance_utils functions to glance client plugin" 2014-07-24 13:56:18 +00:00
Jenkins
0767d679a6 Merge "Use config region_name_for_services for rackspace clients" 2014-07-24 09:54:15 +00:00
Randall Burt
b97f694479 Don't resolve attributes before create
Change-Id: Idf0120b8c7fb46300462720136002bc7d7d68d31
Closes-Bug: #1332317
2014-07-21 14:27:49 -05:00
Steve Baker
956632844a Move glance_utils functions to glance client plugin
The glance client plugin is a more obvious home for this sort
of function, and this change makes mocking of these functions
much easier since a mocked client is no longer needed.

To access the methods defined in the client plugin the method
Resource.client_plugin has been added. When all clients are
contributed by plugins then method Resource.client will call
Resource.client_plugin.

glance_utils can be deleted since it was only added at the
beginning of the Juno cycle.

The image constraint has also been moved to the glance plugin.

Change-Id: Id31ccd605411ca034addc67d8aadf7cea0904bfd
2014-07-21 13:00:26 -04:00
Steve Baker
09b31c1d0d Use config region_name_for_services for rackspace clients
This deletes the region_name configuration option and replaces
uses with region_name_for_services.

There is no need for a different configuration option
for rackspace clients.

Change-Id: I6866026a0b9a1895b9b062e9c49e0fe54ec8e831
2014-07-21 13:00:26 -04:00
Jenkins
8e528802a4 Merge "Implement keystone client plugin" 2014-07-17 23:38:49 +00:00
Jenkins
3fdec85435 Merge "Expose recent docker features in the resource" 2014-07-17 12:58:02 +00:00
Thomas Herve
6906fd12b6 Expose recent docker features in the resource
This adds the name, port_bindings and links properties to the docker
container resource which are passed to container creation and start.
This also removes properties which were never implemented.

Change-Id: I7320e3a95895b894cc53ebb77ebb220482f990c1
2014-07-17 07:50:12 +02:00
Steve Baker
bd4317e7b9 Implement keystone client plugin
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
2014-07-17 10:16:14 +12:00
Steve Baker
7d3111f941 Implement neutron client plugin
This moves the client creation code out of Clients._neutron() into
its own client plugin.

Neutron is an integrated project, and python-neutronclient is a dependency,
so the import is now mandatory. Also any conditional code which skipped
if the neutron client was missing has been removed, since the presense or
absense of an installed neutronclient has no bearing on whether neutron
is installed on a given cloud.

Change-Id: Id9fdc50e80efe78731e21934ed9f2704cc3eb408
2014-07-09 08:45:29 +12:00
Steve Baker
9e58745627 Implement glance client plugin
This moves the client creation code out of Clients._glance() into
its own client plugin.

Glance is a core project, and python-glanceclient is a dependency,
so the import is now mandatory.

Change-Id: If61f2510344bf67b7e9aded1dc9d9cedf2426228
2014-07-09 08:26:58 +12:00
Steve Baker
9850832da5 Implement nova client plugin
This moves the client creation code out of Clients._nova() into
its own client plugin.

Raising nova exceptions has been moved to
heat.tests.v1_1.fakes.fake_exception since it is actually impossible
to directly create a nova exception object which works on both
novaclient 2.17 and (yet to be released) 2.18.
nova.exceptions.from_response is stable across novaclient releases
so all test exceptions are now raised using from_response.

Change-Id: Id68ff32c381c9c8c06f3712736d1888d1d0e8110
2014-07-08 09:42:36 +12:00
Jenkins
b7d624e84c Merge "Fix docker volumes binds issue" 2014-07-04 23:09:58 +00:00
Jenkins
784770366c Merge "Implement Flavor Extra-specs Key/Value Pairs" 2014-07-04 17:48:17 +00:00
Jenkins
706f7289fa Merge "Deprecate direct access to clients methods" 2014-07-03 10:37:37 +00:00
liu-sheng
5541f43903 Use None instead of mutables in method params defaults
Mutables in the method params defaults might cause errors and
that's why it's anti-pattern in most of the cases and should be
removed.

Change-Id: I8bc284f12ce72082a0482410ec2c20c2fc087a4b
Closes-Bug: #1327473
2014-07-02 16:33:12 +08:00
Ethan Lynn
d1f513a208 Implement Flavor Extra-specs Key/Value Pairs
Add flavor set_keys function to nova_flavor resource.

Change-Id: I5d46ace4d729a2c4a1b136265b146417e7ad2812
2014-07-02 15:07:12 +08:00
Steve Baker
09d9683ee7 Deprecate direct access to clients methods
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
2014-07-01 16:51:20 +12:00
Jenkins
089f7f0b9d Merge "Account for differences in Rackspace Cloud Glance" 2014-06-26 21:05:59 +00:00
Jenkins
0a8d16ac39 Merge "Update to latest version of pyrax and add Swift support" 2014-06-26 21:05:52 +00:00
Steve Baker
cc980d730e Prevent "No handlers could be found..." logging
To prevent this message from being logged during unit tests runs
or heat-manage calls, the following changes have been made:
* Make the instance_users deprecation warning use "warnings" and
  move to engine init
* patch out warnings for engine tests
* do not log barbican or marconi if importing their clients fails

Change-Id: Icc4be26bf334a6ce31ad3b8fe9fd244cd9e37be2
Closes-Bug: #1333408
2014-06-24 17:07:21 +12:00