Heat uses `novaclient.shell.OpenStackComputeShell._discover_extensions`
function, which is private currently. It's better to change this method
to public for public use.
Change-Id: I15879d56db2ec88a9bef99b6af8924ebd4ad169b
Closes-bug: #1440779
Added new subcommand "limits" which displays absolute limits and
rate limits both. do_limits() functions calls get() only once and
then passes limits.rate and limits.absolute to _print_rate_limits
and _print_absolute_limits respectively; these functions then
format the output.
Change-Id: I1344da1a3925a3f3a757e340f11381b69a668bf7
Closes-Bug: #1172254
The endpoint of version API doesn't contain "/v2/{project-id}" and it is
just "/". SessionClient is based on the endpoint "/v2/{project-id}/...",
so this patch makes a client use a raw url for version-list API.
Change-Id: I53f2afacce2dda14ac9761e824b48887f7c192f9
Closes-Bug: #1444235
Module novaclient.v1_1 is already deprecated, so it's time to stop using it
inside novaclient.
Since support of v3 nova is undocumented feature, which uses v2
implementation, we can remove code related to it.
Also, this patch removes redundant check for compute api version != 1.0.
Change-Id: I06b349f704d5ae2c592d8d286da268870f2a69e9
The FloatingIP repr added in d614dbcab9cc8c5732ce28c655738218e147aad7
is incorrect, and can cause fails when you attempt to do bulk creation
activities with logging turned on.
This removes the __repr__ for FloatingIP so that it fails back to the
Resource defaults which are safe.
Partial Revert of d614dbcab9cc8c5732ce28c655738218e147aad7
Closes-Bug: #1437244
Change-Id: I8cedf418917157ce632606bef640049140134372
Change https://review.openstack.org/#/c/164321 broke the bypass_url
option. It made the assumption that self.service_catalog won't be set
in novaclient/client.py when bypass_url is specified, which isn't
necessarily true. This change adds a check for self.bypass_url and
looks up service url only if bypass_url hasn't been specified.
Closes-Bug: #1445086
Change-Id: I72d2b3e3199aeae7fb2f2c68be259774e07a4501
This reverts commit 4e79285b45ec1490c8e923f724cbaf4d42fe81c4.
The aforementioned commit broke flavor-show for mixed case flavorids.
The reason is a bit complex. On the nova api side, there is caching of
db items for flavors, keyed off the flavorid retrieved from the db,
case sensitive, unlike the db query itself. Attempts to flavor-show
a flavor with flavorid composed of letters will fail with a 400 if
the capitalization doesn't match.
For the flavor names, they work in lowercase because the find_resource
function falls back on a search by "human_id" after failing every other
attempt to find the flavor, because "human_id" is a oslo-slugified
string (all lowercase, non-word characters removed, spaces converted
to hyphens).
Closes-Bug: #1446850
Change-Id: I73247b50f5a6918167c071ccc13cd676aa2c7fec
This exposes the ips Resource from the nova server manager which the
infra team believes will help them optimize some of their API load on
various clouds.
Change-Id: I00730dc809ae4e86d728e2ec76bfb38024d7634e
Test base classes inheriting outside the existing source tree to
anything higher up the stack than testtools is really an anti
pattern. It makes it *far* less clear what is going on. We really need
to own and understand our base class setup for tests.
This does that unwind, so that we only now call out to tempest_lib in
specific ways (like building clients, using decorators). The timeout
and log capture pieces are pulled inline.
At the end of this we end up with a base test that defines:
- self.client - a Nova API client
- self.flavor - a workable flavor for booting guests
- self.image - a workable image for booting guests
- self.cli_clients - tempest_lib cli clients
Change-Id: I716be51d7d1825a757934298f06b2f04d64cf0dd
The eph_dict expects the format size=value.Catch valueError and return
proper error text
Change-Id: I99ef7efe7dc14aa346913009e244ad4eea0369a9
Closes-bug: #1433200
Since then an instance was booted with a flavor, the flavor could be
deleted or become unavailable (private flavors). As a result novaclient
fails to show the instance with member role user.
This patch set adds handling of unavailable flavors to showing of
instances as it is done for unavailable images.
Closes-Bug: #1366168
Change-Id: I810dcac814b7523313112bb9151754659b85df51
The current code in the servers api assumes only text files will be
provided as userdata. That is, the data is utf-8 encoded before it
is base64 encoded and sent. This breaks for binary userdata files,
(example, gzip files) as they can't be utf-8 encoded.
This change ignores specifically the exceptions that are raised
when utf-8 encoding is attempted on non-text data: AttributeError
and UnicodeDecodeError. These exceptions will be ignored to let
binary files proceed to the base64 encoding step.
Closes-Bug: #1419859
Change-Id: Ie96283f6ff892ae30485722cf7c3ec40f3f1b5df
Currently, the all_tenants=1 search option is being passed all the
time for 'nova delete' commands in order to enable 'nova delete' by
name to work across tenants, for those that have all_tenants access
in the nova policy.json. This however breaks all 'nova delete' for
non-admins when policy has been configured to allow only admin to
list servers across all_tenants.
This patch changes 'nova delete' to take an option --all-tenants to
get the functionality to delete by name across tenants. This is
similar to how 'nova list --all-tenants' works.
Closes-Bug: #1439381
Change-Id: I204daaf5c0f4dab7c93ef0bd85ffab3529ca352a
nova rate-limit returns absolute limits too, but novaclient does
not show absolute limit,a bug
(https://bugs.launchpad.net/python-novaclient/+bug/1172254) has
been filed for this one. There is no test which assert on both
absolute and rate limit. This patch assert on both the rate and
absolute limit returned
Change-Id: Ia635f32eefc46e22e3f4e45a7885f492bb967a99
Closes-Bug: #1436653
While creating floting ip range returned by API object doesn't contains
attribute 'address', but repr tries to get it. So change list to return
objects of FloatingIP and add repr to FloatingIP,
also changed repr of FloatingIpRange to return actual range of addresses
Closes-bug: #1437244
Change-Id: Ia9e30a3f3d82fa8dde113b40d2da372bf1e7a086
The expected behavior is when timing is True, then we record each
request's time, then we should call reset_timings() to release memory.
However, the shell, client.{HTTPClient,SessionClient} will record each
request's time no matter what timing is set, then after long running
time in service like ceilometer-agent-compute, the memory keeps increasing.
We'd better not record request's time when timing is set to False.
Users are not responiable to call reset_timings() when they don't want
timing functionality.
Change-Id: I3e7d2fadf9a21be018781d528a1b6562228da6dd
Closes-Bug: #1433491
https://review.openstack.org/#/c/153203/3 added check
for novaclient, removed the logic for both
--image and --block-device are added.
But actually the following valid boot command failed
due to the change here, so this patch reverted original
one and add some descriptions to avoid further removal.
nova boot test-vm --flavor m1.medium --image centos-vm-32
--nic net-id=c3f40e33-d535-4217-916b-1450b8cd3987
--block-device id=26b7b917-2794-452a-95e5-2efb2ca6e32d,bus=sata,
source=volume,bootindex=1
Change-Id: Ia29e63c72b34d3038aa591c466425e65edf5755b
Partial-Bug: #1433609
Currently, several of the volumes apis depend on callers to pass
service_type='volume' as a parameter when creating a client object,
to route correctly. The problem is, it makes it impossible for
callers to work with both the compute and volume endpoints at the
same time. They can either work with compute and have volumes.* calls
return 404, or they can work with volume and have servers.* images.*
flavors.* calls return 404.
The CLI sets service_type='volume' for client objects for the
following commands via a decorator:
volume-list
volume-show
volume-create
volume-delete
volume-snapshot-list
volume-snapshot-show
volume-snapshot-create
volume-snapshot-delete
volume-type-list
volume-type-create
volume-type-delete
With this change, the service_type 'volume' is set in the api,
so the decorators on the shell commands are no longer needed.
Closes-Bug: #1431154
Change-Id: I11b48ac14fa4c64d8aae528552ec5b363be384c5
nova client is not able to show the list of volumes when
querying by name.This is because cinder api accepts only
display_name as query parameter and when qeried with 'name'
parameter returns a empty list
Change-Id: Ie4ffc275d1754052d9e239d8457baf6f7fd53b83
Closes-Bug: #1430415
The nova flavor-show command accepts a flavor
name as its parameter. The command show inconsistency
as it works with the exact flavor name and flavor name
in all lowercase but fails for any other case pattern.
So, updated the code so that if we run the command
with flavor-name case patern it runs fine.
Closes-Bug: #1423885
Change-Id: I713bf2b5aca977df40dc745e29d4fe98a950c991
Outline the background and goal of the functional testing. Want to make
sure there is consensus on how this should look. Next step is to
reorganize the functional tests to follow the plan outlined here.
Change-Id: I1d6889682f50f78b0681c99b77475adba95ef807
The following replacements were done:
1) assertEqual(True, *) -> assertTrue(*)
2) assertEqual(False, *) -> assertFalse(*)
3) assertTrue(a in b) -> assertIn(a, b)
4) assertTrue(* is not None) -> assertIsNotNone(*)
TrivialFix
Change-Id: I8d8a2d7b5d3505e07728544b683b301d1a8850cf
Unused code was removed in fixture_data/images.py
for unknown image requests that relate to
v2/images.py and test_images for them.
Change-Id: I7e31a572116b1e5cf0df9f431f8e53470d27d066
Fix E124 failures and enable check for E124
E124 closing bracket does not match visual indentation
Change-Id: Iec6af44362dcf613cfaccbccbe53de82aba51a6a
other openstack clients like glance, cinder use --endpoint-type
(internal|admin|public). This allows users to use the same arguments
with the nova cli.
Partial-bug: #1367389
Change-Id: Ia55cad797ac0dca7fa60f55c1f2dfba0b64d0fd3
Fixed redeclared test_names for two test functions that pass now:
1) 'test_list_security_groups_all_tenants_on'
2) 'test_find_by_str_name'
Small spelling corrections
TrivialFix
Change-Id: Iacb0ce5697779f9342c22a22cb2f29a8e063b459
This is a functional test that boots a server via the cli, creates a
volume, and tries to attach it via the cli (which causes a failure due
to completion cache code). Note: the failure actually happens *after*
the attach command is dispatched, so the volume attach will still
work, the user is presented an error though.
Many TODOs remain for future patches. The test also tries to document
what was learned about the CLI redirection to cinder API, which was
introduced when Cinder was split out, but was tribal knowledge that
was lost in the mists of time.
Related-Bug: #1423695
Change-Id: Iaf474298be135843bff0114cf211bee19762f3ad
This reverts commit 4c8cefb98a425382204df2f38f24e6b5b71520dd.
The cache completion was causing a bug where 'nova volume-attach' would
then try to query Nova for volume information using a URL that was not
valid. This caused it to appear that the attach had failed.
Additionally the idea of making extra API queries for a bash completion
cache should be thought through more.
Conflicts:
novaclient/client.py
novaclient/shell.py
novaclient/v2/client.py
novaclient/v3/client.py
Closes-Bug: #1423695
Change-Id: I6676a11f9b5318a1cda2d03a5d4550bda549d5c2
Currently the commands of os-tenant-network API use net-*
which may confuse users sometime. This patch changes commands
to tenant-network-*, and marks net-* commands as DEPRECATED.
Closes-Bug: #1152862
Change-Id: I8c3a0be08763a6f626d7fc7cf84811ac61ccc526
Copy tests in from tempest/cli/simple_read_only/compute/test_nova.py in
preparation for removing that file.
Change-Id: I5a34cf1a39d4f73f94a27cce365434bd4a0eea0b