Commit Graph

35 Commits

Author SHA1 Message Date
Belmiro Moreira d23cf26ec7 Change API unexpected exception message
The "API unexpected exception" message can now be configured
by the cloud provider.

By default it continues to display the "launchpad" webpage to
report the nova bug, but it can be configured by the cloud
provider to point to a custom support page.

Change-Id: Ib262b91b57f832cbcc233f24f15572e1ea6803bd
Closes-Bug: #1810342
2021-02-17 21:30:07 +00:00
Takashi Natsume 1d0a0e8c20 Remove six.moves
Replace the following items with Python 3 style code.

- six.moves.configparser
- six.moves.StringIO
- six.moves.cStringIO
- six.moves.urllib
- six.moves.builtins
- six.moves.range
- six.moves.xmlrpc_client
- six.moves.http_client
- six.moves.http_cookies
- six.moves.queue
- six.moves.zip
- six.moves.reload_module
- six.StringIO
- six.BytesIO

Subsequent patches will replace other six usages.

Change-Id: Ib2c406327fef2fb4868d8050fc476a7d17706e23
Implements: blueprint six-removal
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
2020-11-07 03:25:02 +00:00
Stephen Finucane eee57f2380 trivial: Remove remaining '_LE' instances
We've been slowly removing these as we go. Remove the final few '_LE'
occurrences now.

Change-Id: I75ebd2e95a0c77585d7b4329ca01e4bacc1dd7c4
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2020-05-18 16:52:20 +01:00
Zhihai Song 6df327694f Use oslo_log instead of logging
Some modules can be converted to use oslo_log instead of logging
lib.

Change-Id: I00a676ef266f47590f8c46d4a1a4eb876ab1f27d
2016-05-27 12:18:32 +00:00
Victor Stinner f0082849df Fix version unit test on Python 3
With this change, "tox -e py34" now pass.

Changes:

* Replace unichr() with six.unichr()
* Replace StringIO.StringIO() with six.Bytes() in
  nova.crypto.generate_key_pair()
* On Python 3, replace UserDict.IterableUserDict with
  collections.UserDict
* Replace __builtin__.open with six.moves.builtins.open
* Replace ConfigParser import with six.moves.configparser
* On Python 3, get the original "queue" module instead of the "Queue"
  module in nova/virt/libvirt/host.py
* Replace urllib2 with six.moves.urllib
* tox.ini: "tox -e py34" now only runs nova.tests.unit.test_versions

Blueprint nova-python3
Change-Id: I056769c7c5b32276894f7aade8c0a27af81c42ae
2015-05-25 13:33:59 +02:00
Jenkins 936f914035 Merge "remove duplicate calls to cfg.get()" 2015-03-18 19:13:55 +00:00
Lars Kellogg-Stedman ce68b7f025 remove duplicate calls to cfg.get()
In nova/version.py, we were making duplicate calls to cfg.get(), like
this:

  NOVA_VENDOR = cfg.get("Nova", "vendor")
  if cfg.has_option("Nova", "vendor"):
    NOVA_VENDOR = cfg.get("Nova", "vendor")

This removes the "unprotected" calls.

Change-Id: I1993cca4cf5cf6eec6370597b37d4f53127d67a0
2015-03-18 10:03:26 -04:00
Davanum Srinivas 97d63d8745 Use oslo.log
Convert the use of the incubated version of the log module
to the new oslo.log library.

Sync oslo-incubator modules to update their imports as well.

Co-Authored-By: Doug Hellmann <doug@doughellmann.com>
Change-Id: Ic4932e3f58191869c30bd07a010a6e9fdcb2a12c
2015-02-22 07:56:40 -05:00
Davanum Srinivas af2d6c9576 Switch to using oslo_* instead of oslo.*
The oslo team is recommending everyone to switch to the
non-namespaced versions of libraries. Updating the hacking
rule to include a check to prevent oslo.* import from
creeping back in.

This commit includes:
- using oslo_utils instead of oslo.utils
- using oslo_serialization instead of oslo.serialization
- using oslo_db instead of oslo.db
- using oslo_i18n instead of oslo.i18n
- using oslo_middleware instead of oslo.middleware
- using oslo_config instead of oslo.config
- using oslo_messaging instead of "from oslo import messaging"
- using oslo_vmware instead of oslo.vmware

