687 Commits

Author SHA1 Message Date
Jenkins
fbc03104f6 Merge "Floating IP: Neutron support for "ip floating show" command" 2016-02-25 21:15:47 +00:00
Jenkins
6176e802b3 Merge "Fixed a bunch of spacing" 2016-02-25 20:54:25 +00:00
ting.wang
e0b6cab09b Add some test cases for "server list" command
Add some test cases that test 'server list' command when specifying flavor or image.
Because I add some attribution to fake.py, I have to change some code
in create server test. Despite all this, I think it's good for testing.

Change-Id: I714deac1f6f940b790a3c20af5f7ffa724ac44d1
2016-02-24 18:57:02 +08:00
Tang Chen
f0960f0fef Floating IP: Neutron support for "ip floating show" command
Change-Id: I30350076621c83c758927444e5f8bcc2b7d0fc74
Partial-Bug: 1519502
Related-to: blueprint neutron-client
2016-02-24 17:26:13 +08:00
Jenkins
c2f5945ef6 Merge "Add "security group rule show" command" 2016-02-23 18:02:56 +00:00
Brandon Palm
f49f0fead2 Fixed a bunch of spacing
Nothing too complicated here.  I fixed a bunch of spacing issues
that I saw in OSC.

Change-Id: I935ab48e7c5bac5f88ecdb3a05f73fb44fc9f41d
2016-02-23 10:38:58 -06:00
Richard Theis
dccde70c57 Add "security group rule show" command
Add the "os security group rule show" command which will use
the SDK when neutron is enabled, and use the nova client when
nova network is enabled.

Change-Id: I41efaa4468ec15e4e86d74144cc72edc25a29024
Partial-Bug: #1519512
Implements: blueprint neutron-client
2016-02-23 15:27:06 +00:00
Tang Chen
ab40add0c6 Fix wrong return value in TestDeleteFloatingIPNetwork
delete_ip() should return None, not the fake floating IP.

Change-Id: I1476189a09a94c76c90f9a3986e3ae57dc66d796
2016-02-23 20:19:14 +08:00
Jenkins
02e5b6f41d Merge "Use instanceof instead of type" 2016-02-23 08:50:24 +00:00
Jenkins
db4d73d8c8 Merge "Add functional tests for "volume" commands v2" 2016-02-23 02:49:57 +00:00
Jenkins
37f96c2c47 Merge "Add unit tests for 'hypervisor stats' command" 2016-02-23 00:59:08 +00:00
Jenkins
7c9bb377c1 Merge "Add "os subnet show" command using SDK" 2016-02-23 00:13:44 +00:00
Brandon Palm
11a8f911af Use instanceof instead of type
Adjusted conditional statements to use instanceof when
comparing variables. Instanceof supports inheritance type
checking better than type.

Change-Id: I4ee0004934dc2322d43ef07e797a6811e39a812c
Closes-Bug: 1548530
2016-02-22 16:23:23 -06:00
Brad Behle
112d7b0e09 Add "os subnet show" command using SDK
Implement the openstack client subnet show command using SDK
calls.  This shows the details of a specific subnet.

Co-Authored-By: Terry Howe <terrylhowe@gmail.com>
Partially implements: blueprint neutron-client
Closes-Bug: #1542359

Change-Id: Iaf18b9e44af35ca0cd61033b468e0c60cd3b05d6
2016-02-22 13:04:25 -06:00
Tang Chen
c57fc41c33 Initialize _keys in __init__() in FakeFlavorResource
_keys is defined as a class attribute in FakeFlavorResource. So when
we call set_keys() to update it, it changes. And this change may bring
trouble to the other tests afterward.

So define and initialize it in __init__() as an object attribute.

Change-Id: Ib18c03877b67e1b7c2e107f598076b928a58e4fb
Closes-bug: #1548378
2016-02-23 00:14:56 +08:00
ting.wang
8825f0d8f3 Add unit tests for 'hypervisor stats' command
'hypervisor stats show' command isn't covered by unit tests,
so add unit tests to test it.

Change-Id: Ic355230cbdd596e848191b599803dca7f27c2ffb
2016-02-22 23:36:29 +08:00
Jenkins
ba08683d90 Merge "Add unit test for "flavor show" command" 2016-02-22 03:24:56 +00:00
Jenkins
30e2643d23 Merge "Refactor: Set "project_id" for FakeXXX in a consistent style" 2016-02-21 06:16:55 +00:00
Tang Chen
acc0297fa6 Add functional tests for "volume" commands v2
The tests for v2 "volume" commands are quite similar to v1.

This patch also map 'metadata' to 'properties', 'volume_type' to 'type'
to align to the v1 output.

