1524 Commits

Author SHA1 Message Date
Tang Chen
dc7e4fc15d Fix dict.keys() compatibility for python 3
In Python 2, dict.keys() will return a list.
But in Python 3, it will return an iterator.
So we need to fix all the places that assuming
dict.keys() is a list.

Change-Id: I8d1cc536377b3e5c644cfaa0892e40d0bd7c11b1
Closes-Bug: #1556350
2016-03-12 10:58:28 +08:00
Jenkins
586a038afd Merge "Fixed command list" 2016-03-11 20:48:32 +00:00
Jenkins
3737c5a842 Merge "Trivial: Reorder classes in identity v3 in alphabetical order" 2016-03-11 05:44:01 +00:00
Jenkins
4856eb144a Merge "Enhance list extension unit test" 2016-03-11 04:50:26 +00:00
Fang Zhen
4208f02a20 Enhance list extension unit test
Extension list involves identity, compute, volume and network.
Current test covers only identity and network. This patch added test
against compute and volum. Also refactored current implentation.

Change-Id: If9b36cba24c50a817a17f685801e418fb898596a
2016-03-11 10:39:15 +08:00
Tang Chen
2debde35ef Trivial: Reorder classes in identity v3 in alphabetical order
Change-Id: Iaf2e336c2415416ec69f6b974743c26509bba561
2016-03-11 10:02:25 +08:00
Jenkins
e3e2f38920 Merge "Refactor security group create to use SDK" 2016-03-11 01:33:57 +00:00
Jenkins
d4b71ea890 Merge "Refactor security group show to use SDK" 2016-03-11 01:33:50 +00:00
Richard Theis
ea2dd8e141 Refactor security group create to use SDK
Refactored the 'os security group create' command to use the SDK
when neutron is enabled, but continue to use the nova client
when nova network is enabled.

Added a release note for the change in security group rules output
due to Network v2. The tenant_id column name was fixed to align
with the 'os security group show' command.

Change-Id: Ib29df42edcddcc73a123fff6a64743a6bfcb7fbf
Partial-Bug: #1519511
Implements: blueprint neutron-client
2016-03-10 10:18:52 -06:00
Richard Theis
564c8ff240 Refactor security group show to use SDK
Refactored the 'os security group show' command to use the SDK
when neutron is enabled, but continue to use the nova client
when nova network is enabled.

Added a release note for the change in security group rules output
due to Network v2. The column names remain unchanged to maintain
backwards compatibility.

Change-Id: I25233ddb8115d18b8b88affb3de13346084a339d
Partial-Bug: #1519511
Implements: blueprint neutron-client
2016-03-10 08:33:52 -06:00
Jenkins
c6e46aa8da Merge "[Subnet pool] Add 'subnet pool create' command support" 2016-03-10 00:38:27 +00:00
Jenkins
cf0f229cad Merge "[Subnet pool] Add 'subnet pool set' command support" 2016-03-10 00:38:09 +00:00
Jenkins
f8ac17ac52 Merge "Trivial: Use 'SSH' rather than 'Ssh'" 2016-03-09 17:18:33 +00:00
Jenkins
1cef18427f Merge "Remove FakeFlavorResource class" 2016-03-09 17:18:26 +00:00
Jenkins
46f58dc173 Merge "remove py26 workaround in osc" 2016-03-09 16:40:46 +00:00
Brandon Palm
f0c3b4e69d Fixed command list
The cliff module expects an array of tuples however
the array that this function was returning was an array
of tuples that was also containing an array of values for
the commands attached to each group and the
cliff module wasn't liking it.

The output now comes out looking like:

| openstack.common | limits show |
|                  | extension list |
| openstack.baremetal.v1 | baremetal set |

Change-Id: Ifa1c149cb5c66ba27dc72bf72d7c8f2f50e42f73
Closes-Bug: 1545609
2016-03-09 16:00:39 +00:00
Stephen Finucane
13e2bb9b96 Trivial: Use 'SSH' rather than 'Ssh'
This is reflected in the '--help' screen.

