Commit Graph

31 Commits

Author SHA1 Message Date
Stephen Finucane b28b0e29d2 db: Remove old sqlalchemy-migrate migrations
These are no longer used and no longer necessary. Remove them.

Change-Id: Ibd7d46aefb3794dd342c8afb40dbb8d4ce00a976
Implements: blueprint remove-sqlalchemy-migrate
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-07-13 17:18:55 +01:00
wangxiyuan 2f803d3fa9 Remove DB downgrade
As downgrade are not supported after Kilo, we should remove them now.
Roll backs can be performed as mentioned in the below link:
http://docs.openstack.org/ops-guide/ops-upgrades.html#rolling-back-a-failed-upgrade

The DB downgrades were deprecated in Glance Mitaka release by commit
e3366afdfb.

Change-Id: I937d15d93f16a3e44a50e6ff1a469098eab67c79
Implements: blueprint remove-db-downgrade
2016-09-01 10:53:08 +08:00
Jenkins fc818fdb97 Merge "Assert problems in Glance raised by Bandit" 2016-01-19 01:15:29 +00:00
Drew Varner 62b5ebc718 Assert problems in Glance raised by Bandit
Fix all assert problems raised by Bandit. Asserts are potentially
problematic, since Python optimization sometimes removes them, so code
needs to remain safe and functional without the assert.

Two asserts are safe to skip, so they are deleted for improved error
messages. Three asserts are probably necessary, and are converted to
exceptions. Two asserts are probably necessary, and are instead made to
fail safely, and `# nosec` is added to the assert line.

This also enables the assert test in bandit's configuration.

Change-Id: Ic69a204ceb15cac234c6b6bca3d950256a98016d
Partial-bug: 1511862
2015-12-07 12:38:06 -06:00
kairat_kushaev c27c25f779 Import i18n functions directly
Import i18n functions from module directly and do not use
global module variables like _ = i18n._. It makes code shorter
and cleaner. It also to detect cases when these functions are not
used in module.

Change-Id: Iaa593ac1f2dd15cbcad049bef6ba68f1cfa610da
2015-12-07 18:20:43 +03:00
Victor Stinner 1c186e23fd Use oslo_utils.encodeutils.exception_to_unicode()
* Replace glance.common.utils.exception_to_str() with
  oslo_utils.encodeutils.exception_to_unicode().
* Remove exception_to_str() from glance.common.utils
* Add "from oslo_utils import encodeutils" and remove "from
  glance.common import utils" (when utils is no more used)
* glance/api/v2/images.py: replace utils.exception_to_str() with
  six.text_type() to cast the oslo_i18n message to Unicode

Glance exception_to_str() function was not compatible with Python 3,
whereas exception_to_unicode() is compatible with Python 3, it's in Oslo
common libraries and it's well tested.

This patch was first generated by a tool (modified version of sixer),
and then fixed to respect the PEP8 (especially the constraint of 80
columns).

Change-Id: I86008c8adc0c5664f96573c1015cc15e2d06e3e2
2015-07-17 18:31:03 +02:00
Louis Taylor 0acff569e0 Move to graduated oslo.log module
This removes the log module from the oslo incubator directory.

Change-Id: Ib017cc2777e27c58b376c3138c9fba614783cc34
2015-03-12 11:48:24 +00:00
James Carey 3f2a56ae65 Move from using _ builtin to using glance.i18n _
The builtin _ should not longer be used.  Instead _
should be explicitly assigned from glance.i18n.

This patch does the following:
  (1) adds these explict assignments to any
      glance file that was missing them,
  (2) removes the defintion of _ as a builtin from
      tox.ini so that a pep8 failure will occur
      if _ is not defined,
  (3) removes calls to install().

This removes the last direct use of gettextutils by glance.
The indirect uses, via openstack/common, will be removed
in the next sync with oslo.

Change-Id: Ie54e8a67e747e022cc01022dfad35d89686bdfc4
2014-11-21 18:51:19 +00:00
Erno Kuvaja fa7888d920 Change Glance to use i18n instead of gettextutils
Changing all Glance files to use i18n instead of gettextutils for log
translations.