Change-Id: Icf2c5463b186fc78c890ccd96453090c4a2c2eb6
Partial-bug: #1519503
2016-02-21 09:10:15 +08:00
Tang Chen
b4edbd55f2 Add unit test for "flavor show" command
Change-Id: I1591649e5b97a885707042fcccad3335ee8c7aec
2016-02-20 17:16:01 +08:00
Tang Chen
6af2883885 Refactor: Set "project_id" for FakeXXX in a consistent style
OpenStack SDK will translate "project_id" into "tenant_id" automatically
when referring to "tenant_id" attribute with the name "project_id". So
when faking an object returned fron SDK, we need to fake this behavior.

The original way is ugly. This patch turns it into a consistent style,
and give better comments.

Change-Id: I0dfb1f7552fc28eb4e7ebf5c614c9f3bde79ad80
2016-02-20 16:39:06 +08:00
guang-yee
41e1bd0be6 Support unscoped token request
Make scope check optional for the "token issue" command as unscoped token is
a valid Keystone V2/V3 API.

Change-Id: Ie1cded4dbfdafd3a78c0ebdf89e3f66762509930
Closes-Bug: #1543214
2016-02-19 16:07:13 -08:00
Jenkins
ab6ba385a2 Merge "Subnet Pool: Add "subnet pool show" command" 2016-02-19 18:17:00 +00:00
Jenkins
0a8137f773 Merge "Don't use Mock.called_once_with that does not exist" 2016-02-19 17:44:56 +00:00
Jenkins
20f86465af Merge "Use assertIsNone() instead of assertEqual(None, xxx)" 2016-02-19 16:13:40 +00:00
Jenkins
61d9604f8a Merge "Subnet Pool: Add "subnet pool list" command" 2016-02-19 15:55:29 +00:00
Tang Chen
ef64a8b47d Use assertIsNone() instead of assertEqual(None, xxx)
Change-Id: Ibbd7d6d27b2ff20304e3121fbadd5d50c1836d9b
2016-02-19 17:14:08 +08:00
Tang Chen
48681af86a Don't use Mock.called_once_with that does not exist
Class mock.Mock does not exist method "called_once_with()", it just
exists method "assert_called_once_with()". "called_once_with()" does
nothing because it's a mock object.

In OSC, only one place is still using "called_once_with()". Fix it.

Change-Id: Ib890e95d775c3fc43df80fa05c82d726e78cdac8
Partial Bug: 1544522
2016-02-19 13:44:54 +08:00
Tang Chen
ca34aa1587 Floating IP: Fix "ip floating list" in neutron network
The implementation of "ip floating list" in the commit below
is incorrect:

    Change-Id: I253f66f6bc64470e1a18ffea506048eb53f67d5c

This is because the FloatingIP objects returned from Nova and
Neutron network are different. They need different handling.

This patch fixes this problem.

The output for Neutron network would be:

+--------------------------------------+---------------------+------------------+------+
| ID                                   | Floating IP Address | Fixed IP Address | Port |
+--------------------------------------+---------------------+------------------+------+
| 1976df86-e66a-4f96-81bd-c6ffee6407f1 | 172.24.4.3          | None             | None |
+--------------------------------------+---------------------+------------------+------+

The output for Neutron network would be:

+----+---------------------+------------------+-----------+--------+
| ID | Floating IP Address | Fixed IP Address | Server ID | Pool   |
+----+---------------------+------------------+-----------+--------+
|  1 | 172.24.4.1          | None             | None      | public |
+----+---------------------+------------------+-----------+--------+

Change-Id: I1295e922df695414511d9a07ca4a8e2428040064
Partial-Bug: 1519502
Related-to: blueprint neutron-client
2016-02-19 11:10:53 +08:00
Tang Chen
3c8bb16513 Subnet Pool: Add "subnet pool show" command
Change-Id: I8dda7bbf1e27b0ac773f62a5cd293387da96f8df
Closes-Bug: 1544590
Implements: blueprint neutron-client
2016-02-19 11:05:28 +08:00
Tang Chen
a04012c3d5 Subnet Pool: Add "subnet pool list" command
Change-Id: I7935be2488fb728ced9680d75880870e5d315655
Closes-Bug: 1544589
Implements: blueprint neutron-client
2016-02-19 11:00:33 +08:00
Jenkins
00a1dddc2a Merge "Subnet Pool: Add "subnet pool delete" command" 2016-02-18 09:58:22 +00:00
Jenkins
088f2446f2 Merge "Support "network show" command in nova network" 2016-02-18 09:03:56 +00:00
Jenkins
36b21461d9 Merge "Support "network list" command in nova network" 2016-02-18 09:03:49 +00:00
Jenkins
bb153b705a Merge "Refactor security group rule delete to use SDK" 2016-02-18 09:03:27 +00:00
Tang Chen
79fd6d3f20 Subnet Pool: Add "subnet pool delete" command
Change-Id: Ic5ba5effcaea2410421a81da8ffce7c0295179e7
Closes-Bug: 1544587
Partially implements: blueprint neutron-client
2016-02-18 08:53:39 +08:00
Jenkins
272ac55776 Merge "Return names in list role assignments" 2016-02-17 22:23:51 +00:00
Jenkins
f15a75428d Merge "Add "token revoke" for identity v3" 2016-02-17 20:31:07 +00:00
Tang Chen
d9d1809907 Support "network show" command in nova network
"network show" command is not implemented in nova network.
This patch implements it.

