182 Commits

Author SHA1 Message Date
Andrey Kurilin
9e6f99e2ab Use discover_extensions for novaclient
novaclien v2.26.0 includes `discover_extensions` method, which returns
list of all nova extensions based of version. Such method allows us to
reduce imports of novaclient's modules and construct novaclient instance
simpler.

Change-Id: Idbe3ed275fb4a7e3918b11669dcfad47b8de4fb9
2015-09-11 16:23:54 +03:00
Jenkins
0daa096939 Merge "Use a common decorator to log 'take_action' activation" 2015-09-11 02:43:54 +00:00
Jenkins
fa4b11a86f Merge "Add filtering by user for 'openstack server list'" 2015-09-10 20:19:43 +00:00
Jenkins
1e36b122f8 Merge "Add support for listing servers of other projects" 2015-09-10 20:18:45 +00:00
Andrey Kurilin
c513f05ce9 Use novaclient.client.Client for initialization Nova client
`novaclient.client.Client` is a recommended entry point for novaclient.
It supports backward-compatibility and allows Nova-folks to change
interfaces of inner versioned clients classes.

Change-Id: Iaf20714f63c307f88a451759f041ca509fbcf6f8
2015-09-09 18:00:50 +03:00
Jenkins
b4421e3802 Merge "Properly handle port arguments for ICMP" 2015-09-08 21:18:06 +00:00
kafka
10db0df857 Add filtering by user for 'openstack server list'
Add a new option to search by user when listing servers,
include support for domain scoped users, also update
docs

Co-Authored-By: Steve Martinelli <stevemar@ca.ibm.com>

Closes-Bug: #1483974
Change-Id: Ifdade6dc9ca8400fbd85f6b55793ab15ed17b97d
2015-09-08 18:36:56 +00:00
Ashish Singh
66010b41f1 Add support for listing servers of other projects
Added project and project-domain option to server list
command for listing servers based on project name or id

Co-Authored-By: Steve Martinelli <stevemar@ca.ibm.com>

Change-Id: Iaadfffe734ad8a72fa4b1eeb2222748c66f7fae0
Closes-Bug: #1488486
2015-09-08 13:27:50 -05:00
Dean Troyer
3abfea083a Fix compute API version snafu
novaclient 2.27.0 introduced the API microversion discovery and client.Client
now wants an api_version argument to properly work out the correct API
version in use.  OSC needs to provide this when required.

Letting the compute client plugin do the version validity checking makes more
sense than encoding it into shell.py, so I've added a new OSC plugin interface
function check_api_version() that is called from shell.py if it exists.  If it
either does not exist or it returns False the previous version checking using
API_VERSIONS is still performed.

compute.client.check_api_version() conditionally imports the new
novaclient.api_versions module and uses it if successful.  Otherwise
check_api_version() returns False and the previous code path is resumed.

One side-effect of this is that it is now valid to use --os-compute-api-version
with any valid microversion supported by the installed python-novaclient.

Closes-Bug: #1492467
Change-Id: I4535b38a5639a03a9597bf83f6394f9bb45c2b9e
2015-09-04 16:25:55 -05:00
Dean Troyer
e6706f2526 Properly handle port arguments for ICMP
The Compute API requires 'from_port' and 'to_port' to be -1 for
ICMP security group rules.  It happily accepts them empty or None
but the resulting rules do not work.  So we force the values for
ICMP rules.

Closes-bug: #1477629
Change-Id: Iba57211014caca16be7c9a28d15d4db2a6c51b8d
2015-09-03 13:06:45 -05:00
Joshua Harlow
e3c46ece4a Use a common decorator to log 'take_action' activation
Instead of duplicating the same log statement throughout
the code, the same logic can be provided by a shared decorator
that abstracts away the logging capability and unifies it behind
a common function instead.

