267 Commits

Author SHA1 Message Date
Jenkins
b7b140df06 Merge "Pass security group id to novaclient while adding security group to server" 2016-07-29 13:21:20 +00:00
Rajasi Kulkarni
e26eecc12f Pass security group id to novaclient while adding security
group to server

In AddServerSecurityGroup, we currently pass the security group
name to novaclient. If multiple security groups with same name
exist, then even while passing secuity group using id to
command 'openstack server add security group <server> <group>'
it results in error 'Multiple security_group matches found'.
Added unit test case to test the command.

Change-Id: I6097eb36e1545c85209cfd767c477e10f82c6999
Closes-Bug: 1604076
2016-07-28 21:39:02 +05:30
Elena Ezhova
b50c2b6a88 Allow setting quotas for server groups and server group members
Adds support of --server-groups and --server-group-members options
to the "quota set" command.

Change-Id: I178d1e267d010be7e908adefcf3b15abdafd9da4
Closes-Bug: #1602223
2016-07-27 13:04:36 +03:00
Jenkins
7a667d700f Merge "Use identity fake classes instead of old unit tests data" 2016-07-26 15:13:20 +00:00
Jenkins
0181709222 Merge "Use assertEqual() instead of assertDictEqual()" 2016-07-26 12:51:06 +00:00
Huanxuan Ao
1b2ea91420 Use identity fake classes instead of old unit tests data
Use FakeProject, FakeDomain and FakeUser classes instead
of old test data in image, compute and volume. (This work
has done in network)

Change-Id: Ic37d5d9db98f0f2acc6c714a9646063dcbde4ff3
Partially-Implements: blueprint use-fake-project
2016-07-26 18:38:12 +08:00
Jenkins
566b8566c0 Merge "Standardize import format" 2016-07-26 07:22:27 +00:00
Tang Chen
bcaa5c2e0e Use assertEqual() instead of assertDictEqual()
In unittest2, assertDictEqual() is implemented by
using != operator to compare two dicts. So is
assertEqual() in testtools. assertEqual() in
testtools is able to handle dict, list, set and
so on. So we just call assertEqual() to make the
unit tests simpler.

Change-Id: Ice343b2ce468acae39d2ad79f7121503e3627656
2016-07-25 15:09:49 +08:00
Jenkins
719c5d79ce Merge ""server list": "Image Name", "Image ID" columns" 2016-07-22 20:38:20 +00:00
Jenkins
b59ade75e5 Merge "Support to get server rdp/serial/mks type console url" 2016-07-22 12:22:34 +00:00
shizhihui
f996138a0d Standardize import format
According to the rule in
http://docs.openstack.org/developer/hacking/#imports
I modify some irregular import format.

Change-Id: Ibf29ccaf3ddec4a956334cc3368ebee7a66e282c
2016-07-22 19:24:02 +08:00
Jenkins
831301e5d6 Merge "Add Support for showing flavor access list" 2016-07-22 09:11:42 +00:00
Huanxuan Ao
b0c317ebdd Add Support for showing flavor access list
Add a attribute "access_project_id" for flavor object to
display the access project id list by using "flavor show"
command.

Change-Id: I7f0c152b816e0ca2e32e47f9b5c1aa7663d33b6d
Closes-Bug:#1575461
2016-07-22 10:20:18 +08:00
Rui Chen
cf20225347 Support to get server rdp/serial/mks type console url
The patch add the support to get server rdp/serial/mks
type console url, that make osc capability equal with
current nova server side feature.

Change-Id: I3dee2531c68563725187c8251d5ea8d4c02cca0c
Closes-Bug: #1605088
2016-07-21 15:43:01 +08:00
Jenkins
360853b51f Merge "Add unit tests for "host list" and "host show" commands" 2016-07-21 03:35:15 +00:00
Jenkins
beaa06138e Merge "Pass security group id to novaclient" 2016-07-18 18:35:15 +00:00
Jenkins
52cb503fb0 Merge "Modify compute agent set command" 2016-07-14 09:22:21 +00:00
Rajasi Kulkarni
8405db900f Pass security group id to novaclient
In RemoveServerSecurityGroup we currently pass the entire security
group object, which results in TypeError in novaclient.
Added unit test case to test command 'openstack server remove
security group -h <server> <group>'

