29 Commits

Author SHA1 Message Date
Spyros Trigazis
c18bd6f247 Fix empty object returned by successful response
Return of objects like capacity and allocatable were returning
an empty object. Fix deserialize method and pass the corresponding
value.

Change-Id: Ia55d01a7cfd6e11448272e5859dd84e40147b618
Closes-Bug: #1595373
2017-01-21 22:59:49 +01:00
Jenkins
53bd248930 Merge "Change assertTrue(isinstance()) by optimal assert" 2017-01-10 22:41:28 +00:00
Tony Xu
25a817c03d Change assertTrue(isinstance()) by optimal assert
Use assertIsInstance() instead of assertTrue(isinstance())

Change-Id: I8bfc27d72b27b512ac4f3fbb7c1821b9be1dbd06
2016-10-25 10:25:41 +08:00
Flavio Percoco
55df1591f7 Fix indentation in the README
Change-Id: If950089a2f77102ef88c900e5fa57759b29f05ad
2016-09-20 08:38:07 +02:00
Davanum Srinivas
4f0b170a5f Deserialize Labels properly
Switch from 'object' to 'dict(str, str)' so that the labels
information is not lost.

Change-Id: I971ef230cda8b2ba5997ab71c622323956fcfbdd
2016-09-07 14:56:37 -04:00
Andrey
a2169399ae Fixing patch_* commands execution
This patch fixes the following error during
patch_* calls:

UnboundLocalError: local variable 'r' referenced before assignment

Change-Id: I0d96e0099b343d4473e1d3bd1dbbaed03c4c1720
2016-08-26 13:12:57 +00:00
Dmitry Tyzhnenko
37d64942cd Using named logger instead of root logger
Change-Id: I1a38b1bb3f1e031662b5e1f77528827fe04fdf9a
2016-07-29 00:02:51 +03:00
Davanum Srinivas
fa1b48f60e Fix default ip/port
Change-Id: Id8cf0aa5d0dcde9ffa9b87fd0669ec15f9328740
2016-05-29 10:52:03 -04:00
Andrey Pavlov
5d0f2a67a3 Adding batch_v1 api support
Change-Id: I37cfdc92f1ff9cf4ff96b9d0ca14e3b777890ffc
2016-05-27 17:23:29 -04:00
Davanum Srinivas
793696fd9a Log info about K8S environment
Change-Id: Ic01f41f121b9d2c15a70281d90b3726b9292878a
2016-05-27 17:23:04 -04:00
Davanum Srinivas
e0db3f1500 Add test case for configmaps
Change-Id: I678bcefb39ee885c286e7ef1ea9375894a0e47a3
2016-05-26 14:32:13 -04:00
Andrey Pavlov
07a77b71ef Adding extensions_v1beta1 api support
Change-Id: I8213bb00ccb154fc593ad1dab3f0fc1aa64598fd
2016-05-26 13:35:03 +03:00
Davanum Srinivas
df8b8fa5b1 Install Docker in kube-init.sh
Also limit the loop to 5 mins.

Change-Id: I889c923468202412c8a267ee37ea679675b8bd1a
2016-05-03 17:43:04 -04:00
Davanum Srinivas
a3a967ae38 Add More tests from Magnum
Change-Id: Id2ab6367e8fef23f7c02097601d6699b4e97267e
2016-04-24 06:52:09 -04:00
Davanum Srinivas
6d1d7ea3d9 Default to application/json
We should end up with a specific type as the default
if '*/*' is specified. Note that the default is
'application/json'

Change-Id: I2107da25de8abd19c0d5a87d756e14916aa7fada
2016-04-22 22:37:33 -04:00
Davanum Srinivas
1f3d16883e Add python 3 support
Replaced unicode with six.text_type

copied from I9f084ef4fae1ec1111e26142e2e89bad18acbf45

Change-Id: Icba62cb7a76884289ffd93f61a16cdf89fcdce86
2016-04-22 14:53:36 -04:00
Davanum Srinivas
b6b461b895 Keep py3.X compatibility for urllib
Copied from If6c1b016c726070b5b326296ead933cbd74bd408

Change-Id: I971f1f587ef5b3cf4d81325ee3731a9ec6dadfaf
2016-04-22 14:45:07 -04:00
Davanum Srinivas
c1d099e7f2 TLS integration for latest pythonk8sclient
swagger_client uses PoolManager from urllib3. PoolManager keeps the
connection_pool_kw passed during the init time and uses the same later
while initiating HTTPSConnection. Existing implementation instantiates
RESTClientObject() at import time, without giving an option to pass
the security parameters, viz. key_file, ca_certs etc. So we needed to
change the way instantiation/initialization was happening.

(copied from I3b490bbb47eb5f961951708dabe6c1abfbcece4e)

Change-Id: I6df227bcd030cb8c374bc83bb44dfea980c893b3
2016-04-22 14:41:31 -04:00
Davanum Srinivas
3b09cf2bc1 Fix up sanitize_for_serialization
Picked up from I046931ad491e8b7ee45943852901eac5c3df913e

Change-Id: Ib422f75909d1e0da5ff95a8a15b6ff73bb2bb2a6
2016-04-22 14:26:56 -04:00
Davanum Srinivas
7b1385dd3e Remove unsafe usage of eval
eval will execute a function before it has been determined to be
a python data type.  Instead, use ast.literal_eval which validates
the object is a data type before executing it.

See:
    http://nedbatchelder.com/blog/201206/eval_really_is_dangerous.html

(copied from Ia3d74747e66d72e97a3fb9029bd51331c902f874)

Change-Id: Iae0d42f8d14f66d6ea6cf2201646d8a796cc0cc9
2016-04-22 14:12:37 -04:00
Davanum Srinivas
5d1a429016 Run swagger codegen for latest Kubernetes API
Update to Kubernetes 1.2.2 version

Fixes to v1.json:
* Change 'any' types to 'object'

Fixes to rest.py:
* Fix __init__ to accept ca_certs

Change-Id: I190f26fac76480bc59ea5ceab7f1c94f16059086
2016-04-22 13:33:25 -04:00
Ralf Haferkamp
9e124dcc44 Fix package name in pbr VersionInfo call
The correct package name in "python-k8sclient". Otherwise pbr's try to get
the version from pkg_resources will not work.

Change-Id: I90424e59c051564d4639147cc418c218485e09b3
2016-04-19 17:06:42 +02:00
Davanum Srinivas
9a07ef5129 Switch file location and repo path
* We are no longer in magnum repo
* file path to v1.json has changed

Fix minor flake8 issues

Change-Id: I077127d387399864e490d242806053237af32e0b
2016-04-04 10:10:43 -04:00
Davanum Srinivas
232306d0c7 Skip tests when Kubernetes is not running 2016-04-03 22:06:46 -04:00
Davanum Srinivas
9f65944384 Fix flake8 with minimal changes
Just ignore a bunch of things now. We can fix these later as a big
bunch of these are in generated code.
2016-04-02 20:59:30 -04:00
Davanum Srinivas
9fd934047d Get tests working in py34 2016-04-01 17:26:32 -04:00
Davanum Srinivas
4d13215b5b Minimum sanity check tests 2016-04-01 15:11:45 -04:00
Davanum Srinivas
4324b67fd0 Add Cookie cutter generated files for OpenStack 2016-04-01 14:16:11 -04:00
Davanum Srinivas
6294d9f6b9 Restructure directories 2016-04-01 14:05:01 -04:00