1779 Commits

Author SHA1 Message Date
Eli Qiao
d802877e6e Improve tox.ini to easy developer's life
This patch is mainly porting from nova repository:

Adds:
1.tools/flake8wrap.sh
  Will let developer use 'tox -epep8 -- -HEAD' to testing changes files
2.tools/pretty_tox.sh
  Give pretty test trace when doing unit/functional testing.

Change-Id: Icedb4ed8b50532531e18784a1584fe63c5a9e017
2015-11-03 17:44:38 +08:00
Bertrand Lallau
798c7e35ef Use assertIn and assertNotIn
Tests should use:
  self.assertIn(value, list)
  self.assertNotIn(value, list)

instead of:
  self.assertTrue(value in list)
  self.assertFalse(value in list)

because assertIn and assertNotIn raise more meaningful errors:
  self.assertIn(3, [1, 2])
  >>> MismatchError: 3 not in [1, 2]

  self.assertTrue(3 in [1, 2])
  >>> AssertionError: False is not true

Closes-Bug: #1510007
Change-Id: If33252cc93c06a85e61871fb7b22b726f4a08500
2015-11-02 22:35:04 +01:00
Jenkins
a930ac216b Merge "Use assertIsInstance instead of assertTrue(isinstance(a, b))" 2015-11-02 19:49:00 +00:00
Jenkins
cb05f01325 Merge "Improving comment in monitors.py" 2015-11-02 19:41:14 +00:00
Manjeet Singh Bhatia
577688dc93 Improving comment in monitors.py
This patch will improve the comment below abstract method pull_data
which can be defined for pulling data from bay and pod as well but
comment says bay only.

Change-Id: I86cb822dc72bc9805d2c38405012206991110438
2015-11-02 17:20:39 +00:00
Jenkins
912aef4e44 Merge "Avoid JsonPatch twice" 2015-11-02 07:45:15 +00:00
Jenkins
b87c1a2096 Merge "Add bay filter to container" 2015-11-02 05:55:10 +00:00
wangqun
87d6056846 Use assertIsInstance instead of assertTrue(isinstance(a, b))
Developer should use assertIsInstance to replace the
assertTrue(isinstance(a, b)).

Closes-Bug: #1510384
Change-Id: I70f68a5810a6797c7b7e112b46ef2463907bba3e
2015-11-02 04:09:47 +00:00
Hua Wang
b1e16a6cc5 Avoid JsonPatch twice
apply_patch will convert patch parameter into JsonPatch, so we don't
need to do it. If we do, the parameter is JsonPatched twice.

Change-Id: I9f01089ee5f9a25c27d531ee60dc60a9c472c7fe
Closes-Bug: #1512206
2015-11-02 11:30:31 +08:00
wangqun
082c8ed0b8 Use assertIsNotNone instead of assertEqual(** is not None)
Developer should use assertIsNotNone to replace the
assertEqual(** is not None).

Closes-Bug: #1510371
Change-Id: I5afd03aaf591e047b855bc416bc60fbc182bdc19
2015-10-30 04:33:40 +00:00
Jenkins
8066e2b6e8 Merge "Updated from global requirements" 2015-10-30 04:26:21 +00:00
Bertrand Lallau
2eea193d77 Use assertTrue/False instead of assertEqual(T/F)
The usage of assertEqual(True/False, ***) should be changed to a more
meaningful format of assertTrue/False(***).

Closes-Bug: #1510001
Change-Id: Ia16af467d5f5bfca029002d9d261540947b0be92
2015-10-29 11:17:01 +01:00
Jenkins
07a7dea318 Merge "Use assertIsNone instead of assertEqual(None, ***)" 2015-10-29 01:44:15 +00:00
OpenStack Proposal Bot
279e874214 Updated from global requirements
Change-Id: Ifcbd8d52d34bad822e188a786602b289bef2a3ab
2015-10-28 22:06:30 +00:00
Bertrand Lallau
e97f70788c Use assertIsNone instead of assertEqual(None, ***)
Instead of using assertEqual(None, ***), developers should
use assertIsNone(***) to have more clear messages in case of failure.

Closes-Bug: #1510006
Change-Id: Ib3d09ed651877569a9b940da97662489885f18e9
2015-10-28 17:38:13 +01:00
Hua Wang
53c5542a33 Add bay filter to container
Add bay filter to container, so that we can filter containers by bay_uuid.

