819 Commits

Author SHA1 Message Date
Jenkins
b6c6084ce3 Merge "Fix Serivce class AttributeError" 2014-02-10 01:20:13 +00:00
Alessandro Pilotti
55249f777c Adds support for the get_rdp_console API
Hyper-V employs RDP to access virtual machine consoles, unlike most
other hypervisors which support VNC.

In order to support this scenario, the get_rdp_console API has been
added to Nova. This commit adds the corresponding client side feature,
implemented in a way consistent with existing VNC and SPICE console
support.

Nova Gerrit commit: https://review.openstack.org/#/c/43502/

Change-Id: I86b814797d234f1eb49a7fa67ed27a9bcda034ae
Implements: blueprint hyper-v-rdp-console
2014-02-08 20:15:37 +00:00
Andrew Lazarev
6e116a1532 Fixed polling after boot in shell
+ Added unit test to test that poll method is called.
  Testing of poll method itself is out of this CR scope.

Change-Id: I57adb80bacd76b0831ea63f74182f60a2033ab11
2014-02-05 16:47:19 -08:00
Masayuki Igawa
5e3a3a193b Fix Serivce class AttributeError
When we str(service_object), an AttributeError occurred like this:
========================
  File "/opt/stack/python-novaclient/novaclient/v1_1/services.py", line
24, in __repr__
    return "<Service: %s>" % self.service
  File
"/opt/stack/python-novaclient/novaclient/openstack/common/apiclient/base.py",
 line 463, in __getattr__
    raise AttributeError(k)
AttributeError: service
========================
This commit fixes it.

Change-Id: I496d522591273bf1b1e7dbadf19afaf5e64e41e3
Closes-Bug: #1276408
2014-02-05 13:31:33 +09:00
Andrew Lazarev
d979754704 [UT] Fixed floating_ip_pools fake return to expected one
It seems that author wanted to return two pools. But because of typo,
method now returns only one of them. Fixed typo to return two pools.

Change-Id: Ia77a8529fd4db1b06860073ebf33bd54b43438cd
2014-02-04 16:20:03 -08:00
Andrew Lazarev
bd09342779 [UT] Removed duplicate key from dict in fake baremetal_node
Python takes only the last value if several keys with the
same name listed. Removed the first one to make value evident.

Change-Id: I6cef783ff245073b4c0fde0e4d60ff69fb02fc22
2014-02-04 16:13:33 -08:00
Andrew Lazarev
788e05c0df Fixed multi validation and wrong fail calls in unit tests
* Positive test was calling the same check several times. Replaced
  with one call.
* Negative test was failing with "'object has no attribute 'assertFail'"
  error message in case of failure. Replaced with appropriate message.

Change-Id: Id03a452f7735d6b4d13f54036f1bd3ae50cb487a
2014-02-04 16:00:14 -08:00
Andrew Lazarev
d218088c22 Fixed super constructor call for TestResponse class
Change-Id: Idbd436d63af152d4a73e747bf00a82fc0308a036
2014-02-04 14:39:54 -08:00
Sergio Cazzolato
fc8579dfa8 Flavor ExtraSpecs containing '/' cannot be deleted
This change applies a regular expression in order to filter
flavor extraspects keys with invalid characters.
The characters allowed are: letters, numbers, underscores,
periods, colons, spaces and hyphens.
A new test flavor has been created which doesn't check the
keys in the post body. This flavor has been created in the
third place (instead of in the last) in order to keep
working existent test cases which depend on the last flavor
received in the get method.

Change-Id: Ifd86bed23a05a5946ae8b9ba6f6c9bf4b24b1d4c
Partial-Bug: #1256119
2014-01-31 17:38:19 -05:00
Chris Yeoh
c8ad315763 Adds ability to boot a server via the Nova V3 API
Creates an images client when attached to the the servers
client. This is necessary because the Nova V3 API no longer
proxies image queries to glance but when preparing a request to
boot a server it is necessary to retreive information about
images so we need to talk to both Nova and Glance in the same
command.

This is a bit ugly, but not much more than the already existing
ugliness of using the client class designed to talk to
Nova to talk to Glance and Cinder. The long term clean solution
is probably to a unified client that is designed to talk to
multiple openstack services.

Differences between the V2 and V3 API are described here:
https://wiki.openstack.org/wiki/NovaAPIv2tov3

Partially implements blueprint v3-api