Change-Id: Ic22a65ff6a56b069b37a0ea8365cce2b3f93621c
2016-03-09 14:55:55 +00:00
Jenkins
040d0c2e82 Merge "[Identity] Check return value is None in identity v3 unit tests" 2016-03-09 08:32:55 +00:00
Jenkins
c8e4a1407f Merge "Add --reason for disable service" 2016-03-09 07:12:51 +00:00
Tang Chen
237d7feca8 [Identity] Check return value is None in identity v3 unit tests
take_action() in commands inheriting from Command returns nothing.
So we should assert the return is None in the unit tests of these
commands.

Change-Id: I53eeb88316b2c20882fed97149d55cb04bcb2b2e
Closes-Bug: #1550636
2016-03-09 14:17:05 +08:00
jichenjc
b711c3a0ca Add --reason for disable service
disbale service allow a reason to be input as disable reason.
This patch add support for it.

Change-Id: I59622c3970e055ebd46bf03c33c864b6d064db28
2016-03-09 05:19:41 +00:00
Tang Chen
81930abdcb Remove FakeFlavorResource class
In unit tests, all real methods are faked. They should not
do any real operations in the tests. So, FakeFlavorResource
is not necessary. Just fake get_keys(), set_keys and unset_keys()
in FakeResource would be enough.

Change-Id: Icc3473ba9c77f4817d0edddb7ff3e1bd2946fac7
2016-03-09 10:26:15 +08:00
Jas
e0d58641bb Add 'port set' command
Add CLI support for the 'port set' command

Change-Id: I2bea508e11290284aa64b1ab548a0bb61e7290d3
Partial-bug: #1519909
Partially-implements: blueprint neutron-client
2016-03-08 09:48:50 -06:00
Jenkins
9ab7740dfd Merge "Trivial: Fix incorrect comments in compute fakes.py" 2016-03-08 15:15:41 +00:00
Tang Chen
3d741d3757 [Subnet pool] Add 'subnet pool create' command support
This patch supports creating a new subnet pool,
with pool prefixes, default prefix length, minimum
prefix length, and maximum prefix length specified.

Change-Id: I9150797c8cfa794d5264ad07965aa967d9a8f5bc
Partial-Bug: #1544586
Related-to: blueprint neutron-client
2016-03-08 21:22:13 +08:00
Tang Chen
f2fb007e82 [Subnet pool] Add 'subnet pool set' command support
This patch supports setting a new name, pool prefix,
default prefix length, minimum prefix length,
and maximum prefix length for a subnet pool.

Change-Id: I65bd71e0f54f2f65acefbc542df67a1b1ec26397
Partial-Bug: #1544591
Related-to: blueprint neutron-client
2016-03-08 21:22:13 +08:00
Tang Chen
11c253ca19 Trivial: Fix incorrect comments in compute fakes.py
Change-Id: I18b1720af13b444527dda1ecab52e3cc8d8d9376
2016-03-08 20:48:58 +08:00
Steve Martinelli
3ed5d232bb remove py26 workaround in osc
we don't support py2.6, so let's remove the workarounds we have.

Change-Id: Id9c8fda065d4aceba3192b044b5c5f2124ee204f
2016-03-08 12:41:17 +00:00
Tang Chen
762c4c9bdf [Identity] Check return value is None in identity v3 unit tests
take_action() in commands inheriting from Command returns nothing.
So we should assert the return is None in the unit tests of these
commands.

Change-Id: I02af06b3d476aac2d93a23ef2111cdc7fa0892ec
Partial-Bug: #1550636
2016-03-08 15:58:25 +08:00
Jenkins
752705ae30 Merge "Add port list command" 2016-03-08 03:04:28 +00:00
Jas
d548942645 Add port list command
This patch adds the ability to list all created ports

Change-Id: Ie1a48c203cabc96346a4950f21b83493d58a66a5
Partial-bug: #1519909
Partially-implements: blueprint neutron-client
2016-03-07 11:17:31 -06:00
Jenkins
13a6857142 Merge "Use _get_columns() to obtain columns in network.py" 2016-03-07 16:05:01 +00:00
Jenkins
dcc27fd5d3 Merge "Test take_action() instead of run() in unit tests" 2016-03-07 16:01:17 +00:00
Tang Chen
fc24f37ae2 Trivial: Remove useless return
If a function returns nothing, do not add return in the end.

