1538 Commits

Author SHA1 Message Date
OpenStack Jenkins
375166cb59 Merge "Updated from global requirements" 2014-04-08 21:08:25 +00:00
Jenkins
465919953d Merge "Fix session handling in novaclient" 2014-04-08 01:54:52 +00:00
OpenStack Jenkins
f6cda643fe Updated from global requirements
Change-Id: I123a065193ea330d71afe2fd2ee3fdcbcbd4a88b
2014-04-07 21:27:22 +00:00
Jenkins
37df0510ef Merge "Print adminPass when rebuilding from shell" 2014-04-07 18:51:30 +00:00
Jenkins
055a18fcd8 Merge "Remove py3kcompat" 2014-04-07 18:18:21 +00:00
Boris Pavlovic
98934d7bf1 Fix session handling in novaclient
Prior to this patch, novaclient was handling sessions in an inconsistent
manner.

Every time we created a client instance, it would use a global
connection pool, which made it difficult to use in a process that is
meant to be forked.

Obviously sessions like the ones provided by the requests library that
will automatically cause connections to be kept alive should not be
implicit. This patch moves the novaclient back to the age of a single
session-less request call by default, but also adds two more
resource-reuse friendly options that a user needs to be explicit about.

The first one is that both v1_1 and v3 clients can now be used as
context managers,. where the session will be kept open (and thus the
connection kept-alive) for the duration of the with block. This is far
more ideal for a web worker use-case as the session can be made
request-long.

The second one is the per-instance session. This is very similar to what
we had up until now, except it is not a global object so forking is
possible as long as each child instantiates it's own client. The session
once created will be kept open for the duration of the client object
lifetime.

Please note: client instances are not thread safe. As can be seen from
above forking example - if you wish to use threading/multiprocessing,
you *must not* share client instances.

DocImpact

Related-bug: #1247056
Closes-Bug: #1297796
Co-authored-by: Nikola Dipanov <ndipanov@redhat.com>
Change-Id: Id59e48f61bb3f3c6223302355c849e1e99673410
2014-04-07 19:38:51 +02:00
Johannes Erdfelt
496e39a260 Print adminPass when rebuilding from shell
The 'nova rebuild' command did not print the adminPass returned by the
server. This is because it discards the instance information returned
by the rebuild action and fetchs the information again. This would lose
the adminPass and it would not be printed for the user.

This patch reuses the instance information returned by the rebuild action
which ensures that the adminPass is printed by the shell.

Change-Id: I144bfa298bef529c78ca04042cd37a763537f09e
Closes-bug: 1302696
2014-04-04 13:21:54 -07:00
Johannes Erdfelt
04fdf97b35 Remove py3kcompat
It's not used by novaclient anymore and isn't used by any other
openstack common code either.

Change-Id: I96ebf030d0a96436a8a75c6937c354003ee32c58
Closes-bug: 1280033
2014-04-04 12:34:15 -07:00
Johannes Erdfelt
9162a5fe8f Split test_rebuild() into two tests
The method tests rebuilds with and without passwords, but the tests are
independent and should be in two seperate tests.

Also, remove duplication of the rebuild with password test from
test_rebuild_preserve_ephemeral

Change-Id: I40d0376fabf319dbe703d593de8fb4cdcf0aeab1
2014-04-04 10:57:40 -07:00
Jenkins
2005e17bed Merge "Raise exception when poll returns error state" 2014-04-02 20:10:36 +00:00
Jenkins
f70d7b8916 Merge "Fix for invalid literal ValueError parsing ipv6 url(s)" 2014-04-02 14:40:00 +00:00
Jenkins
297ebde1d3 Merge "Explain how to delete a metadata in aggregate-set-metadata" 2014-04-02 04:55:51 +00:00
Jenkins
a002abc060 Merge "Remove quota-class subcommand" 2014-04-01 23:09:17 +00:00
Jenkins
b5f800fd54 Merge "Add service-list show id column" 2014-04-01 17:49:54 +00:00
Jenkins
0586260407 Merge "Avoid AttributeError in servers.Server.__repr__" 2014-03-31 22:05:20 +00:00
Jenkins
ec7e95d65e Merge "Remove unused arguments to _boot()" 2014-03-31 18:00:30 +00:00
Davanum Srinivas
9344f02649 Fix for invalid literal ValueError parsing ipv6 url(s)
Switch to using network_utils for splitting the URL. The code
in oslo-incubator supports ipv6 urls

HEAD of oslo-incubator is bb52a3fc49f033b9f36238231ca56e754a78cf4b

Updated openstack-common.conf to pick up the new dependency from
oslo-incubator

