Commit Graph

48 Commits

Author SHA1 Message Date
Ronald Bradford 7e7e5525d2 Removed unused Oslo Incubator code
This is part of graduating projects to using Oslo Libraries.
As this code is not actually used, it is simply removed.

Change-Id: Ib28a957d9a4622064ec5da2ae616ac6f0716bcbf
2016-03-22 18:31:21 -04:00
Andrey Kurilin 01961d68a2 Cleanup needless code from oslo-incubator
oslo-incubator was deprecated and all modules used by novaclient were
removed from oslo-incubator master branch. This patch removes all unused
code from novaclient's repo.

Change-Id: Ie3c542d19da6ed4d25ec490faf6a86a82f48cd34
2015-12-18 08:46:12 +00:00
Davanum Srinivas ee714bfc50 Last sync from oslo-incubator
oslo-incubator will cease to host common code soon. This is
hopefully the very last sync from oslo-incubator.

Changes:

7f37bf8 Correct a typo
f4b09ce Sort keys in table output in print_dict
0753799 Allow specifying a table header for the value column in...

Change-Id: I7eb71518e3c9c0c51b08188fa83298dd9eac93dc
2015-11-17 22:49:46 +00:00
Davanum Srinivas a5f30d173f cleanup openstack-common.conf and sync updated files
Changes include:
e782594 Add last_request_id only if it is not none
18bf5ca Fix usage of NotFound exception in apiclient.base
3bc8231 deprecate apiclient package

Depends-On: Ia83ef6136da1c551ea947679dc546a0d7ad2f876
Change-Id: I0b5917c657d6adc3d34229b14833a5224c168e07
2015-06-16 20:32:08 -04:00
Doug Hellmann 0e35f2a2fa Drop use of 'oslo' namespace package
The Oslo libraries have moved all of their code out of the 'oslo'
namespace package into per-library packages. The namespace package was
retained during kilo for backwards compatibility, but will be removed by
the liberty-2 milestone. This change removes the use of the namespace
package, replacing it with the new package names.

The patches in the libraries will be put on hold until application
patches have landed, or L2, whichever comes first. At that point, new
versions of the libraries without namespace packages will be released as
a major version update.

Please merge this patch, or an equivalent, before L2 to avoid problems
with those library releases.

Blueprint: remove-namespace-packages
https://blueprints.launchpad.net/oslo-incubator/+spec/remove-namespace-packages

Change-Id: If5e8257085b5fd0a26a34705505fc0077adbabb2
2015-05-11 15:30:11 +00:00
Andrey Kurilin 667f1af972 Reuse uuidutils frim oslo_utils
Change-Id: I0c5ec41215e97dafd7377179979b01a67704cb05
2015-05-08 12:36:41 +03:00
Andrey Kurilin 4a7cf96766 Sync latest code from oslo-incubator
Hash of latest commit in oslo: f5646edc61b9653d7ff71ed0177ed77811bbdcd0

Change-Id: I2f3bf41434591fcfc811ae6dec40ccabd42db741
2015-05-08 12:27:59 +03:00
sridhargaddam e91d469704 Curl statements to include globoff for IPv6 URLs
Novaclient displays curl statements for debugging/troubleshooting
purposes. For IPv6 URLs, curl requires --globoff to be passed in
the arguments. Since novaclient does not use curl directly, this
patch displays the curl commands with globoff option which works
for both IPv4 and IPv6 URLs.

Closes-Bug: #1228744
Change-Id: Ib7099e8e3bbc15f29bbaa1db37ef21e78a74e7bc
2014-11-14 14:27:03 +00:00
Andrey Kurilin f9ac34d9e8 Sync latest code
Modules from oslo-incubator already switched to use graduated
libraries (oslo.i18n, oslo.serialization and oslo.utils), so we
should sync latest code and remove outdated modules (gettextutils,
importutils, strutils).

NOTE:
 - module novaclient.openstack.common._i18n should be used only in
   common code
 - module novaclient.i18n designed for usage in novaclient