Change-Id: I6d486403a83804c3a30d6f89d2cf7f64f09797c6
Closes-Bug: 1590883
2016-07-11 22:34:35 +05:30
sunyajing
25bdf6811c Modify compute agent set command
Migrate ``compute agent set`` arguments: version, url, md5hash
to be optional.

BackwardsIncompatibleImpact

Change-Id: I092b7ed24274bafa548f0537c4586504be3a2825
Co-Authored-By: Huanxuan Ao <huanxuan.ao@easystack.cn>
2016-07-11 18:07:34 +08:00
zheng yin
527b2030fb Add notes, modify notes in fakes docstring
Some code has no notes, then add them
Some code notes are not perfect, then improve them
Some code notes are incorrect, then modify them

Change-Id: I43f9a8663ae138bdd494bc234c1fac00c2dd6c95
2016-07-08 18:36:11 +08:00
zheng yin
cc9efea9e0 modify notes in the FakeHypervisorStats docstring
The arugments should be: count and current_workload

Change-Id: I445d1d72d1f1b86a626bb4c9512cdb8311b2ebc9
2016-07-07 14:10:32 +00:00
Marc Abramowitz
b74be57300 "server list": "Image Name", "Image ID" columns
The `Image Name` column is shown by default (i.e.: without passing `--long`). E.g.:

```
$ openstack server list
WARNING: openstackclient.common.utils is deprecated and will be removed after Jun 2017. Please use osc_lib.utils
+--------------------------------------+-----------------+---------+----------------------+----------------------+
| ID                                   | Name            | Status  | Networks             | Image Name           |
+--------------------------------------+-----------------+---------+----------------------+----------------------+
| abe67035-b14f-4541-b436-e0e778ec4227 | n9anonw302mgm1  | ACTIVE  | mnky3-3000=10.3.0.55 | Koala.2016-07-01-175 |
| 8f6a2d12-2bc3-4d89-ba94-8916ce9cdf92 | n9anonw301mgm1  | ACTIVE  | mnky3-3000=10.3.0.37 | Koala.2016-07-01-175 |
| b316d6d1-67cf-4f75-94a4-4c9a2b03f6a4 | n9dobby301mgm0  | ACTIVE  | mnky3-3000=10.3.0.36 | Koala.2016-05-04-130 |
+--------------------------------------+-----------------+---------+----------------------+----------------------+
```

The `Image ID` column is only available with `--long`. E.g.:

```
$ openstack server list --long -c Name -c "Image Name" -c "Image ID"
WARNING: openstackclient.common.utils is deprecated and will be removed after Jun 2017. Please use osc_lib.utils
+-----------------+----------------------+--------------------------------------+
| Name            | Image Name           | Image ID                             |
+-----------------+----------------------+--------------------------------------+
| n9anonw302mgm1  | Koala.2016-07-01-175 | f587c6fc-1df3-42cd-ac86-8cd2c995a8d9 |
| n9anonw301mgm1  | Koala.2016-07-01-175 | f587c6fc-1df3-42cd-ac86-8cd2c995a8d9 |
| n9dobby301mgm0  | Koala.2016-05-04-130 | 37ff47a6-3e51-4986-bfa5-62afbfad5dfc |
+-----------------+----------------------+--------------------------------------+
```

Closes-Bug: #1599304

Change-Id: I477995b840eb9520b285948926ebbfe1777dd86c
2016-07-06 07:11:17 -07:00
Jenkins
7f8999bf54 Merge "Transfer "ip fixed add/remove" to "server add/remove fixed ip"" 2016-07-06 13:59:32 +00:00
Jenkins
2b8213df88 Merge "Transfer "ip floating add/remove" to "server add/remove floating ip"" 2016-07-06 13:59:06 +00:00
Jenkins
8d5a0fd86e Merge "Transfer "ip floating pool list" to "floating ip pool list"" 2016-07-06 13:50:32 +00:00
gecong1973
6115dfe9f8 fix a few spelling mistakes
- overwriten should be overwritten
 - retrun should be return