Change-Id: Ifa3dec384e85942a191260d17e8141030d31ff84
Closes-Bug: #1298137
2014-03-29 14:16:02 -04:00
Jenkins
d85c24ff5a Merge "Fix error when run with no arguments on Python 3" 2014-03-28 20:31:50 +00:00
Jenkins
fce239650f Merge "typo in novaclient" 2014-03-28 19:07:00 +00:00
Jenkins
6cbf00db25 Merge "Support building wheels (PEP-427)" 2014-03-28 18:56:47 +00:00
Johannes Erdfelt
17a8b78eec Remove unused arguments to _boot()
reservation_id, min_count, max_count are never specified by any callers.
Remove the arguments and the code that checks the values.

Change-Id: I3794fd1eabbfb999c422c701af1ff64cd667313f
2014-03-27 19:15:14 -07:00
Shuangtai Tian
8475ada28c typo in novaclient
Change-Id: If30543ed7c94cd965f1d6b7f0d4af26b23914ba2
2014-03-28 09:55:44 +08:00
Sergey Lukjanov
21f166b623 Start using oslosphinx theme for docs
Change-Id: Ic327d9752e9c77e6543f23b032c8b77abd6ed479
2014-03-26 15:42:03 +04:00
Johannes Erdfelt
656cf91f89 Fix error when run with no arguments on Python 3
Python 3 changed the map built-in to return an iterable instead of a list.
When tested in a boolean context, this always returns True, even if it
would not return anything when iterated.

Instead of the usage being printed, this error was printed:
ERROR: 'Namespace' object has no attribute 'func'

Use list comprehension instead to ensure that an iterable isn't returned

Change-Id: Ie15f2fa8ee93ab26490e371133fa0f944430737b
Closes-bug: 1295356
2014-03-25 08:49:05 -07:00
Jenkins
733f1e58d8 Merge "Fix authentication bug when booting an server in V3" 2014-03-25 05:33:57 +00:00
ZhiQiang Fan
6fbddcb4b6 Avoid AttributeError in servers.Server.__repr__
servers.Server represents various object now, and some of them may
don't have attribute 'name', for example, the interface_list() result
object. It will cause AttributeError when we try to format string with
such object, so I add a check for the 'name' attribute in __repr__
method, it will use 'unknown-name' instead when 'name' is not found.

Change-Id: If4757d5d73721774543d58a4cc875710a6013f34
Closes-Bug: #1280453
2014-03-25 10:54:10 +08:00
Jenkins
94a4c49de0 Merge "Print a useful message for unknown server errors" 2014-03-22 09:20:20 +00:00
Jenkins
6e3b2878a1 Merge "Show Exception Name in Shell Output" 2014-03-22 09:09:08 +00:00
Jenkins
5bd3bbf8f1 Merge "Correct the help sting of volume-type-delete" 2014-03-22 08:09:34 +00:00
Jenkins
8ecc6b3eff Merge "Allow user ID for authentication" 2014-03-21 19:51:23 +00:00
Ryan Hallisey
d01b3abdb0 Raise exception when poll returns error state
When running nova boot --poll, any error states that occur will be
seen but, an exit code of 0 will be returned indicating success.
This would be problematic for scripts looking to see if an
operation completed successfully.

To fix this, an exception is raised after the nova api indicates to the
poll code that the vm is in an error state. The exceptions signals the shell
main function to exit with code 1.

Change-Id: I48f6b1c82e2f8b221dda898dcb804b0196018505
Fixes-Bug: #1292669
2014-03-21 11:59:58 -04:00
Jenkins
1d86d86bc8 Merge "Fix element miss in client request body" 2014-03-21 15:52:23 +00:00
Jenkins
159d3e4dbf Merge "Re-add install_venv_common to openstack-common.conf" 2014-03-21 15:47:10 +00:00
liu-sheng
596d7d5675 Correct the help sting of volume-type-delete
Change-Id: I10b1bd6d42e4085dc73572f05ed893385ca3e139
2014-03-21 15:28:45 +08:00
Jenkins
1128298460 Merge "Do auth_url.rstrip('/') only if auth_url is set" 2014-03-21 06:27:38 +00:00
OpenStack Jenkins
a63729fe55 Merge "Updated from global requirements" 2014-03-21 06:15:00 +00:00
Johannes Erdfelt
e43825bd1c Print a useful message for unknown server errors
If a server error is returned that has an unknown code, novaclient will
end up printing something similar to:

ClientException: <attribute 'message' of 'exceptions.BaseException' objects>

Setting a message for ClientException will ensure that something more
useful than that is printed.

