292 Commits

Author SHA1 Message Date
Richard Theis
d906507962 Refactor security group rule create to use SDK
Refactored the 'os security group rule 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.

Change-Id: I8c6c99d5272ff5d410a449f73d198d834c5cd96e
Partial-Bug: #1519512
Implements: blueprint neutron-client
2016-03-23 09:56:01 -05:00
Rui Chen
ee621509be Fix "server unset" document issue
Fix "--property" option describe issue in "server unset"
document, and update the help message to keep consistent.

Change-Id: I68022a187e83fad6320365400ad2a1b0c8cf9a61
2016-03-23 14:45:04 +08:00
Dean Troyer
21e414d860 Fix keypair create --public-key
Commit Id702ccaad239b916340bb17014d1ede0a28aaec9 changed the keypair
create --public-key to use io.open but incorrectly reads the file
in binary mode, which causes JSON serialization to fail.

The unit tests mock out io.ioen (the reason for adding it in the first
place actually) so any testing for this specific problem would have to
be done in functional tests...yet to come.

Closes-bug: 1559125
Change-Id: I7a299a542d9df543bff43d3ea1e7907fc8c5f640
2016-03-18 17:48:36 +00:00
Jenkins
bc5b0846f8 Merge "[compute] Add set host command" 2016-03-17 03:06:12 +00:00
Rui Chen
8664a2f8ae Support "--long" option in ListService
Add "--long" option in ListService so that compute service
disabled reason can be showed.

Change-Id: I1ace8f1c4e4efe0a1a8f6710425d73eb5db9e5e1
Closes-Bug: #1556815
2016-03-14 18:07:23 +08: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
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
c8e4a1407f Merge "Add --reason for disable service" 2016-03-09 07:12:51 +00: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
Jenkins
67969e438c Merge "" openstack server image create " doesn't print proper info" 2016-03-06 08:33:44 +00:00
Jenkins
0b2c4b1f32 Merge "Refactor security group set to use SDK" 2016-03-05 16:08:20 +00:00
Jenkins
fa3a34322c Merge "[compute] Support restore server" 2016-03-04 23:41:42 +00:00
Jenkins
5c1633f505 Merge "[compute] Add unit test for keypair" 2016-03-04 23:39:16 +00:00
Jenkins
d763acdf1c Merge "Add test cases to test some commands with '--wait' and fix bug" 2016-03-04 01:29:56 +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
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
ting.wang
84942bb11c Add test cases to test some commands with '--wait' and fix bug
"server image create"
"server rebuild"
"server resize"
Above 3 commands are not covered by unit test.
So add some unit tests.

Meanwhile, fix bug. Now that image name is an optional argument,
we'd better record error messages with positional arguments
instead of optional argument. So, record server name.

Change-Id: I41bc025d4824dc46f63a3213d82e1528bacbbe12
2016-03-02 09:32:27 +08:00
Jenkins
d91e104670 Merge "Make SetAggregate inherit from cliff.Command" 2016-03-01 08:29:04 +00:00
Jenkins
53812170fe Merge "Trivial: Reorder flavor op order in flavor.py" 2016-03-01 07:40:48 +00:00
Jenkins
2ecbb738ef Merge "Refactor security group list to use SDK" 2016-03-01 07:18:10 +00:00
Yang Hongyang
37c0e57d11 Trivial: Reorder flavor op order in flavor.py
Classes should be in alphabetical order.

Change-Id: I7a35c3a2dd6d36c49f0d54dec5c14609a9168bd0
2016-03-01 11:21:47 +08:00
Richard Theis
842882f3cb Refactor security group list to use SDK
Refactored the 'os security group list' command to use the SDK
when neutron is enabled, but continue to use the nova client
when nova network is enabled.

This refactor also removes the logic for displaying project names
instead of project IDs when the --all-projects option is specified.
This logic was removed because it is inconsistent with the other
network commands.

Since neutron will always display security groups across all
projects for an admin, the --all-projects option is now hidden
when neutron is enabled and the Project column is always
displayed.

Change-Id: I934a1f5084ef3c5f929d0ffd38ebf5064d799941
Partial-Bug: #1519511
Related-to: blueprint neutron-client
2016-02-29 14:46:57 -06: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
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
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
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
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
ting.wang
5a978b9ec1 Replace string format arguments with function parameters
There are files containing string format arguments inside logging messages.
Using logging function parameters should be preferred.

Change-Id: I15b405bf4d4715263fe1e1262982467b3d4bc1f4
Closes-Bug: #1321274
2016-02-20 14:16:25 +08:00
Jenkins
bb153b705a Merge "Refactor security group rule delete to use SDK" 2016-02-18 09:03:27 +00: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
Richard Theis
a29c9732d7 Refactor security group rule delete to use SDK
Refactored the 'os security group rule delete' 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 introduces new FakeSecurityGroupRule classes
for testing network and compute security group rules. And fixes
were made to the network FakeSecurityGroup class.