Change-Id: Ib43682f38cd7a3e0f910b75e96685591246e7f67
2014-01-28 23:29:16 +10:30
Jenkins
20c4226725 Merge "Adds volume support for the V3 API" 2014-01-25 18:35:18 +00:00
Jenkins
292afcdbaf Merge "Fix QuotaClassSet and their tests" 2014-01-25 18:35:17 +00:00
Jenkins
01eff2319a Merge "Add tests for boot method of v3 shell" 2014-01-25 18:16:31 +00:00
Jenkins
1e32538cff Merge "Using common methods from oslo cliutils" 2014-01-24 21:06:18 +00:00
Jenkins
08a19c7520 Merge "Updates nova client to use the latest oslo files" 2014-01-24 21:00:48 +00:00
Jenkins
e3d686f39a Merge "Replace basestring by six.string_types" 2014-01-24 07:00:06 +00:00
Sahid Orentino Ferdjaoui
a5195c5033 Updates nova client to use the latest oslo files
This patchset updates modules based on the config file:
openstack-common.conf

Notes: Some corrections has been added to work with
new files.
  + utils.py: The method safe_decode from strutils.py
    was updated and it is now not necessary to check for
    decode string with py33.
  + base.py: base64 needs a 8-bit string for py33
  + test_shell.py: stdin.encoding is needed for strutils

Change-Id: Iebe474f1226f8b5faa7fb5722e65f41b80d1973c
Related to blueprint common-client-library-2
Closes-Bug: #1265473
2014-01-23 18:08:03 +00:00
Sahid Orentino Ferdjaoui
da11e62216 Using common methods from oslo cliutils
There are some common methods in cliutils we can use in novaclient:
 arg, env, unauthenticated, isunauthenticated.

 + Replaces utils.env to add alias env from cliutils.
 + Replaces utils.arg to add alias arg from cliutils.
 + Removes unused methods: add_arg, unauthenticated, isunauthenticated
   To use methods from clituils.

Related to blueprint common-client-library-2
Change-Id: Ic7c132c37d6a91cf3eae55530300efd153c31903
2014-01-23 09:53:42 +00:00
Jenkins
daa33c56c9 Merge "Fix logic for "nova flavor-show 0#"" 2014-01-23 01:55:54 +00:00
Andrey Kurilin
6ff02390a2 Add tests for boot method of v3 shell
Methods `do_boot` and `_boot` in v3.shell don't have tests at all.

Partially implements bp v3-api

Change-Id: Ic231f829459f22f26d1262d208cc4fc9cbb8676e
2014-01-22 12:17:52 +02:00
Jenkins
00ceee190b Merge "Allow multiple volume delete from cli like Cinder" 2014-01-22 03:45:50 +00:00
Andrey Kurilin
99e289ea86 Replace basestring by six.string_types
Method shell._boot uses class basestring instead of six.string_types.
Tests don't check this method with several hints, so we didn't have
NameError in py33 env.

Change-Id: I9b35cd7ba162140a15929f9fc8a6d21755b3570c
2014-01-21 18:09:15 +02:00
Jenkins
2383ae4bcc Merge "assertTrue(isinstance) replace by assertIsInstance" 2014-01-21 10:07:58 +00:00
Jenkins
e2b1de000a Merge "Don't call CS if a token + URL are provided" 2014-01-21 10:07:56 +00:00
Jenkins
9298a2a297 Merge "Removes use of timeutils.set_time_override" 2014-01-20 05:25:28 +00:00
Jenkins
4ab3686b32 Merge "add support for server set metadata item" 2014-01-19 00:56:41 +00:00
Zhongyue Luo
c71131a509 Removes use of timeutils.set_time_override
The set_time_override function in timeutils was written as a
helper function to mock utcnow for unittests before 'mock' was
generally used. Now that we have mock and fixture, we no longer
need to use it.

Change-Id: I809825560b0324498010bd93aa1ceef552554375
Partial-Bug: #1266962
2014-01-17 03:29:49 +00:00
Masayuki Igawa
27de89af5f Fix logic for "nova flavor-show 0#"
For perviously logic, if flavor id is
start with "0Number", int(name_or_id)
will convert it to "Number". If flavor
id "Number" exist in DB, it will show
up for query with "0Number".
This fix enter flavor search logic at
the beginning. Also add one more UT
for this function.

