361 Commits

Author SHA1 Message Date
Jenkins
377daebaa4 Merge "Fix errors for "host set" command" 2016-06-23 15:27:37 +00:00
Jenkins
51fcd7c30c Merge "Refactor unit test of "compute service list" command" 2016-06-23 06:20:34 +00:00
Jenkins
775b1acccd Merge "Make set/unset commands in compute/image/common return normally when nothing specified" 2016-06-22 14:37:44 +00:00
Huanxuan Ao
70f8ae7534 Refactor unit test of "compute service list" command
The unit test of "compute service list" only checked the
"Disabled Reason" columns and its data. It is not enough.
This patch change the test to check all datas in the list.

Also, this patch modify the "Id" to "ID" in this command.

Change-Id: I988fd6365f2652185dd96d9417f294eba9c31cd9
2016-06-22 19:02:39 +08:00
Jenkins
de909e4afc Merge "Support bulk deletion for "flavor/aggregate delete"" 2016-06-22 06:48:50 +00:00
Huanxuan Ao
7177014fcc Fix errors for "host set" command
"Host set" command cannot work. Because:
1.Host has no 'ID' attribute, so 'ID' attribute cannot be found
in "host set" command.
2.value "True" and "Flase" are invalid in updata() method of host.
3.Some update functionalities is not supported in host API now.

This patch solves the problems 1 and 2 in OSC. But the problem 3
is a API problem and can't be solved in OSC, only XenServer driver
support to set enable/disable and maintenance host, it is a normal
problem.
After this patch the output of "host set" command is:
The requested functionality is not supported. (HTTP 501)
(Request-ID: req-14031fce-8c90-48a0-8492-dc8e3dd349f3)
Just the same as the "host-update" command in novaclient.

Change-Id: Ibe94c4d3d492d3d63355de803810edb988e1b4e9
Closes-Bug: #1594689
2016-06-22 14:20:53 +08:00
Huanxuan Ao
014835930d Add "--project" option to the "flavor create" command.
Add ``--project`` and ``--project-domain`` options to the
``flavor create`` command. We can use these options to add
the flavor access to a givin project when we create the flavor.

Change-Id: Ic1907272c1d1ae526f9c9e86f32ba06c6da147c0
2016-06-21 16:28:18 +00:00
Tang Chen
9c62af8a42 Make set/unset commands in compute/image/common return normally when nothing specified
After this patch, all set/unset commands will return normally
when nothing specified.

Change-Id: Id94d0329faa1a674006a9aae901f834b41917317
Close-bug: #1588588
2016-06-21 15:15:18 +08:00
Huanxuan Ao
640014fa91 Support bulk deletion for "flavor/aggregate delete"
Support bulk deletion and error handling for "aggregate delete"
and "flavor delete" commands.

Change-Id: I3f6105cbeeab1c9f8cd571c63ce0e7ac3d4252b3
Partially-Implements: blueprint multi-argument-compute
Partial-Bug: #1592906
2016-06-21 11:04:13 +08:00
Jenkins
f5ae23ab86 Merge "Standardize logger usage" 2016-06-20 17:26:57 +00:00
Jenkins
a99b54ef75 Merge "Fix console url show command broken in microversion case" 2016-06-20 15:51:20 +00:00
Tang Chen
047cb68493 Standardize logger usage
Use file logger for all command specific logs.

This patch also fixes some usage that doesn't
follow rules in:
http://docs.openstack.org/developer/oslo.i18n/guidelines.html

After this patch, all self.log and self.app.log
will be standardized to LOG().

NOTE: In shell.py, we got the log in class OpenStackShell,
      which is also known as self.app.log in other classes.
      This logger is used to record non-command-specific logs.
      So we leave it as-is.

Change-Id: I114f73ee6c7e84593d71e724bc1ad00d343c1896
Implements: blueprint log-usage
2016-06-20 15:16:51 +00:00
Tang Chen
d67c2e8383 Use osc_lib in server_image.py
server_image.py is a newly created file. So I think
we forgot to use osc_lib in it.

Change-Id: Ieda13438662ea55b03f549108aac63c18b9af913
2016-06-20 20:02:05 +08:00
Rui Chen
8cceaddaac Fix console url show command broken in microversion case
The response data of nova get_xxx_console API is changed
from "console" to "remote_console" in microversion 2.6, and nova
server side API schema verify the spice vnc type to "spice-html5",
update OSC code to apply these change so that OSC can work in
different nova microversion cases.