Change-Id: Ie48757df37c1859211d775282cfcee82fe4fc9f8
Partially-Implements: blueprint filter-resource-by-bay
2015-10-28 09:55:56 +08:00
Jenkins
aa77814f50 Merge "Update devstack doc to cover the latest atomic image" 2015-10-27 02:12:43 +00:00
Jenkins
1af5878447 Merge "Use oslo_config IPOpt support" 2015-10-27 01:34:57 +00:00
Jenkins
58718e78ad Merge "Fix argument order in assertEqual to (expect, obs)" 2015-10-27 01:22:06 +00:00
Bertrand Lallau
6b97b9a7cd Fix argument order in assertEqual to (expect, obs)
assertEqual expects that the arguments provided to it should be
(expected, observed). If a particular order is kept as a convention,
then it helps to provide a cleaner message to the developer if Unit Tests
fail. There are several Unit Test files where the arguments for assertEqual
have been swapped.

Closes-Bug: #1259292
Change-Id: I17930c8ba8168baba9baddbdb7a54d54497f6a6d
2015-10-26 21:01:02 +01:00
Bertrand Lallau
19f50e1cdc Use oslo_config IPOpt support
The oslo_config library provides IPOpt type.

Closes-Bug: #1510004
Change-Id: I8f8c69e81a8cca63222da97bcede00bd31c92c8d
2015-10-26 12:03:03 +01:00
wenchma
a5df0e56b0 Update devstack doc to cover the latest atomic image
Change-Id: Ie142a190b9771ffe7d0512a6d49e5c56c90e0f69
Closes-bug: #1507972
2015-10-26 14:59:37 +08:00
Hua Wang
58a7e1b8bc Remove unnecessary parameter
Remove unnecessary parameter from detail and get_all in api.

Change-Id: I2c6284a7b0574f2a3a12f299ba966c2241b5df7b
Closes-Bug: #1509162
2015-10-26 09:39:34 +08:00
Jenkins
23a5d63a22 Merge "Kubectl configuration for certificates" 2015-10-25 14:40:23 +00:00
Jenkins
49fa18aef6 Merge "Fix exception when create bay failed" 2015-10-25 14:32:53 +00:00
Vilobh Meshram
f231a60942 Fix the failure to scale-down k8s cluster
Fix the failure to scale-down k8s cluster. We were getting this
failure because as part of scaling, Bay needs to be retrieved for
the respective k8s obj. But if the object passed is a Bay itself
we need not retrieve the Bay. At present even for Bay object the
code proceeds ahead to retrieve bay and cannot find bay_uuid
attribute. This patch fixes this problem.

We might need to backport this fix to stable/liberty as well.

Change-Id: I7ed03af8bdbb8647851751bb550d9529d96b5cb4
Closes-Bug: #1509439
2015-10-23 13:29:49 -07:00
Jenkins
7cadd64d23 Merge "The default of filters should be an empty dict" 2015-10-23 17:55:50 +00:00
Eli Qiao
38c9cb1ab7 Fix exception when create bay failed
Fix Wrong usage of bay object when create bay failed, stack_status should be
should from stack.

Closes-Bug: #1509236
Change-Id: Ieea0c990853d49876f4bbf850c8f6aaa6cef9683
2015-10-23 17:31:15 +08:00
Jenkins
947f67d4ee Merge "Fix k8s CLI to work with Bay name" 2015-10-23 09:18:23 +00:00
Hua Wang
584ad48e00 The default of filters should be an empty dict
Change-Id: I9d6923c0985c8cfefa8d02416092a2ef2be5f226
Closes-Bug: #1509229
2015-10-23 15:52:08 +08:00
Vilobh Meshram
f58b47fe01 Fix k8s CLI to work with Bay name
K8s CLI especially pod/rc/service show and delete works with UUID. This
patch aims to fix k8s CLI to work with bay name as well. If needed this
patch will be ported back to stable/liberty as well.

Change-Id: I2fc9352af63cb261864be9332609603fb943a165
Closes-Bug: #1509091
2015-10-23 14:06:47 +08:00
Egor Guz
a2c7dec40d Kubectl configuration for certificates
Missing slash was added to Docker example and instruction how to
create kubectl configuration for certificates (to avoid type them for
each command)

Change-Id: I06fa04cea4df63fa03ea17598a33ce14685870e7
2015-10-22 18:23:36 -07:00
Jenkins
373d73d1f7 Merge "Refactor MagnumException to reduce complexity" 2015-10-23 01:13:53 +00:00
Jenkins
8aad2ec3b2 Merge "Refactor config setup to reduce complexity" 2015-10-23 01:13:47 +00:00
Jenkins
8ea3e71253 Merge "Refactor periodic task sync_bay_status" 2015-10-23 01:12:26 +00:00
Jenkins
f18d833de8 Merge "Reduce complexity of poll_and_check method" 2015-10-23 01:11:14 +00:00
Tom Cammann
ee52fbbcba Refactor MagnumException to reduce complexity
Reduce cyclomatic complexity of MagnumException to below 10. Remove
exception handling and optimise the logging when the kwargs does not
match the message.