Change-Id: I3e2eb147b321ce3e928817b62abcb7d023c5f13f
2015-02-06 06:03:10 -05:00
Mike Durnosvistov c7718b2d8d Replacement `_` on `_LE` in all LOG.error
oslo.i18n uses different marker functions to separate the
translatable messages into different catalogs, which the translation
teams can prioritize translating. For details, please refer to:
http://docs.openstack.org/developer/oslo.i18n/guidelines.html#guidelines-for-use-in-openstack

There were not marker fuctions some places in directory network.
This commit makes changes:
* Add missing marker functions
* Use ',' instead of '%' while adding variables to log messages

Change-Id: I5a8f381b6f8fdb4e8febe9e6a901f7cdc6846646
2014-10-21 06:40:05 +00:00
Davanum Srinivas 826aed0ec7 Use oslo.i18n
oslo.i18n provides the i18n functions that were provided by
oslo-incubator's gettextutils module. Some tests that were
using internal details of the library were removed.

Change-Id: I44cfd5552e0dd86af21073419d31622f5fdb28e0
2014-07-18 14:28:09 -04:00
liu-sheng 74f953a1d7 Remove vi modelines
We don't need to have the vi modelines in each source file,
it can be set in a user's vimrc if required.

Also a check is added to hacking to detect if they are re-added.

Change-Id: I347307a5145b2760c69085b6ca850d6a9137ffc6
Closes-Bug: #1229324
2014-02-03 14:19:44 +00:00
Sergio Cazzolato ff56055a08 LOG.warn() and LOG.error() should support translation
Based on a search done in nova code,
some logs have to be changed in order to support translation

Change-Id: I371b714d004bcd0091ae569d4b82ae8d19fba708
Closes-Bug: #1235088
2013-12-03 21:45:42 -05:00
Eugene Nikanorov 20eac6c1df Remove locals() from various places.
fixes bug 1171936

Remove usage of locals() for string formatting

Change-Id: Ib05538095086ddefdb486c84da506af662ec5c9b
2013-07-17 09:30:48 +04:00
Monty Taylor b9b9a99b99 Remove openstack.common.version.
Change-Id: Ieb9ac3c2ce85777a33a2e15640670d03b2e7d2b7
2013-05-15 15:58:54 -07:00
Dirk Mueller f3826902a0 Improve Python 3.x compatibility
A bit of mechanical translation to clean
out the deprecated except x,y: construct

Change-Id: I80883b6b0c014bdf4799e8b7b2c4a4a07d951a0b
2013-04-22 04:22:24 +02:00
Kurt Taylor d17f9ab13d Update OpenStack LLC to Foundation
Update all references of "LLC" to "Foundation".

Change-Id: I009e86784ef4dcf38882d64b0eff484576e04efe
2013-02-26 19:15:29 -05:00
Mark McLoughlin 706a137005 Use oslo-config-2013.1b4
The cfg API is now available via the oslo-config library, so switch to
it and remove the copied-and-pasted version.

Add the 2013.1b4 tarball to tools/pip-requires - this will be changed
to 'oslo-config>=2013.1' when oslo-config is published to pypi. This
will happen in time for grizzly final.

Add dependency_links to setup.py so that oslo-config can be installed
from the tarball URL specified in pip-requires.

Remove the 'deps = pep8==1.3.3' from tox.ini as it means all the other
deps get installed with easy_install which can't install oslo-config
from the URL.

Make tools/hacking.py include oslo in IMPORT_EXCEPTIONS like it already
does for paste. It turns out imp.find_module() doesn't correct handle
namespace packages.

Retain dummy cfg.py file until keystoneclient middleware has been
updated (I18c450174277c8e2d15ed93879da6cd92074c27a).

Change-Id: I4815aeb8a9341a31a250e920157f15ee15cfc5bc
2013-02-19 21:16:32 -08:00
Monty Taylor 4336152768 Update to simplified common oslo version code.
Based on https://review.openstack.org/#/c/19957/