Change-Id: I1fadd890fe36c4e3ac5c9ed389b20c5b2fff8aca
partial-Bug: 1543672
2016-02-17 17:09:51 +08:00
Tang Chen
ddc97c6dc5 Support "network list" command in nova network
"network list" command is not implemented in nova network.
This patch implements it.

The Network object in novaclient is quite different from
the one in sdk. And the output of "network list" using
Nova network is also quite different from using Neutron.

It is like this:

# openstack network list
+--------------------------------------+---------+-------------+
| ID                                   | Name    | Subnet      |
+--------------------------------------+---------+-------------+
| 96a98ec4-31f6-45f6-99e6-9384569b3bb5 | private | 10.0.0.0/24 |
+--------------------------------------+---------+-------------+

--long and --external options have not been implemented because
the attrs in Network object in novaclient is too much different.

This patch also introduces a new FakeNetwork class in compute/v2/fake.py
to fake nova network.

Change-Id: Id1fdf81fb2fa8b39f2c76b7bae37ac4fecafd0f7
Depends-On: I1b59264cd40aaf1062f4e8db233ccb7fd0e95f0e
partial-Bug: 1543672
2016-02-17 17:04:43 +08:00
Tang Chen
da3d65299b Define FakeFloatingIP class in tests/compute for nova network commands
"ip floating list" command is not available for Neutron now because
the implementation is incorrect.

The FloatingIP objects returned from Nova and Neutron network are
quite different. So they need different FakeFloatingIP class to
do the tests.

This patch copies class FakeFloatingIP in tests/network to tests/compute
for Nova network tests.

Will fix the problem in "ip floating list" command and change FakeFloatingIP
in tests/network to fit Neutron network tests.

Change-Id: Ia29d257868e0f1dc6cd7cfe3819875e5913f76ec
Partial-Bug: 1519502
Partially implements: blueprint neutron-client
2016-02-16 15:14:34 +08:00
Jenkins
67bec569f8 Merge "Rename parameter "identifier" to "network" in network commands" 2016-02-15 17:16:30 +00:00
Jenkins
5543857381 Merge "Use assertRaises() to check if an exception is raised" 2016-02-15 17:14:42 +00:00
Tang Chen
324e026f57 Rename parameter "identifier" to "network" in network commands
In other commands, the name or ID of an object is just the name
of the object. For example, name or ID of a server is "server",
router is "router". So, do not use "identifier" in network commands.

Also, the parameter in doc file network.rst is not "identifier",
but "network".

Change-Id: I1ec3beefbb878a207bca280b994ca176ef04ee2d
2016-02-14 18:57:34 +08:00
Tang Chen
cfcb750a97 Use assertRaises() to check if an exception is raised
In some test cases, try/except is used to check if an exception
has been raised. We should use assertRaises() instead.

Change-Id: I15c8e757dcab77fd6f895feb018184e1eb7e617b
2016-02-14 18:43:19 +08:00
Tang Chen
27a0da65e3 Support "network delete" command in nova network
"network delete" command is not implemented in nova network.
This patch implements it.

Change-Id: I5dac1eed6eb8e67298bb446418835a6ab85c859c
Depends-On: I1b59264cd40aaf1062f4e8db233ccb7fd0e95f0e
partial-Bug: 1543672
2016-02-14 17:07:17 +08:00
Tang Chen
d8abec33ad Floating IP: Neutron support for "ip floating list" command
Change-Id: I253f66f6bc64470e1a18ffea506048eb53f67d5c
partial-Bug: 1519502
Related-to: blueprint neutron-client
2016-02-14 04:21:08 +00:00
Jude Job
6109dfcf63 Floating IP: Neutron support for "ip floating delete" command
This patch implements "ip floating delete" command for
both compute and network. Also includes unit tests.

Change-Id: Ie61f0faad65ec90f9d9956ae463412be8d963d05
partial-Bug: 1519502
Related-to: blueprint neutron-client
Co-Authored-By: Tang Chen <chen.tang@easystack.cn>
2016-02-14 04:21:00 +00:00
Jenkins
6117e1c715 Merge "Identity: Fix DisplayCommandBase comments for cliff ShowOne subclass tests" 2016-02-13 06:11:39 +00:00
Jenkins
f1b11e2cf0 Merge "Identity: Fix DisplayCommandBase comments for cliff Lister subclass tests" 2016-02-13 06:11:22 +00:00