Latest commit in oslo-incubator:
  21985931a95981eabf1030ead60ae4d210bcd9c0

Synced changes for tools/install_venv_common.py:
  fe3389e Improve help strings

Other synced changes:
  55ca7c3 Split cliutils
  5d40e14 Remove code that moved to oslo.i18n
  3edbfb3 remove caching param from prettytable call
  6ff6b4b Switch oslo-incubator to use oslo.utils and remove old modules
  9eee5d0 Merge "Delete the token and endpoint on expiry of token of client"
  f76f44c Delete the token and endpoint on expiry of token of client
  ed0ffb8 Do not incur the cost of a second method call
  cf449e2 Fix response_key parameter usage in BaseManager
  d73f3b1 Remove unused/mutable default args
  e7d26a6 Merge "Centralize bash-completion in Novaclient"
  b4e098e Merge "Handle non-openstack errors gracefully"
  5e00685 Centralize bash-completion in Novaclient
  4ef0193 Handle non-openstack errors gracefully
  ac995be Fix E126 pep8 errors
  de4adbc pep8: fixed multiple violations

Change-Id: I5f3015ebcbc665a2089ec88629e15ba336aee504
2014-10-16 01:26:48 +03:00
Andrey Kurilin 8c0fd9a674 Use oslo.serialization
Since module `jsonutils` from common code is graduated in
`oslo.serialization`, we should remove code from oslo-incubator and use this
library.

Change-Id: Ia8b5ef598ff415cdde19f523a36a552918f9f94b
2014-09-20 20:42:52 +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
liyingjun 52c5ad2ead Sync apiclient from oslo-incubator
Need to sync the latest apiclient from oslo-incubator to make nova
cli cache work. Command used:
python update.py --base novaclient --dest-dir ../python-novaclient/ \
--modules apiclient

syncd patches:

apiclient:
  * 12341ef504 Merge "Restore UUID and human-ID bash completion"
  * 468afcb335 Merge "Don't slugify names that don't exist"

Change-Id: Iec2ad851b47628c5dde4272f438cce4150e11912
Close-bug: 1337033
2014-06-26 05:15:53 +08:00
Jenkins 5a3ca61cfd Merge "Sync Oslo's apiclient" 2014-06-28 18:24:25 +00:00
Rick Harris 298b06f7e0 Sync Oslo's apiclient
Oslo's version of apiclient fixes a bug where if `human_id` is `None` it
causes `novaclient` to crash, so lets sync it over to fix that bug.

Change-Id: I53f174a1d3356c4038dcbdf88f4f9c4ea179418c
References-Bug: 1288397
2014-06-20 16:37:34 -05:00
Jyotsna b78c0d4f46 "nova boot" should not log an error if subsidiary commands fail
Fix:
Intially the cli was raising "CommadError" in case the requested
flavor or image were not present.
This error category was not approrpiate as it signifies an error
in the command syntax. When the requested resource (flavour/image)
does not exist, a ResourceNotFound error should be raised. So,
added a new error category "ResourceNotFound" to cater for this
scenario and updated the code to raise this new error.
"nova show <instance_name>" command has also been updated to raise
"ResourceNotFound" error when the requested vm for which details
have to be displayed does not exist.

Closes-Bug: #1258488
Change-Id: If64a087944586ef5792efe3baa62e455b9bbaa07
2014-06-17 14:48:11 +05:30
Ihar Hrachyshka 1e40b41a9e Synced jsonutils from oslo-incubator
The sync includes change that makes sure we get unicode-only dicts from
jsonutils no matter which json module implementation is selected.

The latest commit in oslo-incubator:
- 0f4586c0076183c6356eec682c8a593648125abd

Change-Id: Ic815ca3df94c33edec9104172048b2cd94b92e3f
Closes-Bug: 1314129
2014-05-27 10:46:49 +02:00
Ihar Hrachyshka 8e0e25f6ce Synced jsonutils from oslo-incubator
The sync includes change that drastically enhances performance on Python
2.6 with fresh simplejson library installed.