Change-Id: Icc63bced7347c8bbf0299a4c5821425a10892a79
2015-09-01 16:49:54 -07:00
TerryHowe
5171a427ac Ignore flavor and image find errors on server show
If there is an error finding an image or a flavor during
image show, ignore it and just print the id of the flavor
or image.  This code is also used during server create and
server rebuild, but only to display the results.

Change-Id: I5362158ab8ffc3e5a0800904d6ea15420c3a8627
Closes-bug: #1489901
2015-08-28 09:32:05 -06:00
Jenkins
55d9eba093 Merge "Do not set default versions in parsed args" 2015-07-24 19:51:30 +00:00
jiaxi
2fc800aace Making --property as required when openstack flavor unset
When using openstack flavor unset, the --property is needed,
so the --property should be a required parameter.

Close-Bug: #1474237
Change-Id: Id6913e1b263eddeb5dd44c3edb957206b68f816c
2015-07-18 08:29:54 -04:00
TerryHowe
b3335b3474 Do not set default versions in parsed args
Setting default versions in parsed args makes it so OCC
cannot tell if the argument was parsed, an environment
variable was set or it is just defaulted.  In order to
set api versions from OCC, it will have to be defaulted
after processing OCC.

Closes-Bug: #1453229
Change-Id: I4d065919397b783f3bdd4022c986c0234a7a16e6
2015-07-18 06:28:09 -06:00
Jenkins
bbe71eb9a3 Merge "Rename endpoint type to interface" 2015-07-17 13:55:47 +00:00
TerryHowe
36391a81a3 Rename endpoint type to interface
Change-Id: I4e21d09bc747e8210f4f79a1d6c4c7ccf2f25d1c
Closes-Bug: #1454392
2015-07-15 10:11:59 -06:00
Jenkins
dc3ff5e000 Merge "Show which aggregate a hypervisor is member of" 2015-07-13 17:07:08 +00:00
TerryHowe
f89fc1ef32 Fix address parsing for server ssh command
There seem to be three formats for the server address field
and the old code only supported the old format.  This code adds
a parser for all three formats.

Change-Id: I7f12d2c69ff70556907ea6f31a0e0bba91b68b49
Closes-Bug: #1469843
2015-07-08 15:00:51 -06:00
Roxana Gherle
5521e4c504 Add --os-endpoint-type cli optional argument
User should be able to specify the endpoint type through
a CLI optional argument/ENV variable setting. We will name this new
optional argument: --os-endpoint-type (Env: OS_ENDPOINT_TYPE) and
based on the value given, the service API will use that specific
endpoint type. Possible values: public, admin, internal.

DocImpact
Closes-Bug: #1454392
Change-Id: Ife3d4e46b44c0ddcd712b1130e27e362545a9a29
2015-07-02 10:10:46 -07:00
David Moreau Simard
3bfaf79732 Show which aggregate a hypervisor is member of
This adds support for showing which host aggregates
a hypervisor is member of, if any.
It supports hypervisors with or without nova cells.

Closes-bug: #1470875
Change-Id: I0cfe4f15fa8f8ba0be3295b79cd438998893114c
2015-07-02 10:23:22 -04:00
Jenkins
aa7145e0c9 Merge "Fix security group list command" 2015-06-03 14:37:33 +00:00
TerryHowe
b2cf651100 Fix security group list command
Security group list command tries to get a project list and
this may fail with a multitude of exceptions including but
not limited to 401, 404, ConnectionRefused and EndpointNotFound.
Rather than try to capture every possibility, this patch just
catches the base class.  Converting project ids to names is
less important than having a working security group list command.

Change-Id: I68214d2680bad907f9d04ad3ca2f62cf3feee028
Closes-Bug: #1459629
2015-06-02 08:55:54 -06:00
Matt Riedemann
224d375ef4 Add --wait to server delete
This allows the server delete command to wait for the server to be
deleted (obviously).