Change-Id: Ieefee2af8812d0217e95eeffb3cf53d8e55c8fe6
2013-02-10 04:05:15 -06:00
Daniel P. Berrange 4aa45d2900 Allow loading of product/vendor/package info from external file
Currently the version.py file hardcodes some basic info for
the NOVA_PRODUCT, NOVA_VENDOR and NOVA_PACKAGE constants. It
is desirable that OS distro vendors can override/extend this
data in packages they ship. Cloud providers may also desire
to do the same. This allows Nova to optionally load this
data from a /etc/nova/release file. That file should contain
the data in a trivial "ini" format. For example:

  [Nova]
  vendor = Fedora Project
  package = 1.fc18

Note that vendor sare not required to override all strings.
In this example, the 'product' field is not set, leaving
it on the default 'OpenStack Nova' value.

Change-Id: I3d8d32eaf35268c4b0908b0a93b7c9a2ea9c580a
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-12-19 18:54:33 +00:00
Daniel P. Berrange 481d6ff142 Remove obsolete VCS version info completely
The VCS version string in nova/version.py has been hardcoded
to 'LOCALBRANCH:LOCALVERSION' since change

  0bbb0e8cb1

The only places which use this info are some logging calls,
and since 'nova-manager version' command. The latter would
more usefully output the distro specific package string.

Delete the VCS related methods in version.py and replace their
usage with a new method version_string_with_package() which
appends the distro-specific package tag

Change-Id: I972b79c329198cb5376d537c6b672830094cd759
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-12-19 18:54:17 +00:00
Daniel P. Berrange ba9ee7eb22 Define a product, vendor & package strings in version.py
To have one single place where all code in Nova can access
product, vendor & package strings, extend version.py to
expose a product_string(), vendor_string() and package_string()
methods. The product will default to "OpenStack Nova", the
vendor to "OpenStack" and the package to None. The latter is
intended solely for OS distro vendors to include their package
version suffix (eg the "Release:" field from RPM or perhaps
a VCS tag)

Following changes will make this data configurable via a
plain text file, and then update various parts of Nova to
make use of the data.

Change-Id: I3eb14d11f8949ce909a8f529851913d3dccf0e8c
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-12-19 18:32:03 +00:00
Thierry Carrez f1189f4774 Bump version to 2013.1
Bump version to 2013.1 on master branch to open Grizzly development

Change-Id: Ie1632784c458b62b99321a0ba3a4d614672735b2
2012-09-19 08:24:28 +02:00
Thierry Carrez de6fdec710 Open Folsom
Switch version to 2012.2 to formally open Folsom.

Change-Id: If2e9e624a13444e4cb6a08f3bb76ca3027d7ef46
2012-03-20 08:17:40 +01:00
Mark McLoughlin bd035a5a6d Add optional revision field to version number
Add a revision field to the version number to account for releases from
the stable branch, e.g. 2011.3.1.

See http://wiki.openstack.org/StableBranchRelease

Change-Id: I34238a5639d34c9cf44655775a6be80fdd446233
2012-01-11 07:19:59 +00:00
Mark McLoughlin 0bbb0e8cb1 Remove some remnants of ChangeLog and vcsversion.py generation
Since moving to bzr, we no longer generate ChangeLog and vcsversion.py
and since commit deb31cb55 we no longer even have the bzr specific code
for generating them. So, let's just remove any references to them.

Change-Id: I4f96b9be48e289f9129ae8e3ad4cbc1b22db07d2
2011-12-06 12:08:43 +00:00
Thierry Carrez 4ffe41dffa Open Essex (switch version to 2012.1) 2011-09-09 09:27:26 +02:00
termie f69600e184 docstring cleanup, nova dir 2011-04-20 12:08:22 -07:00
Thierry Carrez e152c5d06a Diablo versioning 2011-04-15 11:39:08 +02:00
Thierry Carrez b64af9a52d Final versioning 2011-04-13 10:33:56 +02:00
Soren Hansen 10657adef2 Open Cactus development. 2011-02-02 11:23:08 +01:00
Soren Hansen c98a298c3a Set FINAL = True in version.py. 2011-02-02 11:16:00 +01:00
Soren Hansen 509c3b02f1 Add copyright and license info to version.py 2011-01-07 21:44:27 +01:00
Soren Hansen 8b3925e4d4 Less code generation. 2011-01-07 15:17:03 +01:00
Todd Willey f3ea4d876f Add default version file for developers. 2011-01-06 15:20:04 -05:00