The latest commit in oslo-incubator:
- 732bdb6297eb9de81667f7713ebcb1ccc2ee45a7

Change-Id: Ib3dc0b713ed90396919feba018772243b3b9c90f
Closes-Bug: 1314129
2014-04-29 17:28:35 +02:00
Jenkins c9f4e085e2 Merge "Sync with Oslo-Incubator" 2014-04-09 08:49:18 +00: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
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
Davanum Srinivas 32d84dc786 Sync with Oslo-Incubator
oslo-incubator HEAD was 2eab986ef3c43f8d1e25065e3cbc1307860c25c7

This change brings in a few minor updates to python3 and a bug fix
for deep copy failure in gettextutils.

Change-Id: Id360f3b43d1ad2f67b328206990dd6bdb53c1cd7
2014-03-27 20:12:54 +00:00
Joe Gordon 64043442bb oslo sync apiclient and cliutils
Generated with:
 ./update.sh --base novaclient --config-file
../python-novaclient/openstack-common.conf --dest-dir
../python-novaclient/

Synced patches:

apiclient:
  04a1abe Revert "Removed set_loaded() method from Resource class"
  5e76477 Merge "Handle 300 status code in common HTTPClient"
  492fe2c Merge "py3kcompat: remove"
  466ad64 Merge "Fix usage of dict.keys in apiclient.exceptions"
  8630a44 Merge "Removed set_loaded() method from Resource class"
  41fbfea Merge "Add to_dict() method to apiclient Resource"
  6650435 Fix usage of dict.keys in apiclient.exceptions
  35dc1d7 py3kcompat: remove
  9f1e7eb Correct docstring in load_plugin_from_args
  0c4d2c7 Removed set_loaded() method from Resource class
  3b248dd Add to_dict() method to apiclient Resource
  71c22e9 Handle 300 status code in common HTTPClient

cliutils:
  9a7f2f8 Merge "Deleted duplicated method in cliutils."
  8f2effd Use `six.text_type` instead of `str` in cliutils
  885828a Deleted duplicated method in cliutils.
  71a2d90 Add common methods to cliutils

Change-Id: I0c8849d8d5dd71f34aa5dbcd2c0875c164706d70
2014-02-27 13:30:34 -08:00
Joe Gordon e0272b0578 oslo-sync of low hanging fruit
Generated with:
 ./update.sh --base novaclient --config-file
../python-novaclient/openstack-common.conf --dest-dir
../python-novaclient/

Skipped modules: apiclient and cliutils due to oslo issue in apiclient
(cliutils depends on apiclient).
https://review.openstack.org/#/c/76718/

Removed non-existent modules from openstack-commit.conf:
  py3kcompat I06b90f789ae21f2ef8b8071b4298bfc0406482a6
  intall_venv_common I84267f3c6726cb2e750f615e107c48b12c6ed353

Synced patches:
__init__.py [first sync]:
   c178e56 Add basic Python 3 tests
  12bcdb7 Remove vim header
  547ab34 Fix Copyright Headers - Rename LLC to Foundation
  96b9a54 Rajaram/Vinkesh|Added nova's serializaiton classes into common
  c85e1f7 Initial skeleton project

gettextutils:
  6d55e26 Add support for translating log levels separately
  afdbc0a Fix E501 in individual openstack projects
  6b2d15f Merge "Add support for locales missing from babel"
  9d529dd Make Message keep string interpolation args

importutils:
  885828a Deleted duplicated method in cliutils.

strutils:
  bec3a5e Implements SI/IEC unit system conversion to bytes

timeutils:
 d815087 Merge "Fix spelling errors in comments"
 71208fe Fix spelling errors in comments

Change-Id: I8f82acb63e61a64eeb6caba9d2d9c81d9cb766d8
2014-02-26 17:25:11 -08:00
zhang-jinnan ca721d6e9b Remove None for dict.get()
Because If no default value is specified it defaults to None already.