Change-Id: I3bb4fe057e656209d00d2bb308ac3f7f837cb03f
Closes-Bug: #1590318
2016-06-16 21:13:47 +08:00
Jenkins
b9a318156c Merge "Move server image create command to its own resource file." 2016-06-16 13:05:18 +00:00
Jenkins
4cc539fcc5 Merge "Support compute service force down/up" 2016-06-15 16:36:30 +00:00
Dean Troyer
6357202971 Fix foundation copyrights
The OpenStack LLC copyrights date from before OpenStack was transferred
to the foundation.  These appear to be getting copy-pasted to new files
so at least should reflect the correct entity.

Change-Id: I02953d752cb24ead6aa4ad8bfe257a48317c9f13
2016-06-14 09:49:28 -05:00
Rui Chen
eccd943acc Support compute service force down/up
Aims to evacuate servers from compute host as soon as possible,
operators might set the compute service force down manually.
Novaclient support the behavior, this patch support it in OSC.

Change-Id: I22ff1c5d670c449771fdcb3f4f39cd82f428531a
Closes-Bug: #1589348
2016-06-14 17:40:09 +08:00
Dean Troyer
9e2b8e6730 osc-lib: command
Leave command.py and test_command.py as a sanity check during the
deprecation period.

Change-Id: I24e1b755cbfbcbcaeb5273ec0c9706b82384fc85
2016-06-13 11:00:22 -05:00
Dean Troyer
be192676bd osc-lib: parseractions
Leave parseractions.py and test_parseractions.py as a sanity check during the
deprecation period.

Change-Id: I1a7469b6d872284e0276502a1a287bc0b87f8f83
2016-06-13 10:55:44 -05:00
Dean Troyer
e5e29a8fef osc-lib: utils
Use osc-lib directly for utils.

Leave openstackclient.common.utils for deprecation period.

Change-Id: I5bd9579abc4e07f45219ccd0565626e6667472f7
2016-06-13 10:50:44 -05:00
Dean Troyer
d20c863ebc osc-lib: exceptions
Use osc-lib directly for exceptions.

Leave openstackclient.common.exceptions for deprecation period.

Change-Id: Iea3e862302372e1b31ccd27f69db59b4953ca828
2016-06-13 10:50:01 -05:00
Jenkins
84506a6b71 Merge "Fix compute service set command" 2016-06-08 05:03:47 +00:00
sunyajing
565499577f Fix compute service set command
add ``Binary name`` to help msg of compute service set command.

Change-Id: I5ed3824ec5bede250ce41f187835e8901b5e11fd
2016-06-08 03:07:16 +00:00
Jenkins
19c54b61c1 Merge "Refactor SetService --enable/disable option" 2016-06-06 21:56:55 +00:00
Jenkins
9504b7973e Merge "Add newline to strings in stdout/stderr.write()" 2016-06-06 13:06:47 +00:00
Jenkins
275753bacc Merge "fix keypair help msg" 2016-06-06 08:45:13 +00:00
sunyajing
5b317936cb fix keypair help msg
keypair delete and keypair show commands cannot work on keypair ID

Change-Id: I958fcd2ed184706b28d63cc9c73a8b566e86a16c
Closes-Bug:#1588701
2016-06-06 06:50:13 +00:00
Lu lei
54e81a9984 Add newline to strings in stdout/stderr.write()
Function stdout/stderr.write() can't break line automatically.

Change-Id: I903c2d1cc1a669adb6be5aa4eb783d3b9943e685
2016-06-06 13:54:55 +08:00
sunyajing
6de7bf0abc modify server group
make column_headers equal to columns, to keep code consistence

Change-Id: Ia96b398ad822fc5fac3753e28709c370165bda8a
2016-06-06 11:47:59 +08:00
Jenkins
93db7f58ed Merge "Support multiple argument for compute agent delete command" 2016-06-05 04:36:26 +00:00
Tang Chen
ac1d86c343 Refactor SetService --enable/disable option
This patch changes the following:

1. --enable/disable option should follow the rules
   in the doc below:
   http://docs.openstack.org/developer/python-openstackclient/command-options.html#boolean-options

2. "--disable-resion" is specified but not "--disable",
   an exception is raised instead of igoring
   "--disable-reason" option.

Change-Id: I92e9234111e661bfe7119a8e19389a87c874ab0c
2016-06-04 22:42:46 +08:00
Dean Troyer
eef2054109 Move server image create command to its own resource file.
Change-Id: If37e82072bd7a32b81bfb1a8bb048f018dd5b04f
2016-06-03 09:19:57 -05:00
Huanxuan Ao
95d5d9f761 Fix some missing i18n support problems in compute
Found and Fix some missing i18n support problems in compute/client.py