The wait method is the same model that Tempest uses, i.e. wait for a 404
on server GET (successful deletion), fail if the server went to ERROR
status, or fail if a timeout is reached.  The default timeout of 300
seconds is also what Tempest uses.

Closes-Bug: #1460112

Change-Id: I0e66c400903e82832944d1cad61e7eb30177c3e8
2015-05-29 14:32:51 -07:00
Amey Bhide
7ef9f97b95 Fix client error while rescuing an instance
Typo server._info -> server

Closes-Bug: #1457983

Change-Id: I606505d73b3aae90bac636e960275926284b4ea6
2015-05-22 10:25:57 -07:00
TerryHowe
62bb88f621 Security group rule delete broken
Nova client was changed to take a rule id for security group
rule delete.

https://github.com/openstack/python-novaclient/blob/master/novaclient/v2/security_group_rules.py#L72

Change-Id: I0a69f3f196a36f267ee85a651b09aa8d3c328121
Closes-Bug: #1450872
2015-05-07 13:10:06 -06:00
Jenkins
00be0dfc0f Merge "Fix security group create description bug" 2015-04-23 20:05:43 +00:00
Jenkins
f6ac88333c Merge "Security group rule create fails" 2015-04-23 19:57:54 +00:00
Ramaraja Ramachandran
9b6dada8e3 Security group rule create fails
By default the --dst-port value is set to None when no --dst-port
argument is provided. By making the default value (0, 0), this allows
novaclient to proceed without any error.

Change-Id: Ibb58f5df5ed1890a8f499dd2467b12b0e79d547b
Closes-Bug: #1443963
2015-04-22 23:45:33 +00:00
Dean Troyer
11c39530f5 Fix security group create description bug
--description is optional in our CLI but the server requires it to be
non-empty.  Set a default value of the given name.

Closes-Bug: #1434172
Change-Id: I81507a77ad8d815000ff411784ae71e229c77f78
2015-04-22 18:37:31 -05:00
Steve Martinelli
e85971b1a6 Update the docs for new nic options
Change-Id: I4c8b93ede80f993eab8badfbba6bf1c530844d54
2015-04-19 01:43:40 -04:00
Jenkins
a5e79d58ae Merge "Defer client imports" 2015-04-19 03:23:12 +00:00
Dean Troyer
f43c1f7655 Defer client imports
So we really weren't deferring the loading of client libs dadgummit,
do that for real where possible.  This shaves a couple of tenths off
the static import times.

Also defer as much import-time procesing as possible.  This is a little
ugly in api.auth but this also eliminates import of the auth plugins
until they are needed.

Change-Id: Ia11d4b9cf98231d37449103fc29101dc17afb009
2015-04-15 22:40:52 -05:00
Davanum Srinivas
459526e25d Better help for --nic in create server
Use the help string from python-novaclient for a better user
experience.

Closes-Bug: #1444685
Change-Id: If7b8e3f68a0c6ad82b9959f162670b5568d5d12d
2015-04-15 21:17:00 -04:00
TerryHowe
a0fe37e189 Add warning message if unknown version supplied
Print a warning message if an unknown api version is supplied.
An attempt will be made to run the command anyway.

Change-Id: Idec8e88fe9621f10ec4b7eecd90708fb3730f56f
2015-04-13 16:21:50 -06:00
Marek Aufart
621434451f Add the ability to set and unset flavor properties
Added flavor set and unset command which allow manage flavor
properties called extra_specs.

Command flavor show output was extended with these properties.

Closes-Bug: 1434137
Change-Id: Ie469bade802de18aab9d58eda3fff46064008163
2015-03-19 13:54:19 -04:00
Jenkins
6edbb63594 Merge "Add ability for diplaying hypervisor statistics" 2015-03-10 03:51:26 +00:00
Jenkins
5d98bb3800 Merge "Add 'uptime' in 'hypervisor show'" 2015-03-08 14:27:49 +00:00
Jenkins
707b5b022f Merge "Fix help messages" 2015-03-06 13:37:55 +00:00
lin-hua-cheng
90c4a0a24f Add ability for diplaying hypervisor statistics
Added new command 'hypervisor stats show' for displaying
the hypervisor stats over all compute nodes.