Change-Id: I1567402f4d5c7253e6a54d8753e3f201af7e6a54
2016-07-04 15:15:23 +00:00
Tang Chen
179ebe6d64 Transfer "ip fixed add/remove" to "server add/remove fixed ip"
This patch does the following things to transfer
"ip fixed add/remove" to "server add/remove fixed ip":
* Add new command "server add/remove fixed ip", and unit
  tests and doc.
* Deprecate "ip fixed add/remove" command.

compute/v2/fixedip.py is not removed because the arguments'
positions are different between the new and old commands.
* ip fixed add <network> <server>
  server add fixed ip <server> <network>
* ip fixed remove <ip-address> <server>
  server remove fixed ip <server> <ip-address>

Change-Id: Ica07ccf92a76c21fd5608ecaff86ff7c4d96f5a0
Implements: blueprint rework-ip-commands
Partial-bug: 1555990
Co-Authored-By: Dean Troyer <dtroyer@gmail.com>
2016-07-04 10:41:30 +08:00
Tang Chen
d1f9ea3f75 Transfer "ip floating add/remove" to "server add/remove
floating ip"

This patch does the following things to transfer
"ip floating add/remove" to "server add/remove floating ip":
* Add new command "server add/remove floating ip", and unit
  tests and doc.
* Deprecate "ip floating add/remove" command.

compute/v2/floatingip.py is not removed because the arguments'
positions are different between the new and old commands.
* ip floating add <ip-address> <server>
  server add floating ip <server> <ip-address>
* ip floating remove <ip-address> <server>
  server remove floating ip <server> <ip-address>

Change-Id: Ic0dd22ca6fb7b7bc3e820fd5a14d7c551e7ab963
Implements: blueprint rework-ip-commands
Partial-bug: 1555990
Co-Authored-By: Dean Troyer <dtroyer@gmail.com>
2016-07-04 10:40:59 +08:00
Tang Chen
50bd56db25 Transfer "ip floating pool list" to "floating ip pool list"
This patch does the following things to transfer
"ip floating pool list" to "floating ip pool list":

* Add a new command "floating ip pool list" to deprecate
  "ip floating pool list". The source code is in network/v2
  dir.
* Add doc for "floating ip pool list".
* Add floating ip pool unit tests.

Change-Id: Id410f4e4a96cf589a6e8def209574da71395b55f
Implements: blueprint rework-ip-commands
Partial-bug: 1555990
Co-Authored-By: Dean Troyer <dtroyer@gmail.com>
2016-07-04 10:40:00 +08:00
Jenkins
ba6951222a Merge "Add "--property" option to "flavor create" command" 2016-06-30 10:36:55 +00:00
Huanxuan Ao
dbed97a24d Add "--property" option to "flavor create" command
Add "--property" option to "flavor create" command to support
adding properties to a new falvor.

Change-Id: I4f06b364375d5a81584fe41122d48e9568fa712a
Closes-Bug: #1596798
2016-06-29 19:16:35 +08:00
Huanxuan Ao
af7ab03693 Support bulk deletion for delete commands in computev2
Support bulk deletion and error handling for "keypair delete"
and "service delete" commands in computev2.
Up to now, all the delete commands in computev2 support bulk
deletion.

Change-Id: I6d5c960e9716188e56615514d0921618a15a88ec
Partially-Implements: blueprint multi-argument-compute
Partial-Bug: #1592906
2016-06-27 20:39:23 +00:00
Huanxuan Ao
5951026bf2 Add unit tests for "host list" and "host show" commands
Missing unit tests for "host list" and "host show" commands
in computev2, this patch add them.

Change-Id: Ib157920fa2267ec96d206cdf46213563a105501b
2016-06-27 09:51:29 +08:00
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
Jenkins
dea859430a Merge "Modify unit tests of compute agent delete" 2016-06-17 17:31:07 +00: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
d3cd322650 Merge "Support bulk deletion for commands that exist in both network and compute." 2016-06-15 16:54:10 +00:00