Change-Id: I3caad9f17840347e30465c7bd4c9c4fe53d991e3
2014-02-19 21:02:11 +08: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
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
Andrey Kurilin 871c5fc1be Sync cliutils from oslo
In the process of unification of the clients code we should
reuse common functionality from Oslo.

Related to blueprint common-client-library-2

Change-Id: Ia5e4e60f07561849f75d88b8a2ea3d23d6d5ff6d
2014-01-15 15:03:22 +00:00
Andrey Kurilin 6cf101e9ee Sync apiclient from oslo
In the process of unification of the clients code we should
reuse common functionality from Oslo.

Related to blueprint common-client-library-2

Change-Id: I078b7be864f34596c846832d6201fee9b18c42f8
2014-01-15 14:52:50 +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
Chuck Short cab4617225 Update oslo from oslo-incubator
Update oslo from oslo-incubator includes various python3
fixes.

Change-Id: Ie30a4c319125c3d4fb704254f8553bc8fd960eae
Signed-off-by: Chuck Short <chuck.short@canonical.com>
2013-09-06 08:03:22 -04:00
Chuck Short 61a8063954 Sync py3kcompat from oslo
Python3 reorganized the standard library and moved several
functions to different modules and combined modules. Six
provides a consistent interface to the module through
six.moves

However urllib/urlparse is not covered by six.moves so
py3kcompat adds python2/python3 compatibility layer for
urllib/urlparse.

Change-Id: If1436d2260f1c8b6df8c514c8730e7bcf0e648b8
Signed-off-by: Chuck Short <chuck.short@canonical.com>
2013-08-23 14:39:23 -04:00
Chuck Short 626c480559 Update oslo
Update gettext, striutils, timeutils and install_venv_common
from oslo.

Change-Id: Ibd9067e3e2be335ef75f0e4a5e4000d143030ab7
Signed-off-by: Chuck Short <chuck.short@canonical.com>
2013-08-15 09:17:08 -04: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 20a3595e3e Synchronize code from oslo
Use commit 8d0228837c40c02d93d80ae0a179275ac2d7f277
Merge "Break out common functionality for filters and weights"
(Fri May 17 12:12:40 2013 +0000)

Change-Id: Ib2ec8ff64e036a07fad2a38319a9a4c40a698898
Signed-off-by: Shane Wang <shane.wang@intel.com>
2013-05-21 13:49:39 +08:00
Roman Podolyaka f08ac04a27 Migrate to pbr.
openstack.common.setup and openstack.common.version are now in the
standalone library pbr, so all projects using those two should
migrate.

Fixes bug 1179007.

Change-Id: I7ac1c37f0bf148619dffff8f454db05fc192e471
2013-05-19 10:00:38 +03:00
Alessio Ababilov c15c8f8e97 Synchronize code from oslo
Use commit 8c964a25a0904f4153eb4fbcfb3cfd4d8a357e0c
Do not import openstack.common.log in strutils
(Mon Apr 29 11:13:51 2013 +0300)

Changes:
    8c964a2 Do not import openstack.common.log in strutils
    e700d92 Replaces standard logging with common logging
    47e9e98 Fix the co-authored-by processing.
    6e8b9ba Include Co-authored-by entries in AUTHORS.
    547ab34 Fix Copyright Headers - Rename LLC to Foundation
    2cb8e45 support ISO 8601 micro-second precision

Change-Id: Ida31e60ecac5ba89e72a1d8b0a79fd608ad19092
2013-04-29 11:48:09 +03:00
Davanum Srinivas 8ce2330247 Fix problem with nova --version
Update to latest openstack.common.version.py and fix __init__.py
to get "nova --version" to work properly again

Fixes LP# 1165325

Change-Id: I29e54cd4cf79759407f3967518e9be575abd994a
2013-04-08 12:15:03 -04:00
Monty Taylor 0206c2d5dd Update to latest openstack.common.setup.
We actually don't need the silly versioninfo file at all anymore.

Change-Id: Ic759c39a29b07d41a96849db84a7f9990ec8a3eb
2013-03-28 06:40:13 +01:00
Davanum Srinivas c5b579926f Fix Copyright Headers from LLC to Foundation
follow the lead from nova and oslo projects