Finishes bp refactoring-glance-logging

Change-Id: I90d6ab4f7e09f4e7591921f9526de6370ebdb789
2014-11-21 17:12:35 +00:00
Julien Danjou fadbef8511 hacking: upgrade to 0.9.x serie
Change-Id: I252758fd633662de9659a402c5e3d7e3ce1fae0f
2014-10-06 14:41:03 +02:00
Erno Kuvaja e694ed04f6 Refactoring Glance logging lowering levels
This change fixes translations to be using correct translation functions.
Contains few log level drops for too high logging levels.

This PS does not address logging changes for modules under glance/store/
due to the new repo request. After stores are moved to their own repo
new PS will be submitted for those.

This PS does not touch the test code.

Separate PS will be submitted for log lever raises withing codebase
as requested during the spec review.

Related to bp refactoring-glance-logging

Change-Id: I683c35face8d5b7056ef7fedcd75deb63dbbf8e2
2014-07-17 10:03:12 +00:00
Leandro I. Costantino 627d5fbc13 Replace unicode() for six.text_type
To support Python3, unicode() calls has been replaced by
six.text_type.
Added utils.exception_to_str(): is the proper way to convert
an exception to string, since it manages logic related to
encoding.

Change-Id: I27101390e4f95e5c7690b1b445b7e75b8bcb9a08
Closes-Bug: #1284677
2014-05-05 15:40:02 -03:00
Jenkins 78abbcb7c7 Merge "Log 'image_id' with all BadStoreURI error messages" 2014-03-11 00:25:39 +00:00
Venkatesh Sampath c0e1d5bd29 Log 'image_id' with all BadStoreURI error messages
- handle all BadStoreUri exceptions raised by 'legacy_parse_uri'
  function in
one location so that it becomes easier to log the error message with
'image_id'
- add tests for 'legacy_parse_uri'

Closes-Bug: #1243704

Change-Id: Ifc5de11832860ed51c1eb359d6f5cf78de8c0ba4
2014-02-21 21:27:48 +05:30
Fengqian Gao 6013c0b688 Keep py3.X compatibility for urllib
Use six.moves.urllib.parse instead of urllib

Partial-Bug: #1280105

Change-Id: Id08fd5b4dad35c888f302a69be56252fe8276bcb
2014-02-18 13:55:54 +08:00
Fengqian Gao 0b3fbf88dd Use six.moves.urllib.parse instead of urlparse
To keep Python 3.x compatibility, use six.moves.urllib.parse to
replace urlparse.

Partial-Bug: #1279611

Change-Id: Ibe5e028acd12e8d753d95cfd9c3f63072278b120
2014-02-17 09:52:00 +08:00
Jenkins 9c0ada37c9 Merge "Bump hacking to 0.8 and get python 3.x compatibility" 2014-01-16 01:44:54 +00:00
Noboru arai 8de10b0f34 Remove vim header
No need to set tabstop tons of times, this can be set in your vimrc
file instead.

More disucssion:
http://openstack.10931.n7.nabble.com/Remove-vim-modelines-td21780.html

Change-Id: I3b830a5bb831a63c188109e6fad66ba48884fff3
Partial-Bug: #1229324
2014-01-14 16:03:28 +00:00
Sergio Cazzolato 2eca65eb5f Bump hacking to 0.8 and get python 3.x compatibility
Bump hacking dependency to 0.8 to get python 3.x compatibility
Fixes done in order to avoid errors after enabling hacking 0.8

Change-Id: Ic878fe2e1bd3f65f7f95a9b5c7a192dac81b749d
Closes-Bug: #1257282
2014-01-09 23:25:22 -05:00
Stuart McLaren 408cebacc3 Avoid printing URIs which can contain credentials
Fix for bug 1233275.