Change-Id: Ic48ff4275978404064c0c6fce6f98181660aa84a
Fixes: bug 1268456
2014-01-17 10:09:26 +08:00
Alexis Lee
bd9ebc5d27 Don't call CS if a token + URL are provided
Adds --os-auth-token (matching Glance client at least) to accept a
pre-obtained authentication token.

CS will be called iff:
      One or both of token and URL are not provided;
  AND the cache is empty/disabled or we don't have a tenant-id.

Removed some code altering the auth request to a GET if a token is
supplied - did not work for me and I think the path was dead previously.
Fixed test to account for this change.

Completes blueprint token-endpoint-instantiation

Change-Id: I67410b80e506bb80c152223cd113b7139a62a536
2014-01-15 17:11:35 +00:00
Masayuki Igawa
ee0401585d Fix QuotaClassSet and their tests
Some parameters of quota_class_set are not used in Nova v1.1/v2 API. And
some items have wrong type and key name.
QuotaClassSet class has id property originally. But 'id' comes from Nova
API currently. So we can just use it as its id.

This commit fixes and cleanups them.

Change-Id: Ib963ff82e3107d7b78a3a63a2fc1cd6b6bbe47b0
2014-01-15 18:58:11 +09:00
lizheming
40e433469d assertTrue(isinstance) replace by assertIsInstance
some of tests use different method of assertTrue(isinstance(A, B))
or assertEqual(type(A), B). The correct way is to use
assertIsInstance(A, B) provided by testtools

Closes-Bug: #1268480
Change-Id: Ie3b3e49ea3cc4357a65605ad54ff4ee1fbde12c7
2014-01-15 10:49:12 +08:00
Masayuki Igawa
8e9c038f15 Remove the coverage extension code
The coverage extension has been removed from Nova V2 API by the
        I07d798129ee277a6f7691c25f88c07a5204c0943
This commit remove the code.

Change-Id: I430a8b17be11bb961dc5b89b2d098f373e0a27fa
2014-01-14 09:14:11 +09:00
Jenkins
1a20d2964d Merge "Ensure that the diagnostics are user friendly" 2014-01-13 14:40:11 +00:00
Jenkins
77bde21154 Merge "Adds quota usage support for the V3 API" 2014-01-13 01:15:46 +00:00
Jenkins
16c5337e79 Merge "Ensure that nova client prints dictionaries and arrays correctly" 2014-01-11 15:47:54 +00:00
Jenkins
220c10d75b Merge "Support list deleted servers for admin" 2014-01-11 13:16:21 +00:00
Chris Yeoh
61d88463da Adds volume support for the V3 API
Adds the ability to attach, detach and swap volumes on
servers. There is no code shared with the v1_1 version
because for V3 the volumes interface is completely different
and the attach/detach/swap functionality is simply a server
action rather than something accessed through a special resource.

Partially implements blueprint v3-api

Change-Id: Ib405f821fe557745d11cff9db08381fc15233fe5
2014-01-11 13:53:10 +08:00
Jenkins
5a65f40d1f Merge "Removes vim configuration headers" 2014-01-10 06:12:49 +00:00
gtt116
0d00603f12 Support list deleted servers for admin
Nova api supported a parameter named 'deleted' which allow Admin to list
deleted servers. This patch make novaclient support this.

Change-Id: Ifc492fd0ba9d885e37c04c165d6397832ae6ebe0
Closes-Bug: #1266631
2014-01-08 09:40:21 +00:00
Sahid Orentino Ferdjaoui
4f92f7ba02 Using floating-ip-{associate|disassociate}
This patch implements a blueprint to add more consistency into
nova command, especially for the subcommand "floating-ip-*"

Currently when we want to associate or disassociate an ip with
nova we have to use add-floating-ip and remove-floating-ip. This
is not consitent with the actual scheme of the subcommands:

example:
  nova image-*
  nova flavor-*
  nova floating-ip-*

 + In the client v1.1 this patch displays a deprecated message when printing
   the help message for add-floating-ip and remove-floating-ip.
 + In the client v3 this patch do nothing because all floating ip commands are being
   removed.