Change-Id: I8d0917925aa464e8255defae95a2a2adfb6cfb75
Partial-Bug: #1519512
Related-to: blueprint neutron-client
2016-02-10 10:38:35 -06:00
xiexs
6b3583ab06 Add support for triggering an crash dump
The triggering crash dump feature is supported by nova [1] and
novaclient [2] now, it's time to introduce this feature into
OSC correspondingly.

[1]The change id is: I6ed777ff637254b4b79417008f9055dd19fc7405
[2]The change id is: If03b1864bbe7074c720b946fc2700bd5d07debc3

Change-Id: I5a411f283fdf0fc3c00380d069848a332c799cdd
Closes-Bug: #1538372
Co-Authored-By: Tang Chen <chen.tang@easystack.cn>
2016-02-05 21:48:41 +08:00
Richard Theis
580b0aff88 Refactor security group delete to use SDK
Refactored the 'os security group delete' command to use the SDK
when neutron is enabled, but continue to use the nova client when
nova network is enabled.

This patch set introduces a new NetworkAndComputeCommand class
to be used for commands that must support neutron and nova network.
The new class allows both the parser and actions to be unique.
The current DeleteSecurityGroup class is now a subclass of this
new class and has moved under the network v2 commands.

This patch set also introduces a new FakeSecurityGroup class for
testing security groups.

And finally, this patch set updates the command documentation
for security group and security group rule to indicate that
Network v2 is also used.

Change-Id: Ic21376b86b40cc6d97f360f3760ba5beed154537
Partial-Bug: #1519511
Related-to: blueprint neutron-client
2016-02-02 09:04:51 -06:00
Akihiro Motoki
258c1102cc log take_action parameters in a single place
Previously each command logs take_action parameters explicitly
by using @utils.log_method decorator or log.debug().
Some commands have no logging.

This commit calls a logger in the base class and
drops all logging definition from individual commands.

Closes-Bug: #1532294
Change-Id: I43cd0290a4353c68c075bade9571c940733da1be
2016-02-02 09:58:32 +09:00
Jenkins
09be6a439a Merge "Refactor "os availability zone list"" 2016-01-22 19:22:42 +00:00
Akihiro Motoki
50d54bb007 log_method: get logger from decorated method if unspecified
This commit makes 'log' optional.
'log' attribute of each command class does not exist
when the class is defined because 'log' is now setup
dynamically when a class is instantiated. Instead log_method
looks for a logger from a decorating method.

compute.v2.server is changed in this commit as an example.

Change-Id: Ic4d128f8e027d3b8e6f884f31369e9085c0f0871
Partial-Bug: #1532294
2016-01-20 22:02:19 +09:00
Akihiro Motoki
0e6b86ad94 Set up logger of each command by metaclass
compute.v2.flavor is changed in this commit as an initial example.

Partial-Bug: #1532294
Change-Id: I262af6ade0ae03fbe1cd2ad198faf4ebb4ecf7ce
2016-01-20 22:02:19 +09:00
Jenkins
aa041c5269 Merge "Make --image parameter optional in "server rebuild"" 2016-01-15 17:44:01 +00:00
Richard Theis
84174440fc Refactor "os availability zone list"
Refactor the "os availability zone list" command to make it a common
command instead of a compute-only command. Since availability zones
are common to compute, volume and network (new), this refactoring
allows availability zone support to be added for volume and network.

In addition to the refactor, unit and functional tests were added.

Change-Id: I63e9d41d229b21cd38e5a083493042c096d65e05
Partial-Bug: #1532945
2016-01-14 11:43:31 -06:00
Jenkins
fa3077d51a Merge "Refactor network endpoint enablement checking" 2016-01-14 00:45:04 +00:00
Richard Theis
5ff660f718 Further improve output for "os security group show"
Improve the security group rules output when running the
"os security group show" command. Empty and duplicate
information for each security group rule is now removed.
This will ensure that the rules remain readable when
direction and ethertype information is returned as part
of the transition to neutron networking.

Change-Id: Ib49c27a9d7f4d5d38ceb2b0d785ddf94d88b2d89
Partial-Bug: #1519511
Related-To: blueprint neutron-client
2016-01-06 08:21:57 -06:00
Jenkins
401164939e Merge "Add support to list all security group rules" 2016-01-04 21:41:06 +00:00
Richard Theis
57dac0bc3a Refactor network endpoint enablement checking
Move the network endpoint enablement checking from the 'server create'
command to the common client manager. This allows future network
commands to use either nova or neutron networking based on the cloud
environment.

This patch set also includes related unit test enhancements to the
common client manager to trigger authentication on the tests.

Change-Id: Ia37e81d4fb05a1e2fceb3e5d367bda769ab8e64b
Related-Bug: #1519511
Related-to: blueprint neutron-client
2016-01-04 13:49:49 -06:00
Rushi Agrawal
eeeb9f729f Docstring should say 'default' if option is default
Change-Id: I59d83e7a0a590fa537f509f7f19940640f555679
2015-12-31 09:36:26 +05:30