Commit Graph

40 Commits

Author SHA1 Message Date
Andrey Kurilin 0a60aae852 Rename v1_1 to v2
Module novaclient.v1_1 is used as implementation of V1.1, V2 and V3.
Since future development(microversioning) will be done across V2,
implementation should be done in appropriate module(to prevent misleading).

Despite the fact that implementation for all versions are equal, discover
method for contrib path worked only for v1.1. This patch fixes this bug and
modifies shell tests to check all versions.

Change-Id: Ib6798f4dfe177586302141f522dc593560ce6a5b
2015-02-04 17:40:46 +02:00
Andrey Kurilin 8de2237cc4 Enable check for E126
E126 continuation line over-indented for hanging indent

Change-Id: Id64edce8278d96c1b2d4a6ca536e9fc8fbef478c
2014-10-23 17:28:25 +03:00
Andrey Kurilin dc09cf27e3 Port to use oslo.i18n
Module gettextutils from oslo-incubator was graduated to separate
library (oslo.i18n) and removed from repository, so we should use
new library.

Change-Id: I15d36ac5a2bb88b332ffa38d29488b75c55a20a9
2014-10-16 01:19:48 +03:00
Andrey Kurilin d05ae5dcc0 Enable check for E122
E122 continuation line missing indentation or outdented

Change-Id: Ic54714142b3c5aded42d544f296b0ef9a840c282
2014-09-24 22:44:20 +03:00
Andrey Kurilin 392148c7ef Use oslo.utils
Modules `strutils`, `timeutils` and `network_utils` from common code are
graduated in `oslo.utils`, so we can:
 1. remove `novaclient.openstack.common.network_utils` and use
    `oslo.utils.netutils` instead.
 2. use `oslo.utils.encodeutils` and `oslo.utils.strutils` instead of
    `novaclient.openstack.common.strutils`.
 3. use `oslo.utils.timeutils` instead of
    `novaclient.openstack.common.timeutils`.

Additional information:
 - modules `importutils`, `strutils` and `timeutils` from
   `novaclient.openstack.common` cannot be removed, because:
   - importutils is used by apiclient and jsonutils;
   - strutils is used by apiclient, cliutils and jsonutils;
   - timeutils is used by jsonutils
 - additional check for `safe_encode` in Py3 is required, since
   If91a866d864a22d28a352152beff4c7406a27b7b was merged.

Change-Id: Ib8d79d9c85af4916e87a76a1a67a13488ddaa111
2014-08-28 12:17:22 +03:00
zhangjl abd4e8986b Logical error in flavors unset_keys method
When we want to unset multi keys of flavor
extra data, only first key can be removed
because of the key word named 'return'.
To fix it, remove the return key word

Change-Id: I70d1f2e84a2bfcea1db60b26138f84421f9a7309
Closes-bug: #1324077
2014-06-03 12:10:32 +08:00
Eric Guo d44e598692 Remove usage of module py3kcompat
Module py3kcompat was removed from oslo-incubator. We need remove its
usage in client side firstly. This make us move smoothly when sync
oslo-incubator code.

Change-Id: I8b07c32c9852e747579a23685f3c8a07ac13ec01
Partial-Bug: #1280033
2014-02-25 09:17:54 +08:00
Jenkins d703381c45 Merge "Fix i18n messages in novaclient, part I" 2014-02-10 02:25:23 +00: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
Sergio Cazzolato 6b070c82d4 Fix i18n messages in novaclient, part I
This change make all the text visible by the user i18n. The
messages changes are in prints, logs, exceptions, helps, etc
Pep8 errors about "Multiple positional placeholders" also fixed

Change-Id: I731afea790baddbc34d059b93a35e3d275fc1df8
2014-01-28 14:56:00 -05:00
Matthew Farrellee 669cdc4ffd Replace some utils.bool_from_str with strutils
Instead of using novaclient.utils' bool_from_str, use bool_from_string
from the oslo incubating strutils

Notes:
 0. utils.bool_from_str was strict, only accepted a small set of
    values, while strutils.bool_from_string is not strict by default,
    anything not true is false
 1. bool_from_string accepts on/off, which bool_from_str did not

Change-Id: I04744844b55697819289def081d3c9117ed0713f
2013-12-25 07:22:24 -05:00
Chris Yeoh 9329f435bf Adds flavor support for Nova V3 API
The first part of adding flavor support for the Nova V3 API (support
for flavor-access API calls is still to come).

Restructures v1_1 testcases so as much as possible so they can be
reused for the V3 version of the tests. If it looks too ugly an
alternative would be to just cut and paste the fakes and test
from v1_1 to v3, which is simpler to understand but comes at the
cost of duplicated code. The upside though is it would be much
easier to remove v1_1/v2 support in the future.

Partially implements blueprint v3-api