Change-Id: I24d8b57418eb678767b33840973a632eb2132c6a
2013-10-10 14:36:06 -07:00
John Bresnahan 62068a3cf9 Remove internal store references from migration 015
Migration 015 was accessing a object internal to the swift store driver
and changing its behavior in order to do the migration.  This worked but
it made the assumption that the driver logic would not change without
also changing the migration code.  These two should not be dependent
upon each other.  This patch removes all dependencies on swift from the
migration code.

Fixes bug: 1025746
Change-Id: Ic9559ae809b8784d0992cb5275d3911a725110c8
2013-03-15 13:55:39 -10:00
Matthew Treinish 8e9da71011 Fix migration 015 downgrade with sqlite.
This adds a list() call around the select sqlalchemy to pull
the list of locations that start with swift. The list() call
forces the select query to finish, before we try to update the
database.

Change-Id: I63f2e184a49e8bbd7115dd59d644506ea4069558
2013-02-22 11:10:14 -05:00
annegentle a2b9bed75d Updates OpenStack LLC with OpenStack Foundation
Patchset addresses reviewer's comments, rebase against master,
and follows new guidance from Foundation:
http://wiki.openstack.org/Documentation/Copyright

Change-Id: I94367461505778973528eb8835d991f4fb796dab
2013-02-17 19:19:43 -08:00
Zhongyue Luo c05dd1c819 Clean up pep8 E127 violations
Fixed E127 errors.
All ignores are to be removed in the next sequence of patches.

Change-Id: I56839ebe63dbccbb830dfed8923892c7c0837d7e
2012-09-29 19:01:21 +09:00
Zhongyue Luo 9f9f22cd80 Clean up pep8 E122, E123 violations
Fixed E122, E123 errors.
All other ignores are to be removed in the next sequence of patches.

Change-Id: I4b3edd9d1b2804ea7de255136da01b19f32abe1c
2012-09-19 16:41:51 +08:00
Dan Prince 8b2d038185 Adds multi tenant support for swift backend.
Updates the swift store to support multiple tenants:

 * Added configuration option for swift_store_multi_tenant.

 * Updated the swift connection creation logic so that in multi-tenant
   mode the token and storage URL from the service catalog are used
   to create swift connection.

 * When in multi-tenant mode locations URL's (stored in the DB) do
   not contain hard coded swift credentials.

Includes unit tests to verify multi-tenant swift storage URLs.

Partially implements blueprint: swift-tenant-specific-storage.

Change-Id: I45fc97027e6f211ac353513c2d9d6da51ccf4489
2012-07-20 10:12:02 -04:00
Brian Waldon 279d07eebb Update 'logging' imports to openstack-common
Change-Id: Ia1a7b5062e7f882971f2061274f6a4a44cfc8ced
2012-07-12 15:59:26 -07:00
Brian Waldon 4363af6cc8 Standardize logger instantiation
Use LOG for variable name and __name__ for logger name. Also
document this fact in HACKING.rst

Fixes bug 1015685

Change-Id: I0d9d80bef66197a28ed3d650f17859202048d776
2012-06-25 08:27:08 -07:00
Alex Meade ed16167425 Stop revealing sensitive store info
Use simpler error messages and log the details.

Fixes bug: 1012268

Change-Id: I3c4d98c81dee6676916c60e71a749037ae1edc81
2012-06-18 13:30:58 -04:00
Alex Meade e2c52ddfa6 Add tests and simplify GlanceExceptions.
This also fixes some incorrect use of GlanceException parameters.

Fixes bug: 1009122
Fixes bug: 1010140

Change-Id: Ic77856686a0259da2318e05b15f3d382508c00b9
2012-06-11 09:33:08 -04:00
Brian Waldon a68eb24431 Create 'simple' db driver
Move the core of glance.tests.unit.utils:FakeDB to glance.db.simple.
This 'simple' driver is an alternative to the traditional sqlalchemy
driver. Additionally, the sqlalchemy driver has been moved from
glance.db to glance.db.sqlalchemy. The simple db driver is only
available to be used by tests for now.

Related to bp refactor-db-layer

Change-Id: I9d33a433c0c03e53fb5a3491076086427ae694b3
2012-06-07 09:20:50 -07:00