572 Commits

Author SHA1 Message Date
ChangBo Guo(gcb)
381a84a4e8 Remove usage of parameter enforce_type
Oslo.config deprecated parameter enforce_type and change its default
value to True in Ifa552de0a994e40388cbc9f7dbaa55700ca276b0. Remove
the usage of it to avoid DeprecationWarning: "Using the 'enforce_type'
argument is deprecated in version '4.0' and will be removed in version
'5.0': The argument enforce_type has changed its default value to True
and then will be removed completely."

Change-Id: I91b0f0a52b5ce8654702510eed76d5dea8cc8fe4
Related--Bug: #1517839
2017-05-08 17:55:32 +08:00
liyi
8f10215ffd Remove log translations
Log messages are no longer being translated. This removes all use of
the _LE, _LI, and _LW translation markers to simplify logging and to
avoid confusion with new contributions.

See:
http://lists.openstack.org/pipermail/openstack-i18n/2016-November/002574.html
http://lists.openstack.org/pipermail/openstack-dev/2017-March/113365.html

Change-Id: Ieec8028305099422e1b0f8fc84bc90c9ca6c694f
2017-03-25 17:11:50 +08:00
Luong Anh Tuan
78d1f4ccc8 Remove py26 support
As of mitaka, the infra team won't have the resources available to
reasonably test py26, also the oslo team is dropping py26 support
from their libraries. sine we rely on oslo for a lot of our work,
and depend on infra for our CI, we should drop py26 support too.

Change-Id: I103ab61e29647e5830597343c6fbbbd3b9907afc
Closes-Bug: 1519510
2017-01-23 05:52:41 +00:00
huangtianhua
27a99d537e Fix a small nit of docs
Change-Id: Ib06cc4b8ed95bbc80ab3a4fd7e03380e92ebf894
2017-01-04 11:17:21 +00:00
Jenkins
b67d76d68b Merge "Add version keyword argument to RAX glanceclient" 2016-08-15 23:55:50 +00:00
Jason Dunsmore
891298e506 Add version keyword argument to RAX glanceclient
To match the signature of the OS glanceclient _create method.

Change-Id: I19ab0b19acf3f472e249c2211f08935116548de6
2016-07-15 15:07:10 -05:00
Jenkins
8a276a4483 Merge "Fix Cloud Server image/flavor combination validation" 2016-07-13 00:34:29 +00:00
gengchc2
61bda3a08a modify the home-page info with the developer documentation
update home-page info

Change-Id: I31dc89c89fae5a8128c55802713a80c43df243ef
2016-07-29 09:34:10 +08:00
Jenkins
47262c079d Merge "Sync context with oslo.context" 2016-06-29 02:41:26 +00:00
Jenkins
baf386fde5 Merge "Correct the usage of properties.get() with default value" 2016-06-28 12:40:51 +00:00
huangtianhua
ce78ba1462 Correct the usage of properties.get() with default value
Class Properties overwrites the __getitem__ method,
1. to raise KeyError if the key is an invalid
property, then the default value is return in supper.get() method
2. if the key is a valid property, the default value won't be
returned by using the format:
  self.properties.get(key, default_value)

This patch changes to the format as following for case2:
  self.properties.get(key) or default_value

Also, if the property is required or has default value in schema,
let's use self.properties[key] instead.

Change-Id: I2f546c69aa128c9aa6240ebd065df18a799b754d
2016-06-28 08:23:05 +00:00
Dmitriy Uvarenkov
558a8cd1e8 Correct message when extension is not available
Now if extension is not available, user gets
message 'Service endpoint not in service catalog'
which is incorrect. Patch corrects this behavior
and adds improved messages with more info.