Change-Id: I43a2a33017f9a5c1b79d7fd8af4153e91d296f7b
Closes-bug: 1295293
2014-03-20 15:54:19 -07:00
Solly Ross
0b1a29e7b0 Show Exception Name in Shell Output
Currently, when the CLI encounters an exception, only the exception
message is shown.  However, the name of the exception can be quite
informative as well.

For instance, an error message might read "Cannot do xyz", which
simply indicates the operation was unsucessful.  However, the attached
exception name (HTTPNotImplemented, for instance) indicates the
*reason* that the call was unsuccessful.

Change-Id: I0298477bd9d40d98c95bb797c68c47dbc952b345
2014-03-18 17:23:18 -04:00
Kevin L. Mitchell
8c7524b8bf Work around pypy testing issue
A recent release of setuptools appears to have introduced a bug that
causes the pypy gate tests to fail.  This applies a temporary workaround
that should restore pypy testing while the root cause of the problem is
researched.

Change-Id: I66597e40c1d2e57cca1292844d228af85214197d
Partial-Bug: 1290562
2014-03-18 11:37:57 -05:00
OpenStack Jenkins
4e8dea6745 Updated from global requirements
Change-Id: Ibb039ec440a513a49cbcf05daa69ac8785770035
2014-03-18 08:52:05 +00:00
Arata Notsu
4cfaa4a61c Do auth_url.rstrip('/') only if auth_url is set
auth_url can be None, for example, when we use bypass_url.

Also, add rstrip('/') for bypass_url (and management_url), which
is done when management_url is gotten from service catalog.

Change-Id: I4f59cc405386a15f8a266d279b27f279eacdb7f1
2014-03-18 11:25:05 +09:00
gtt116
99aa0273dc Explain how to delete a metadata in aggregate-set-metadata
nova aggregate-set-metadata not given value of a key means delete the
metadata, so explain this usage in help message.

Change-Id: Ie8215bd8b47ed00e3d4686edab9e3052ae84774d
2014-03-14 23:37:02 +08:00
Jenkins
14deb0194e Merge "Removes copy of output of 'nova help' from README" 2014-03-13 22:50:23 +00:00
Gary Kotton
c40891b282 Nova CLI for server groups
CLI support for blueprint instance-group-api-extension

REST API support:- https://review.openstack.org/#/c/62557/

DocImpact
 - supports create, list, get and delete
 - only V2 is supported

Change-Id: Iaa5a2922b9a0eed9f682b7584c2acf582379b422
2014-03-13 04:14:11 -07:00
Chris Yeoh
ec6a5e803c Removes copy of output of 'nova help' from README
Removes the copy of the otuput of 'nova help' from the README.rst
file. It's out of date and given its not autogenerated is
rather prone to getting out of date again soon anyway. Just leave
the command that people need to run in order to print the help message.

Change-Id: I3cd069838302913bc69cc0ded5d632c7f8c3f408
2014-03-13 21:15:56 +10:30
Jenkins
c92485e703 Merge "Fix some spelling mistakes" 2014-03-08 18:01:41 +00:00
Haiwei Xu
02a091cc6c Fix authentication bug when booting an server in V3
Currently when booting a server with V3, novaclient sends an empty
os_password to image_cs. This will cause 401(Unauthorized: Invalid
user/password) when trying to find image. This is is a result of
changes nova's V3 API: nova is no longer used as a proxy for the
image service. So novaclient uses two Client instances: one for
nova, the other for image service. This patch checks os_password
before creating the image Client and assigns it if it's empty.

Change-Id: Ic54cef93e9b823fb98b1edd78776c9a1fc06ba46
Closes-Bug: #1277425
2014-03-08 05:54:39 +00:00
Jenkins
3393cb9ff8 Merge "Add os-server-external-events support" 2014-03-07 20:32:01 +00:00
Phil Day
dd8bde71ff Allow user ID for authentication
In Keystone V3 user names are no longer necessarily unique
accross domains.

A user can still authenticate a user in the non default
domain via the V2 API providng they use IDs instead of names.

Tenant_ID is already supported, this change adds support
for user ID

Change-Id: I36ba75f3e67c8cdb959e31923d5e557414ab6f9b
2014-03-07 19:24:22 +00:00
Dan Smith
04a123cdee Add os-server-external-events support
This adds support for the os-server-external-events extension in nova,
which allows other services to deliver events to nova.

It also adds a shell command to trigger the "network-changed" event
manually, which will cause nova to refresh its network cache from
neutron.

Related to blueprint admin-event-callback-api

Change-Id: I1a302a43b6b7a6d8bdc03965a8f4c1a151bcab88
2014-03-07 06:51:57 -08:00