Change-Id: I270c5f1e4eefa4b72e292bfb4a4c60de0c3f6e4a
2013-03-13 20:12:23 -04:00
Flaper Fesp 47e6bc25ae Decodes input and encodes output
Currently novaclient doesn't handle properly incoming and outgoing
encode / decode process. As a solution for this, this patch implements a
decoding process for all data incoming from the user side and decodes
everything going out of the client, i.e: http requests, prints, etc.

This patch introduces a new module (strutils.py) taken from
oslo-incubator in order to use 2 of the functions present in it:

About safe_(decode|encode):

    Both functions try to encode / decode the incoming text using the
    stdin encoding, fallback to python's default encoding if that
    returns None or to UTF-8 as the last option.

    In both functions only basestring objects are accepted and they both
    raise TypeError if an object of another type is passed.

About the general novaclient changes:

    In order to better support non-ASCII characters, it is a good
    practice to use unicode interanlly and encode everything that has to
    go out. This patch aims to do that and introduces this behaviour in
    the client.

Testing:

    A good test (besides using tox) is to use nova client with and
    without setting any locale (export LANG=).

Fixes bug: 1061156

Change-Id: I20b75e42b0c3dac89f1048faa1127253a64f86c7
2013-03-04 19:01:27 +01:00
Thomas Schreiber 68e6af73ba A minimum of Python3 fixes so that installation works without errors/warnings.
Fixes bug: 1130937
Change-Id: I740652fcd5804fc1c120fc409afdf4693c8e5781
2013-02-20 23:17:49 +01:00
Alessandro Pilotti 8be01b650e Fixes setup compatibility issue on Windows
Fixes Bug #1052161

"python setup.py build" fails on Windows due to a hardcoded shell path:
/bin/sh

setup.py updated using openstack-common/update.py

Change-Id: I9c8cf84ada189d8f27448ecda23f51c021d08818
2012-11-05 18:01:47 +02:00
Josh Kearney 2f7b032910 Pull in latest openstack-common changes and fix a minor PEP8 issue.
Latest openstack-common commit: d887090b5a31672e4a12f302b3818e2b0933bef0

Change-Id: I5a4ffb043ab24f8618a8285112c0c5992ea129e7
2012-10-25 11:48:15 -05:00
Alessandro Pilotti bfb0f70f40 Fixes setup compatibility issue on Windows
Fixes Bug #1052161

"python setup.py build" fails on Windows due to a hardcoded shell path:
/bib/sh

Change-Id: I34f58ea09317c0be6ac23c5d9591bc83bc78782b
2012-09-18 00:05:27 +03:00
Mark McLoughlin f2d2e4cb06 Fix usage-list date range to use UTC time
Fixes bug #1045456

The date range in Nova's os-simple-tenant-usage is expected to be in UTC
time since launch/termination dates are stored in the DB in UTC time and
we use the client supplied parameters to query DB without conversion.

Switch from using datetime.today() to datetime.utcnow() to fix the issue.

Add a test for the default date range.

Import timeutils from openstack-common so we can control the return value
of utcnow() in the tests.

Change-Id: Iac77e3a4cc9561714d1492c54cef931f9764531e
2012-09-03 20:13:31 +01:00
Monty Taylor 632a8ec89e Add read_versioninfo method
Change-Id: Ida728f07f253d15c9ce64da1be4ba4f3a7022ca7
2012-06-26 21:03:40 -05:00
Monty Taylor 65529cd929 Implement post-tag versioning numbering.
Change-Id: If886d1ee70420fe52776663ec9cf75bf31d54012
2012-06-26 11:03:44 -05:00
Brian Waldon 3f4591142f Use openstack-common for AUTHORS generation
Also add .mailmap entries for Jake Dahn and James E. Blair

Change-Id: I1ec02aa5302922f3db6a3ad457f4f7c6a006ba00
2012-06-11 08:40:19 -07:00