Change-Id: I9b6c0d2921519590ef105be35e31db29cd1e3ecc
2016-06-27 11:09:32 +03:00
gecong1973
7c389dd2a5 Fix some spelling mistakes in heat as follows:
in heat/contrib/rackspace/rackspace/tests/test_auto_scale.py:270:
       mock nova and glance client methods to satisfy contraints,   contraints should be constraints
   in heat/heat_integrationtests/functional/test_resource_group.py:51
       triggering validation of nested resource custom contraints,  contraints should be constraints
   in heat/heat/common/exception.py:258:
      """Keep this for AWS compatiblility."""    compatiblility should be compatibility
   in heat/heat/engine/resources/openstack/ceilometer/alarm.py:349:
      1) so we don't create watch tasks unneccessarly ,  unneccessarly should be unnecessarily

   in heat/heat/engine/resources/openstack/neutron/vpnservice.py:462:
     The Internet Key Exchange policy identifyies the authentication and , identifyies  should be identifies

   in heat/heat/engine/resources/openstack/nova/server.py:1426:
      if 'security_groups' present for the server and explict 'port' , explict should be explicit

   in heat/heat/engine/service.py:182:
     releasing the lock to avoid race condtitions. condtitions should be conditions

   in heat/heat/engine/sync_point.py:134:
       don't aggresively spin; induce some sleep, aggresively should be aggressively

   in heat/heat/tests/openstack/heat/test_software_deployment.py:889:
       Test bug 1332355, where details contains a translateable message, translateable should be translatable

   in heat/heat/tests/test_environment.py:596:
       make sure the parent env is uneffected, uneffected should be unaffected

   in heat/heat/engine/resources/openstack/nova/server.py:472:
      'ignorning it or by replacing the entire server.'),  ignorning should be ignoring

   in heat/contrib/rackspace/rackspace/resources/cloud_server.py:104:
     'retained for compatability.'),  compatability should be compatibility

   in heat/heat/engine/stack.py:1258:
      " ID %(trvsl_id)s, not trigerring rollback."),  trigerring should be triggering.

Change-Id: Ic4ddb65dbfaf61751a330b853780689209f9f4b5
Closes-Bug: #1595376
2016-06-23 12:39:48 +08:00
Jamie Lennox
87a37f5db2 Sync context with oslo.context
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
2016-06-17 11:46:00 +10:00
Zane Bitter
5566e6f2c8 Get rid of gratuitous use of six.iterkeys()
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
4ace95ad47da7099191a06325c5d0b156fd54894.

Change-Id: Iba3cf48246d8cbc958d8fb577cd700a218b0bebf
2016-06-07 03:50:49 +00:00
Jason Dunsmore
d8fefed177 Fix Cloud Server image/flavor combination validation
Custom Cloud Server images do not have the 'flavor_classes' key in
their metadata, so try to get it from the base image.  If
'flavor_classes' is empty or does not exist, skip image/flavor
validation.

Closes-Bug: #1570087
Change-Id: I44fd02c689ba0c06ba571d04e9baf0eb0ce035ff
2016-05-18 19:55:04 +00:00
Jenkins
69874fc384 Merge "Unit tests: Don't use ResourceDefinition as cfn snippet" 2016-05-16 10:49:04 +00:00
Jenkins
99074df4b2 Merge "Don't treat ResourceDefinition as cfn template in resources" 2016-05-16 07:47:14 +00:00
Zane Bitter
c64b2cd1f3 Break reference cycle in KeystoneClient plugins
Change-Id: Ie8ddd132c3ce02a01b77242ce86f219ce4f86249
Partial-Bug: #1570974
Related-Bug: #1508134
2016-05-13 11:30:22 -04:00
Zane Bitter
23cc15687b Unit tests: Don't use ResourceDefinition as cfn snippet
Eliminate from the unit tests the deprecated use of a ResourceDefinition as
if it were a snippet from a CloudFormation template, in preparation for
this being removed in future.

Change-Id: I0449d3bff19c1294a9d0a475a4a9b623c73e11db
2016-05-01 19:42:20 -05:00
Zane Bitter
f1751ae84c Don't treat ResourceDefinition as cfn template in resources
Remove the last few instances of treating a ResourceDefinition as a snippet
of a CloudFormation template (rather than using the API) in various
resources.

Change-Id: I7266385121530b76d1955e466b3d51fae860a5ee
2016-05-01 19:25:24 -05:00
Zane Bitter
f89cfcc662 Use the ResourceDefinition.Diff API in resources
Now that we have an API for determining the difference between resource
definitions in Heat, use it instead of treating the tmpl_diff argument to
handle_update() like a diff of snippets from a CloudFormation template.