Change-Id: I298b8717462f68d3076a1619d674775be2a94c42
2016-03-07 17:54:06 +08:00
Jenkins
67969e438c Merge "" openstack server image create " doesn't print proper info" 2016-03-06 08:33:44 +00:00
Tang Chen
7ba73845c1 Use _get_columns() to obtain columns in network.py
Objects returned by Network v2 and Compute v2 are different.
When getting columns to display, Network v2 uses obj.keys(),
while Compute v2 uses obj._info.keys(). But both of them could
obtain the keys of the object by _get_columns().

Change-Id: I347815f2d28822a95bd6f57d429b84b7ca96e0ee
2016-03-06 09:01:42 +08:00
Jenkins
0b2c4b1f32 Merge "Refactor security group set to use SDK" 2016-03-05 16:08:20 +00:00
Tang Chen
eb1574281b Test take_action() instead of run() in unit tests
Some of the unit tests test run(), but not take_action().

For example, in openstackclient/tests/volume/v1/test_volume.py, there is:

    def test_volume_set_size_smaller(self):
        ......

        result = self.cmd.run(parsed_args)

        self.assertEqual(0, result)
        ......

run() is defined in class Command in cliff. We don't need to test it in OSC
unit tests. On the contrary, we should test take_action(), which is
overwritten in each command classes in OSC.

Change-Id: If07e89953d40ac530f08cbb1ec05f5805171364b
Closes-bug: #1553468
2016-03-05 17:12:42 +08:00
Jenkins
fa3a34322c Merge "[compute] Support restore server" 2016-03-04 23:41:42 +00:00
Jenkins
a61c5cc8a4 Merge "Add 'port create' command" 2016-03-04 23:39:22 +00:00
Jenkins
5c1633f505 Merge "[compute] Add unit test for keypair" 2016-03-04 23:39:16 +00:00
Jenkins
0bf65361f5 Merge "[Volume] Check return value is None in volume unit tests" 2016-03-04 17:55:26 +00:00
Jas
d1d4a40808 Add 'port create' command
This patch adds usage of 'port create' in CLI

Change-Id: I888af50784c3b6c7ec30552ade79f05a5e974711
Partial-bug: #1519909
Partially-implements: blueprint neutron-client
2016-03-04 10:41:26 -06:00
Jenkins
d763acdf1c Merge "Add test cases to test some commands with '--wait' and fix bug" 2016-03-04 01:29:56 +00:00
Jenkins
5e11d24df8 Merge "Fix incorrect unit test for router" 2016-03-03 22:34:47 +00:00
Mohan Muppidi
e354d17d2c " openstack server image create " doesn't print proper info
After creating a snapshot of a running instance, a print out similar
to server create is expected, but it prints out something like "_info"
which is nothing related to created image. _prep_image_detail method
is added to /compute/v2/server.py to enable the priting, while running
the test properly.

Change-Id: I4b06be959768bcdaafd9aa8df497490958bee649
Closes-Bug:1551586
2016-03-03 21:03:14 +00:00
Tang Chen
b58dd4f17f [Volume] Check return value is None in volume unit tests
take_action() in commands inheriting from Command returns nothing.
So we should assert the return is None in the unit tests of these
commands.

Change-Id: Idd961a5fa3db825353700837a559621d17f782c5
Partial-Bug: #1550636
2016-03-03 21:07:08 +08:00
Tang Chen
50443127c5 Fix incorrect unit test for router
Command "router show" will display router's "tenant_id" as
"project_id". But in the unit test, it checks "tenant_id",
which is incorrect.

This patch fix this problem, and add a _get_columns() helper
function to simplify the code.

Change-Id: I0087ef7dfd0130b6c47222495848c4f2b9804b1b
2016-03-03 20:50:17 +08:00
Richard Theis
bac9fb18c1 Refactor security group set to use SDK
Refactored the 'os security group set' command to use the SDK
when neutron is enabled, but continue to use the nova client
when nova network is enabled.

This patch set also fixes a compute bug which ignores name
and description when set to an empty value.

Change-Id: I4225179dca4aedf799e1656ec49236bdedc5e9bd
Partial-Bug: #1519511
Implements: blueprint neutron-client
2016-03-03 06:33:15 -06:00
Jenkins
977eb4f1a6 Merge "Trivial: Reorder unit tests in alphabetical order in volume tests" 2016-03-03 05:00:36 +00:00