Change-Id: Ic7cb3c43db02c07d37aea2675b310aaa50639c40
2013-12-15 22:42:48 +10:30
Sushil Kumar 3ecaeb416e Enables H306 pep8 rules
Updates tox.ini to reduce ignored rules.

Updates code for H306 violation.

Change-Id: I9beea02510a1122afb55ad3df3b37f770fe05134
2013-12-12 17:43:08 +00:00
Chris Yeoh 50685437ed Enable hacking check for Apache 2.0 license
Removes H102 (license header not found) check from flake8
ignore list.

Adds missing apache license headers.

Change-Id: I109f23c6d8b2e3efb1dac7f764bd77e0d9d335f0
2013-12-06 10:47:41 +10:30
zhangyanzi 8dd5ea4783 Fix the inappropriate comment for flavor
Fix the inappropriate comment for delete and create flavor

Change-Id: I29985e5f145cfe3d0e72d6ac684ae9c47ea89c7e
Closes-Bug: #1255819
2013-12-03 11:41:44 +08:00
Zhenguo Niu 79070d6c5c Fix inappropriate comment for flavor create api
Change-Id: I7fa547925de5a194c10484d523006ca093518149
Fixes: bug #1253903
2013-11-22 15:07:59 +08:00
Ken'ichi Ohmichi bec4e51df4 Add delete method to Flavor class
In tempest, some tests use delete() method of each resource class
(Server, SecurityGroup, etc.) for cleaning up when each test finishes.
Now we are adding some tests, which create a Flavor instance, to tempest
and we need the delete() method of Flavor class.

Fixes bug #1218156

Change-Id: I210d62aa45510858346315046cf57ea7b1de7b7b
2013-09-06 08:30:47 +09:00
Chuck Short c450b39828 python3: Fix imports for py2/py3
Python3 reorganized the standard library and moved several functions
to different modules. Six provides a consistent interface
to them through the fake six.moves module.

However, the urlparse, urllib2, etc modules have been combined
into one module which Six does not support so we do it via
py3kcompat.

Modules such as StringIO and CStringIO have been removed
completely so we use the io module.

Change-Id: I53adac11b634de2c710fc39def36bcec96366710
Signed-off-by: Chuck Short <chuck.short@canonical.com>
2013-08-27 14:50:34 -04:00
Chmouel Boudjnah f7d3948b23 Do not restrict flavor to only ID and integers
- Flavors with strings and not just ID/UUID strings are valid.
- Closes-Bug: 1209060

Change-Id: Idee389fce40f8982b263e1a4349a8565140b6584
2013-08-07 19:02:00 +02:00
Jianing YANG cdee7e12c0 Set default value of flavorid to "auto"
Fixes: Bug #1189877
Change-Id: I80a0834c5f1d264b64f14d78fa2f71b1e4d9d89a
2013-06-11 17:07:30 +08:00
Dirk Mueller 67c80558b1 Start using Hacking and PyFlakes
Only blacklisting those warnings that are numerous,
so that in principle Hacking and PyFlakes warnings
are tested. Fix the easy ones alongway.

Change-Id: I571f51ebf570ac114509f2dcd71cdce281e7c70a
2013-06-01 15:49:51 +02:00
Shane Wang bc0ad1cb9d Reuse oslo for is_uuid_like() implementation
In the original code, isalnum() in is_uuid_like() doesn't allow "-",
while for UUID, format like aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa should be
allowed. This patch is to reuse uuidutils's API in oslo.

Change-Id: I339974c75a32d27f8e4443a1b97bb6e410933aa4
Signed-off-by: Shane Wang <shane.wang@intel.com>
2013-05-22 11:47:23 +08:00
Shane Wang 3c97f768e5 Cleanup some flavor commands
Some cleanups include:
 - Add flavor sub-commands into README.rst
 - Check flavor ID when creating a flavor
 - Remove check_uuid_like() because it isn't used
 - Remove parameter cs in some _print_XXX functions because cs is
   not used

Change-Id: If47ce557d33db05f53e382f0670f436e05a340b7
Signed-off-by: Shane Wang <shane.wang@intel.com>
2013-05-15 15:55:27 +08:00
Kieran Spear 50fe79b47d Add 'flavor-list --all' admin switch
Nova gives admins public flavors and flavors from their own projects
only by default. For flavor management, admins need to see all flavors
regardless of access.

Changes:
- Adds an 'is_public' argument to flavors.list() that mirrors the
  Nova API. is_public=None can be used to see all flavors.
- Adds an --all switch to flavor-list in the CLI for use by admins
  when all flavors are wanted.

Fixes bug 1172179.

Change-Id: I915cd2d8266cb6e32c80691a6ff27d8a23488c98
2013-04-26 09:49:29 +10:00
Rohan Rhishikesh Kanade 9937419888 Fix find for alphanumeic flavor id/name
Fixes LP bug #1089299