$:~/python-novaclient$ nova help | grep floating
    add-floating-ip     DEPRECATED, use floating-ip-associate instead.
    floating-ip-associate
                        Associate a floating IP address to a server.
    floating-ip-bulk-create
                        Bulk create floating ips by range.
    floating-ip-bulk-delete
                        Bulk delete floating ips by range.
    floating-ip-bulk-list
                        List all floating ips.
    floating-ip-create  Allocate a floating IP for the current tenant.
    floating-ip-delete  De-allocate a floating IP.
    floating-ip-disassociate
                        Remove a floating IP address from a server.
    floating-ip-list    List floating ips for this tenant.
    floating-ip-pool-list
                        List all floating ip pools.
    remove-floating-ip  DEPRECATED, use floating-ip-disassociate instead.

Implements: blueprint commands-floating-ip
Change-Id: I5337d0f1ce5ec4826da6ecd2b6ae4ae7b97801e0
2014-01-08 08:14:06 +00:00
Sahid Orentino Ferdjaoui
0ddcf11732 Removes vim configuration headers
- Removes vim headers: It's not needed to set tabstop tons of times,
   this can be done by setting vimrc.
 - I did not update files in common/* and install_venv_common.py because
   these files are sync with oslo.

Note:
  http://lists.openstack.org/pipermail/openstack-dev/2013-October/017353.html

Closes-Bug: #1265474
Change-Id: Ia09dc2c908187a756bf55eaba74655484304517d
2014-01-08 08:13:46 +00:00
Chris Yeoh
db6c58b009 Adds quota usage support for the V3 API
Adds the ability to do a detailed query from the
os-quota-sets V3 API extension. This was an interface
added in V3 to allow for the querying of current quota
usage. Adds a shell command quota-usage which
uses this interface to show current quota usage as well
as the limit.

The absolute limits response was removed from
the limits extension in a9e29b7e9fbe14ab42f24802a6d2a457a6317ba3
and so the corresponding novaclient command is also removed.
The "quota-show-usage" command now shows the same information.

Differences between the V2 and V3 API are described here:
https://wiki.openstack.org/wiki/NovaAPIv2tov3

Partially implements blueprint v3-api

Change-Id: I5db72d42120f4ad7a86fbfce20382988f6bbf5d3
2014-01-08 12:00:53 +08:00
Ken'ichi Ohmichi
d664f0f672 Remove class_name parameter from quota_class
class_name parameter is not used in both Nova v1.1/v3 API.
Nova considers the part of url as class_name.
For example, bar is considered as class_name in the following case:
 curl -i 'http://localhost:8774/v3/os-quota-class-sets/bar' -X PUT ..

This patch removes this unused paramter from quota_class.

Change-Id: Id4eba5b2a17506bc04ea23ef1097ef9cdb9caf8a
2014-01-07 03:52:42 +09:00
Gary Kotton
875cf42fff Ensure that the diagnostics are user friendly
In the case when the value is a dictionary or array or longer than
the line then the diagnostics output will automatically wrap around
to ensure that the output is user friendly.

Part of the blueprint v3-diagnostics

Change-Id: Ia158fd99aeb0e6296fb232e881d0f01a13407dfc
Closes-bug: #1266402
2014-01-06 08:09:46 -08:00
Jenkins
2a7caa8bdb Merge "Adds simple tenant usage support for the Nova V3 API" 2014-01-06 07:40:30 +00:00
Jenkins
49be47367f Merge "Nova aggregate-details should be more human friendly" 2014-01-02 21:23:06 +00:00
Jenkins
9521c63646 Merge "Expose the rebuild preserve-ephemeral extension" 2014-01-02 21:22:55 +00:00
Gary Kotton
5c62630a9d Ensure that nova client prints dictionaries and arrays correctly
Print the dictionaries and arrays without the unicode tags.

The patch also updated tests that did not return valid data.

Change-Id: Ia787f98a9510b68beb3ceaf00c285ca5c934f5c0
Closes-bug: #1265002
2013-12-31 05:17:00 -08:00
Jenkins
708af32f03 Merge "Fix "device" as the optional para on volume-attach" 2013-12-25 01:59:24 +00:00
Sahid Orentino Ferdjaoui
2c54f5a037 Nova aggregate-details should be more human friendly
'nova aggregate-details' shows Hosts, Availability Zone
and Metadata in the python unicode notation.

+ Adds some tests about aggregates ported from v1 to the
  v3 shell

Change-Id: I69d80b2e76833d78248dee782ae5e53f42a4f4a9
Closes-Bug: #1132961
2013-12-24 12:07:57 +00:00