Change-Id: I4f98c69135b04d4f6cea67cd6350d5d99fb79dba
Partial-Bug: #1423748
2015-03-06 00:11:20 -08:00
lin-hua-cheng
5fddec359d Add 'uptime' in 'hypervisor show'
Fetch the 'uptime' by making a call to hypervisor-uptime.

Update the help for 'hypervisor show' to mention that it
supports by Name or Id.

Change-Id: I31060d203e87749cfc05810c2d9db42f2416051d
Partial-Bug: #1423748
2015-03-06 00:09:20 -08:00
lin-hua-cheng
09665052ac Add hypervisor docs
Change-Id: I444734925316e876afcbfdeffafea9973a837022
2015-03-05 21:42:03 -08:00
Jenkins
5b8f18fe4b Merge "Rename --verify for server resize to avoid conflict" 2015-03-05 20:27:32 +00:00
Ramaraja
8e512017c4 Fix help messages
Update help message for openstack security group rule delete
Update help message for openstack security group rule list

Change-Id: I017ffd424ca25b6c62193b91068eb1ba7de6c919
Closes-Bug: #1417854
2015-03-04 09:48:40 +05:30
Dean Troyer
5d92fc0d0a Handle novaclient >2.20.0
As of 2.21.0 novaclient moved all of the v1_1 classes to v2 with a
deprecation warning.  The version-non-specific interfaces provided in
novaclient.client are insufficient to support a few specific commands in
OSC so we need to conditionally import directly from the correct classes.

Closes-Bug: #1418024
Change-Id: I864b1908737803069dc1419c9cbca391b985c932
2015-03-03 13:02:11 +00:00
zhiyuan_cai
a33f14e298 Rename --verify for server resize to avoid conflict
Currently server resize command has a verify argument for user to
confirm resize operation. But this argument is also registered by
openstack client shell which is used to enable server certificate
verification. So verify argument can not be correctly passed to
server resize command.

This patch renames --verify to --confirm (nova client has a
resize-confirm command) to solve this problem.

Change-Id: I751aa3df16c3b637b82944dd350afc5cbab62120
Closes-Bug: #1416542
2015-02-16 11:00:50 +08:00
Jenkins
1cb56a6a44 Merge "Added capabilities/options to 'openstack flavor list' command to match capabilities already provided by 'nova flavor-list':" 2015-02-06 23:29:57 +00:00
Marcos Fermin Lobo
0cc3955f0a tenant_id to project_id in server show
The result of 'server show VM_NAME' command shows tenant_id
instead of project_id. All openstack components are moving
from 'tenant' to 'project' naming when we are talking about
openstack projects.

Change-Id: I50053b72e79e1ff3167fa573728da1a81a8e5ed8
Closes-Bug: #1417614
2015-02-04 05:43:26 +00:00
Igor_Bolotin
6d4678185d Added capabilities/options to 'openstack flavor list'
command to match capabilities already provided by
'nova flavor-list':

—public | --private | --all options allows to list
public only (default), private only or all flavors.

—long displays more field. This option also fetches
properties (extra-specs) for each flavor using separate
API call for each flavor and it’s too slow to be done by
default. However as an administrator - sometimes I need
to be able to see them for all flavors.

Removed empty “Extra Specs” column as well as "Swap" and
"RXTX Factor" from default output.

DocImpact
Closes-Bug: #1416780

Change-Id: I30cfa2c75e28daf17b936543a177c23ae1743c37
2015-02-03 07:57:20 -08:00
Jenkins
b131692007 Merge "Improving the help of the lock command." 2015-02-02 05:07:04 +00:00