2257 Commits

Author SHA1 Message Date
Tang Chen
61c1d985c7 Fix return value of "image set" command
"image set" command should return None. But in one path,
it returns ({}, {}). This patch fixes this.

Change-Id: I3847e661cb7e89863921a3f0a859d9b1a8077ede
2016-02-29 16:18:55 +08:00
Tang Chen
058232b999 [Compute] Check return value is None in compute 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: I953480ecff3b5beb12255d866d0e1df45f130efd
Partial-Bug: #1550636
2016-02-27 15:38:04 +08:00
Tang Chen
01c19ef0bc Router: Add --route and --clear-routes options to "router set" command
--route option is used to set routes to the router.

It is used like this:

    --route destination=subnet,gateway=ip-address

destination: destination subnet CIDR
gateway: nexthop IP address

--clear-routes is used to clear all routes on the router.

Change-Id: I97ce4871113c684b29c98cdad4dec9cc80ed20f7
Implements: blueprint neutron-client
Partial-bug: #1519503
2016-02-27 04:53:10 +08:00
Tang Chen
ada06f4dc3 Add MultiKeyValueAction to custom parser action
Class MultiKeyValueAction will be used to parse arguments like this:

--route destination=xxx,gateway=xxx --route destination=yyy,gateway=yyy

The result is a list like this:

[{destination:xxx, gateway:xxx}, {destination:yyy, gateway:yyy}]

This action also contain validation of the parameters.

Change-Id: Ie3aa8635c6a13fc2e429fe6922acd681dc7244cf
2016-02-27 03:53:32 +08:00
Tang Chen
ba826fa04f Make SetAggregate inherit from cliff.Command
set/unset comamnd classes should inherit from cliff.Command class.

Also, this patch adds functional tests for aggregate.

And also, use utils.format_dict() to format the output of the
properties dict.

Change-Id: Idb50bef8990da95666960e2414dfd7c9be234bba
Partial-bug: #1519503
Closes-Bug: 1546065
2016-02-27 03:50:47 +08:00
Jenkins
2819450be5 Merge "Add shell --profile option to trigger osprofiler from CLI" 2016-02-26 19:49:21 +00:00
Tang Chen
9c91c1df41 Make SetAgent inherit from cliff.Command
set/unset command classes should inherit from cliff.Command class.

Also, this patch adds functional tests for compute agent.

Change-Id: I25eafffd1167f82aa0d430628c22dee7516b1e19
Partial-Bug: 1546065
2016-02-27 03:48:11 +08:00
Tang Chen
859bfaf875 Make SetSecurityGroup inherit from cliff.Command
set/unset comamnd classes should inherit from cliff.Command class.

Change-Id: Ie28711ac8823dc9eb13cf83877864ca436b928bc
Partial-Bug: 1546065
2016-02-27 03:47:57 +08:00
Tang Chen
f37eda3a27 Make SetFlavor and UnsetFlavor inherit from cliff.Command
set/unset comamnd classes should inherit from cliff.Command class.

Change-Id: I54e5608ac0768d7d94b7f7d516ea1948daefdc1b
Partial-Bug: 1546065
2016-02-27 03:46:30 +08:00
Jenkins
b5b5fdd78a Merge "Add missing command/configuration object" 2016-02-26 10:37:45 +00:00
Rui Chen
b733ecf3dd Add missing command/configuration object
Add missing 'command' and 'configuration' object into
command object list, add command, module, host commands
describe in command-objects, and add 'mask' and 'unmask'
options in configuration command details, fix some format
issues by the way.

Change-Id: Iea80c7b1e413e02e49b9090b9d3cb9c59aab4c38
2016-02-26 15:20:44 +08:00
OpenStack Proposal Bot
45d6c1fb1f Updated from global requirements
Change-Id: I582644850642651c61d259e4a53f670b421dce95
2016-02-26 02:01:44 +00:00
Jenkins
277c16c8b7 Merge "Defaults are ignored with flake8" 2016-02-26 01:59:47 +00:00
Jenkins
fbc03104f6 Merge "Floating IP: Neutron support for "ip floating show" command" 2016-02-25 21:15:47 +00:00
jichenjc
ff3a1d3780 [compute] Add set host command
set host command is missing, add it as SetHost class.

Change-Id: I7acb94150718b7150598632cbebc3d85018a0d59
2016-02-26 05:05:46 +08:00
Jenkins
6176e802b3 Merge "Fixed a bunch of spacing" 2016-02-25 20:54:25 +00:00
Dina Belova
16f00833a7 Add shell --profile option to trigger osprofiler from CLI
This will allow to trigger profiling of various services that
allow it currently and which APIs support is added to openstackclient.
Cinder and Glance have osprofiler support already, Nova and Keystone
are in progress.

To use this functionality osprofiler (and its storage backend) needs
to be installed in the environment. If so, you will be able to trigger
profiling via the following command, for example:

$ openstack --profile SECRET_KEY user list

At the end of output there will be message with <trace_id>, and
to plot nice HTML graphs the following command should be used:

$ osprofiler trace show <trace_id> --html --out result.html

Related Keystone change: https://review.openstack.org/#/c/103368/
Related Nova change: https://review.openstack.org/#/c/254703/

The similar change to the keystoneclient
(https://review.openstack.org/#/c/255308/) was abandoned as new
CLI extenstions are not more accepted to python-keystoneclient.

Change-Id: I3d6ac613e5da70619d0a4781e5d066fde073b407
2016-02-25 20:13:27 +00:00
Jenkins
43957d602b Merge "Add python-searchlightclient to list of adopters." 2016-02-25 19:49:00 +00:00
Jenkins
caad923f89 Merge "update heat object and command doc" 2016-02-25 17:14:23 +00:00
Jenkins
5ff47b8ccf Merge "Add some test cases for "server list" command" 2016-02-25 14:39:34 +00:00
Mark Vanderwiel
69d5bc4e55 update heat object and command doc
Many OpenStack client heat command patches are in progress, seems like
good time to also update some of the highlevel doc.

Added new objects for orchestration and software
   openstack orchestration resource type list/show
   openstack software config create/delete/show/list
Added new action for restore
   openstack stack snapshot create/delete/list/show/restore
Added link to CLI reference for complete plugin syntax and
   details
Removed deprecated tasker client

Change-Id: I2c94a5981954edcba95f364a0f909c799f1c403b
Blueprint: heat-support-python-openstackclient
2016-02-25 00:48:15 +00:00
Jenkins
ad93e9f933 Merge "Improve tox to show coverage report on same window" 2016-02-24 14:12:28 +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
e5fe9a7071 Merge "Refactor network AZ exception handling" 2016-02-24 06:20:57 +00:00
Jenkins
1c20e502b8 Merge "Py3 replace dict.iteritems with six.iteritems" 2016-02-24 06:15:09 +00:00
ting.wang
3e08590600 Improve tox to show coverage report on same window
With this patch coverage report will be shown with the results when
tox -e cover will be run.

Change-Id: I96713a8dd5d82019631c9e48c1abd7a94e201569
2016-02-24 10:44:06 +08:00
ting.wang
e47c83d47a Py3 replace dict.iteritems with six.iteritems
All dict.iteritems in osc are replaced with six.iteritems
except this one.
So fix it to add py3 compatibility.

Change-Id: I1aa51399a36e650d262d839ce2b4ec04d3f91db2
2016-02-24 10:14:56 +08:00
OpenStack Proposal Bot
198371b0b7 Updated from global requirements
Change-Id: Ib681d0b07afdde821ab4f9a17b1333bd12739eec
2016-02-24 01:39:41 +00:00
Jenkins
58be3bcf79 Merge "Use update_parser_common() in ShowNetwork" 2016-02-23 19:53:13 +00:00
Jenkins
c2f5945ef6 Merge "Add "security group rule show" command" 2016-02-23 18:02:56 +00:00
Tom Cocozzello
3d7a26bdec Defaults are ignored with flake8
If “ignore” is not set under flake8 in the tox.ini
file there there are defaults set to be ignored.

The depended patch fixes many of the problems.

Change-Id: Ieed2fe1c4654e201d3fe6d40ef93e247ee736f8b
Doc: http://flake8.readthedocs.org/en/latest/config.html#default
Depends-On: I935ab48e7c5bac5f88ecdb3a05f73fb44fc9f41d
Closes-Bug: #1548910
2016-02-23 11:08:36 -06: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
Tang Chen
07242fca3b Use update_parser_common() in ShowNetwork
ShowNetwork inherits from NetworkAndComputeCommand. So we should use
update_parser_common() in it, not overwrite parent's get_parser().

Change-Id: I21bb1407962344b9800fd31caee4b2582674fe24
2016-02-23 19:00:14 +08:00
Jenkins
02e5b6f41d Merge "Use instanceof instead of type" 2016-02-23 08:50:24 +00:00
jichenjc
6902a288f8 [compute] Support restore server
Server in soft-delete state can be restored, add this command.

Change-Id: Id9d7246f89ae65273505f36dcb664996534ae986
2016-02-23 13:43:37 +08:00
jichenjc
042e2b7d53 [compute] Add unit test for keypair
keypair do not have unit test, this patch adds it.

Change-Id: Id702ccaad239b916340bb17014d1ede0a28aaec9
2016-02-23 12:23:10 +08: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
ac53fc5eb6 Merge "gitignore .idea" 2016-02-22 01:42:51 +00:00
Jenkins
a121361bac Merge "Add functional tests for "image" command v2" 2016-02-22 01:24:26 +00:00
Jenkins
b503734de0 Merge "Clean redundant argument to dict.get" 2016-02-22 01:24:20 +00:00