Change-Id: I4fd6ba96be9dff485cdd8bde9750f2d584c1ec63
Closes-Bug: #1501331
2015-10-22 09:52:20 +01:00
Tom Cammann
82003a56e5 Refactor config setup to reduce complexity
The cyclomatic complexity of the setup method was greater than 10 and
reducing this complexity allows for easier understanding of the method.

Change-Id: I45d085d0943fd18a4207fc7a9ba64f2c0f8074ea
Partial-Bug: #1501331
2015-10-22 09:52:20 +01:00
Tom Cammann
d2e05d4e9b Refactor periodic task sync_bay_status
The cyclomatic complexity of sync_bay_status was greater than 10 and
very hard to comprehend. This patch reduces the complexity and makes the
task more open to refactoring and maintence.

Partial-Bug: #1501331
Change-Id: If415aa7710b586b0429ed1bc5077976791b424d1
2015-10-22 09:52:18 +01:00
Tom Cammann
64cc141379 Reduce complexity of poll_and_check method
This is method is overly complex and should be broken down. When
reducing the max complexity allowed by flake8 this method was flagged.
Reducing the complexity of this method will allow better testing and
maintenance.

Partial-Bug: #1501331
Change-Id: Id0bdb2d03614ba31de0d96ed09c33695d933b9f7
2015-10-22 09:30:56 +01:00
OTSUKA, Yuanying
d35affa2b6 Add functional_creds.conf to .gitignore
This patch adds two files to .gitignore.
*  `functional_creds.conf` is used for functional test
* `functional-tests.log` is generated by functional test

Change-Id: Ie21e8e20078770746117a8976444d9a72fd45d55
Closes-Bug: #1508797
2015-10-22 16:55:06 +09:00
Tom Cammann
e5dd25cf22 Add doc8 to pep8 job
To allow doc8 testing of the Magnum documentation in CI, doc8 should be
added to the pep8 tox command. After discussion with infra (see change
I6d42cb2092cbaed0cc2ed83f23b7f9ce0b52356f) this has been the suggested
method to allow for doc8 style checking.

As this behaviour is non-obvious I have left the doc8 command in the doc
tox env, this is not run by CI but will be run by users when modifying
and compiling documentation.

Change-Id: I93133e92d792ccc13d61f3ad1281007c2639853b
2015-10-21 17:07:35 +01:00
Jenkins
2479952136 Merge "Some improvement in swarm cluster add-proxy.sh" 2015-10-21 09:15:32 +00:00
Jenkins
c1d13be857 Merge "Fix docker proxy config file not correctly seting on k8s master" 2015-10-21 08:41:49 +00:00
Eli Qiao
bf07a71a1a Some improvement in swarm cluster add-proxy.sh
Cleanup in add-proxy.sh
1. remove hard-coded filename
2. fix indent

Change-Id: If426f9ebdf1322baf361d6722fc93f75931ee00d
2015-10-21 16:06:57 +08:00
Jenkins
8343fe0181 Merge "Cleanup template formatting" 2015-10-21 04:29:32 +00:00
Eli Qiao
6176db8f18 Fix docker proxy config file not correctly seting on k8s master
In I19c92dc9b4fe195037b5ad4ca49b529cf6be4cfb , we added proxy for k8s cluster,
but it is not working on k8s master since master doesn't have
/etc/systemd/system/docker.service.d/ which is diffenect from minion.

Beside, this patch also improves hardcode filename in add_proxy.sh.

Closes-Bug: #1508279
Change-Id: I03cd504276e9ca99625b93452f832de406cd1fb7
Co-authored-by: Madhuri Kumari <madhuri.kumari@intel.com>
2015-10-21 11:19:19 +08:00
Zachary Sais
485d9a9018 Cleanup template formatting
This patch is meant to cleanup indentations in the templates, as
well some other house keeping fixes.

Closes-Bug: #1504685
Change-Id: I43f6cca8f449dea2db4de6a5308bfa5e4551838e
2015-10-20 10:40:37 -05:00
Eli Qiao
ec92085271 Add proxy for k8s
This patch adds proxy in follow places:

1. etcd needs ETCD_DISCOVERY_PROXY when try to do discovery
   /etc/etcd/etcd.conf
2. docker daemon need set proxy to allow downloads images
   /etc/systemd/system/docker.service.d/proxy.conf
3. and for os level, we need to set http_proxy, https_proxy and no_proxy too
   /etc/bashrc

Implements: blueprint discovery-proxy
Co-authored-by:  Manjeet Singh Bhatia <manjeet.s.bhatia@intel.com>
Change-Id: I19c92dc9b4fe195037b5ad4ca49b529cf6be4cfb
2015-10-20 12:20:36 +08:00
Jenkins
d59d4c2465 Merge "Fix incorrect usage of CertManager in k8s_api" 1.0.0.0b1 2015-10-19 00:38:23 +00:00