Change-Id: Ia9cc756b85096532acfc9ecacd1330de8a765fba
2012-12-20 03:14:39 -08:00
Dan Prince 494040d7fe Remove unnecessary casts in flavor create.
We already cast and validate these variables above... no
need to cast them again.

Change-Id: I87b967925ae77c70eb07a42f3ae050703d44a427
2012-11-27 11:05:53 -05:00
Dan Prince 27d7ad9d86 Validate that rxtx_factor is a float.
Nova stores rxtx_factor as a float internally and as such
novaclient should validate that a float is specified
when creating a flavor.

Fixes LP Bug #1083651.

Change-Id: I75f9440d3fe2a0e72ea592f2259640623400ae73
2012-11-27 10:59:43 -05:00
Gabriel Hurley e9b015c7e1 Cleans up the flavor creation code. Fixes bug 1080891.
Change-Id: Idc76cd01d1537ab87723a05ab8dd81015284e3c8
2012-11-17 18:27:52 -08:00
Jenkins f04a24c6ad Merge "Auto-Assign Flavor ID" 2012-10-31 18:07:44 +00:00
Russell Cloran 7bf93a52f8 Validate that boolean parameters are boolean
Ensure that values which are supposed to be boolean look like correct
user input, instead of assuming that any non true-looking input is
False.

Also, update the flavor manager to raise a CommandError if is_public is
not a boolean value.

Fixes bug 1059414

Change-Id: I3275e4bba103b14081becf91f723f1be060391e5
2012-10-30 11:38:58 -07:00
sathish-nagappan 67d4d7e0fd Auto-Assign Flavor ID
Auto-assign a flavor ID if the user enters "auto" for the ID.

Change-Id: I745744b9ca44668477635c20df5e2ece6cbf1c27
2012-10-29 16:52:10 -07:00
Sathish Nagappan 805ba8fdc1 Exception handling for 'nova flavor-create' arguments
Fixes client side Bug #1056935

Throws an exception if the user does not input integers for the
corresponding parameters.

Change-Id: I4c4b8148f6565bc5a3b348dbde8c2cf0da00234a
2012-10-18 03:04:06 -07:00
Yunhong, Jiang 3dd0393fbb Support flavor extra specs in nova client
Add flavor extra specs so that user can list/set/unset
extra specs in nova client

blueprint extra-specs-in-nova-client

Change-Id: I6ad7293e29764648c79943c4d05f3a09931af411
Signed-off-by: Yunhong, Jiang <yunhong.jiang@intel.com>
2012-09-12 20:26:26 +08:00
unicell f160a20fd9 Implement project specific flavors API, client bindings
blueprint project-specific-flavors

This change implements client bindings for the project specific flavor API in following change
https://review.openstack.org/#/c/11270/

Change-Id: Id8d559985f9369f53926e63ee5f5ce23a051e25b
2012-08-27 22:38:36 +08:00
Rick Harris b22ec22336 Add human-friendly ID support.
Allows a user to interact with certain models (image, flavors, and
servers currently) using a human-friendly identifier which is a
slugified form of the model name.

Example:

    nova boot --image debian-6-squeeze --flavor 256mb-instance myinst

Change-Id: I43dbedac3493d010c1ec9ba8b8bb1007ff7ac499
2012-03-08 04:53:47 +00:00
Anthony Young 7373740742 Fix for backward compatibility with stable/diablo flavors
* Gracefully handle missing ephemeral attribute
 * Fixes bug 939766

Change-Id: Iaff7a684ac03386ce821ba0007923c0f5f5e39ce
2012-02-23 14:11:29 -08:00
Anthony Young 97eaa1f56f Add support for ephemeral_gb to novaclient.
* Fixes bug 932423

Change-Id: I57620db469f34aaf1ae61c6ef116a21ac9787e40
2012-02-21 13:23:07 -08:00
Cole Robinson 65eb4a9fb2 Add flavor create/delete support
Makes use of the new nova module for flavor creation/deletion (still
under review at https://review.openstack.org/#change,3197

tests and cli commands added.

v2:
    Fix tests
    Fix pep8 violations

v3:
    Drop unused import

v4:
    Usage defaults to end date 'tomorrow'

v5:
    Undo unintentional change

v6:
    Drop useless comment
    Fix meta var name for flavor-delete command

Change-Id: I14baa02d5cbe5eaf17875c285c993508b1671a13
2012-01-24 17:33:16 -05:00
Brian Lamar 454daa2cba Tests working again...merged in some work we did earlier. 2011-08-03 17:41:33 -04:00
Brian Lamar f8496672cc Split everything down the middle into v1_0 and v1_1, including tests. 2011-08-03 16:36:03 -04:00