Change-Id: Ib54ff610065ad8d4eabc7d6a45213fde93e425c8
2016-04-13 19:49:04 -04:00
Angus Salkeld
3ed5948b1c Set enforce_type=True on config overrides in tests
This makes sure that type checking is done by oslo.config
on the test override values.

Change-Id: Ia8c1cb55fe98e9d06b9b9ff13e5c2d25aa67bff3
Closes-bug: #1517839
2016-04-11 10:52:22 +10:00
Rabi Mishra
9305478141 Resolve name/id using translation rules for Server
This changes OS::Nova::Server resource to use
translation rules to resolve name_id properties.

As most of the tests in test_server.py and
test_rackspace_cloud_server.py are impacted by this
change, this also changes all the tests to use mock
library. Though the change is very big, it's mostly
mox to mock conversion for the tests.

This reduces the LOC drastically. Some of these test
modules have become very big to manage. We can split
them into smaller ones in the future.

Change-Id: Iaa630ab3b013dfb65e9131b1f265e846c8274037
Partial-Bug: #1514680
Blueprint: mox-to-mock-conversion
2016-03-15 16:12:27 +05:30
Jenkins
9345e1648f Merge "Use oslo.utils.reflection to extract class name" 2016-03-06 05:01:48 +00:00
Jenkins
f87c59b9c2 Merge "Add image/flavor validation to Rackspace Server" 2016-03-02 21:53:12 +00:00
Jenkins
1d6b4c8fcd Merge "remove containers on delete" 2016-03-02 04:15:53 +00:00
Jenkins
6e0b68b606 Merge "Make AutoScale sub-template a string instead of map" 2016-02-26 02:33:41 +00:00
Pratik Mallya
006db59851 Add image/flavor validation to Rackspace Server
The image and flavor used to build a Rackspace server must
satisfy certain properties to successfully build the server.
This patch adds Rackspace Public Cloud specific validation
to enable such checking so that invalid combinations are
discovered before the start of stack creation.

Change-Id: I2f676b5c06190ddc1077c13bbe3482a23d1d01fd
Co-Authored-By: Anna Eilering <anna.eilering@rackspace.com>, Jason Dunsmore <jasondunsmore@gmail.com>
2016-02-22 12:51:13 -06:00
Jason Dunsmore
c202c4447b Make AutoScale sub-template a string instead of map
To avoid the InvalidTemplateReference exception when resolving
get_resource functions for resources that are in the sub-template but
not the parent template.

Change-Id: I985b58ff95efbc7926cec708d2b37d8ce95c3390
2016-02-18 16:17:28 -06:00
Randall Burt
845dd17825 Force config_drive and transport for sw config
Ensure config_drive is enabled automatically if
the user data format is SOFTWARE_CONFIG. Also,
limit the choices for transport and format to
only those supported at Rackspace.

Change-Id: Ia8bb09d991843860a8f0cfb73453b789fde28afd
2016-02-17 14:11:45 -06:00
Bo Wang
4136b47666 Use oslo.utils.reflection to extract class name
The oslo.utils.reflection.get_class_name() handles more variations
of where a class name may come from (on) python 2 and python 3.
Its usage allows getting more accurate class names so we'd better use it.

Change-Id: Iff0e109a558d0185f126781369bac216da930bca
2016-02-16 20:04:59 +08:00
Jason Dunsmore
268e6a10d6 Add support for launch_stack launchConfiguration type
Rackspace AutoScale Groups now support a "launch_stack"
launchConfiguration type.  This adds support to the
Rackspace::AutoScale::Group resource.

Change-Id: I20d2d9d4f317d726ccbb21275984f096ba300767
2016-02-15 11:43:56 -06:00
Jason Dunsmore
3ae796a0bc Remove extraneous fields from Cloud LoadBalancer access list
This fixes a bug where the load balancer creation fails with this
error:

resource CREATE failed: BadRequest: resources.loadbalancer: Must
supply a unique access list item to update the current list. (HTTP
400)

Closes-Bug: 1541953
Change-Id: I5183b305a7bf2cef16e5e01e88fdb3f24aeb4be5
2016-02-04 11:29:17 -06:00
Jenkins
799467b08e Merge "Fix import order" 2016-02-02 04:46:06 +00:00
Bo Wang
34bc87e2c2 Fix import order
third-party lib before project imports.
refer to:http://docs.openstack.org/developer/hacking/#import-order-template