Change-Id: I54374f4eddafd9f80b6ccdaf8f8c30e098df105e
Partial-bug: #1574965
2016-06-03 12:15:22 +08:00
sunyajing
909bab1e07 Support multiple argument for compute agent delete command
Change-Id: I3b19e4914d475b86d7e8aa8d76e62a2ac811272f
Partially-Implements: blueprint multi-argument-compute
2016-06-03 02:14:36 +00:00
Jenkins
9f65a9954c Merge "Add support for removing flavor-access" 2016-06-02 18:14:48 +00:00
Huanxuan Ao
22c60f3ac7 Add support for removing flavor-access
Add "--project" and "--project-domain" options in
"flavor unset" command to remove flavor access.

Change-Id: Ia5c5a80d9890d5af066b75b4e202647c18c7d915
Partial-Bug: #1575461
2016-06-02 12:40:43 +08:00
Jenkins
21924f55b9 Merge "Fix output and error log in server.py" 2016-05-31 13:42:14 +00:00
Jenkins
4e44f1206f Merge "Add support for setting flavor-access" 2016-05-30 20:00:11 +00:00
Huanxuan Ao
c46a5597be Add support for setting flavor-access
This patch adds "--project" option in "flavor set" command to support
for setting flavor access.

Change-Id: I75b473600080d8ab1dd6ad01561c4f989ed3c3bd
Partial-Bug: #1575461
2016-05-30 16:26:09 +08:00
Jenkins
4822bf1f53 Merge "[compute] Add server backup function" 2016-05-30 04:28:07 +00:00
Rui Chen
1a7284f63a Support to set server state
When a server is unexpected state, OSC don't support reset
the server to active or error state, that's supported by
novaclient, and it's an important command for operators, the
patch implement this function.

Change-Id: I3e7800feb192832b0719ef9a353945beb6bfd509
Implements: blueprint server-reset-state
2016-05-28 18:55:50 +08:00
Tang Chen
97162ecd22 Fix output and error log in server.py
This patch fixes 2 problems:

1. The '\n' should be in the end of a message,
   not the beginning.

i.e.:
   The original code was:
       sys.stdout.write(_('\nError deleting server'))
   It will make the output look like this:

   [root@tangchen /]# openstack server delete aaa bbb

   Error deleting server
   Error deleting server[root@tangchen /]#

   We change it to:
       sys.stdout.write(_('Error deleting server\n'))
   Then the output will become:

   [root@tangchen /]# openstack server delete aaa bbb
   Error deleting server
   Error deleting server
   [root@tangchen /]#

   which is much better.

2. Record the error in log for those who didn't.

Change-Id: I38b00c2321014757970183205f95f026e20a8090
2016-05-28 15:46:32 +08:00
Huanxuan Ao
b2a0e633eb Fix help message for "server group delete" command
"Server group delete" command supported deleting multi server
groups, but the help message was "Delete an existing server
group", so I change it in this patch.

Change-Id: I05b1a7e3f29b84b9190e7cc05c01734e3daa7a6d
2016-05-28 13:21:39 +08:00
jichenjc
460846cef2 [compute] Add server backup function
Add server backup function

There is no return value for this command per following doc
http://developer.openstack.org/api-ref-compute-v2.1.html#createBackup,
also novaclient can't be updated now due to backward compatible issue
http://lists.openstack.org/pipermail/openstack-dev/2016-March/089376.html,
so we have to get the information ourselves.

The Image tests were not using warlock images, so that needed to be fixed
before we could completely test things like --wait.

Change-Id: I30159518c4d3fdec89f15963bda641a0b03962d1
2016-05-27 11:47:25 -05:00
Tang Chen
5398c96e2a Fix i18n support for help and error messages in compute
Change-Id: Id6eebcb48d1b7b49b6636524506294edbc44a83f
Partial-bug: #1574965
2016-05-24 11:03:49 +08:00
Jenkins
35ea7a9baa Merge "remove #noqa from i18n imports" 2016-05-19 09:08:57 +00:00
Jenkins
948c76b0a4 Merge "Support X.latest format for OS_COMPUTE_API_VERSION" 2016-05-16 22:57:28 +00:00
Steve Martinelli
ebcbd6ba71 remove #noqa from i18n imports
hacking checks no longer fail on `import _`

Change-Id: Idd60f0a0e71e5081691eacb39e5091ab08fcce6d
2016-05-13 13:14:02 -07:00
Jenkins
b60ff95edf Merge "Use find_resource() instead of get() in _prep_server_detail()" 2016-05-11 13:26:30 +00:00