Change-Id: Ifeb38e337ac6ae5b385571284a808d51c916e6b6
2016-02-01 20:33:11 +08:00
Jason Dunsmore
adfa6fa8e1 Assign defaults for Cloud Loadbalancer node type and weight
Without these defaults, the resource can get stuck in update until the
stack times out.

Change-Id: I58a5b70959e6107eefb4351d77315c0bceb9b717
Closes-Bug: #1539230
2016-01-28 14:22:13 -06:00
Jenkins
c24dd96ade Merge "Add Rackspace::Cloud::LBNode" 2016-01-27 22:24:46 +00:00
Drago Rosson
e94c70ced3 Add Rackspace::Cloud::LBNode
This is a resource for representing a single node of a Load Balancer.
It has the ability to drain the connections off of a node before
deleting it.

Change-Id: Idfdce6c078e51f43e368a642a9c116565f3352b4
2016-01-27 13:41:14 -06:00
Rabi Mishra
29692ee4f5 Use custom find functions for image lookup
Use get interface and custom find functions to look for
images by id/name. Find interface is now implemented in
the client plugin itslef, as glanceclient v2 does not
support it. Once it's implemented in galnceclient v2,
we can leverage images.find interface directly.

This also leverges openstack.common.apicient.exceptions.

Change-Id: Ibf85495b9d5533c759c4e63284806f11e6e45413
2016-01-27 09:56:01 +05:30
Jenkins
f3232ae7d8 Merge "Make ASG resource work when no lb is specified" 2016-01-26 17:32:25 +00:00
Pratik Mallya
8107f1ebfd Make ASG resource work when no lb is specified
Change-Id: I0a5a2b62ad1a81f0201d6cd8202bd6e11f7c569c
Closes-Bug: #1535778
2016-01-19 14:15:40 -06:00
Oleg Khavroshin
1f6ccf85e3 Edit backslashes for lines continuation
It is preferred to wrap long lines in parentheses and not a backslash
for line continuation due to OpenStack Style Guidelines
http://docs.openstack.org/developer/hacking/#general, paragraph 2

Change-Id: Ibfc1022f8e4704fe2040e63bb87322404cea35a4
2016-01-19 10:05:34 +00:00
Jenkins
809cd7b668 Merge "Using LOG.warning replace LOG.warn" 2015-12-30 08:27:05 +00:00
LiuNanke
208d2debd0 Using LOG.warning replace LOG.warn
*Python 3 deprecated the logger.warn method, see:
*https://docs.python.org/3/library/logging.html#logging.warning
*so we prefer to use warning to avoid DeprecationWarning.

Change-Id: I07ee9c97c3548c965aaf83d34b37b23e9baba584
2015-12-29 09:32:42 +00:00
Jenkins
7e521c12a0 Merge "Support RackConnect V3 LB in Rackspace AutoScaleGroup Resource" 2015-12-23 03:41:45 +00:00
Jenkins
b53fa07c93 Merge "Use flavors.find interface to find flavors" 2015-12-22 11:14:43 +00:00
Pratik Mallya
58624d4f1c Support RackConnect V3 LB in Rackspace AutoScaleGroup Resource
Currently, only Rackspace CloudLoadBalancers are supported by
the ASG resource.

Also update the requirements to use fork of pyrax that is
maintained by the Rackspace heat team.

Closes-Bug: #1525391
Change-Id: Iabb52b2a34f1c2a434e724b9a70e4b948e4d0d37
2015-12-17 15:07:49 -06:00
Ankit Agrawal
aa3d01e0a0 Remove duplicate keys from dictionary
There are a few places where duplicate keys are defined in the
dictionary. Removed all such occurrences throughout the code.

TrivialFix

Change-Id: I40cd400b26745927698584a8376971f9884acbf8
2015-12-16 22:19:04 -08:00
Rabi Mishra
c3a8cc4197 Use flavors.find interface to find flavors
This patch uses 'flavors.find' to look for flavors rather than
finding them from 'flavors.list' output.

Change-Id: I48b058a6b01d941d2e0f362900d0c85bc7c71fbc
2015-12-16 17:14:29 +05:30