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>
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
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
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
Backend store-specific requirements are not hard requirements, since
the choice of backend store is up to the operator. The
python-swiftclient and oslo.vmware modules are herein moved out of
requirements.txt and instead listed as optional requirements using
the extras functionality in setup.cfg.
Removed unnecessary import of swift backend in db migration, to allow
python-swiftclient to move out of hard requirements.
Cleaned up other requirements that are no longer used.
Change-Id: I9edbf8a614b5caaf38b4c59bd864b7baa55bf36b
Depends-On: I94d75e3d52c9e3e9f7a741a079d25b1bdff29b27
Closes-Bug: #1475737
* 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
oslo_config was moved out of the oslo namespace in oslo.config>=1.6.0.
Related-to: blueprint drop-namespace-packages
Change-Id: I30ecbf8f9de77496fcb643c7ad9738d79ad359f0
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
Changing all Glance files to use i18n instead of gettextutils for log
translations.
Finishes bp refactoring-glance-logging
Change-Id: I90d6ab4f7e09f4e7591921f9526de6370ebdb789
This commits removes the old `store` package from glance and adopts the
usage of the new glance.store library. The library was designed to
preserve backwards compatibility as much as possible. In fact, most of
the changes in this patch are related to function args ordering and not
function renames or workflow changes.
Some changes that are worth mentioning:
1. Glance store doesn't rely on a global config object. All config
options must be explicitly registered.
2. All store operations now accepted an optional context. This is a
fallout from the context not being required in the `Store` constructor
anymore.
3. Store drivers are behind a private package called `_drivers` and
they're not suppose to be accessed directly. Instead, functions like
`get_store_from_scheme` should be used.
4. Stores are disabled by default
5. All the store specific options are under the `glance_store` group.
DocImpact:
The old store related configuration options have been moved under the
`glance_store` section. However, the old options will go through a
deprecation path. That is, they'll still be read from the `DEFAULT`
section to give deployers enough time to update their config files.
In k-2, the deprecated options will be completely obsolete.
Closes-bug: #1291848
Implements-blueprint: create-store-package
Change-Id: Iaacc70993ad5da292b93de42bbecda73d53b19fd
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
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
- 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
To keep Python 3.x compatibility, use six.moves.urllib.parse to
replace urlparse.
Partial-Bug: #1279611
Change-Id: Ibe5e028acd12e8d753d95cfd9c3f63072278b120
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
Clean up imports due to F401 and F403 checks.
F401 'module' imported but unused
F403 unable to detect undefined names with wildcard import
Change-Id: I487edb157de1a6babc7ad8a3fb65f195e476c490
Migration 017 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. This patch removes all dependencies on
the swift driver from the migration code. This patch is smilar to
https://review.openstack.org/#/c/24552/.
Fixes bug: 1155749
Change-Id: Iffd800f62d61bf7608f7be5b23d76d702e6d4064
Since v2 is not using the registry client, it was not properly
encrypting image locations before storing them in the database. With
this change, the db layer in the glance domain now uses the metadata
encryption key as well.
To make this work, the declaration of the metadata_encryption_key option
had to move to glance.common.config to avoid circular module
dependencies.
Fixes bug 1128650
Change-Id: I3bb5da92ffda7bfe1bc064d11da8ecd4e6d9ab1d
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.1b3 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.
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.
Retain dummy cfg.py file until keystoneclient middleware has been
updated (I18c450174277c8e2d15ed93879da6cd92074c27a).
Change-Id: I4815aeb8a9341a31a250e920157f15ee15cfc5bc
Migration 015_quote_swift_credentials.py failed to take into account
encrypted location values. This patch adds a similar migration
that if the value is encrypted then:
1. Decrypts the value
2. Quotes the url string
3. Encrypts the value
4. Inserts back into DB
fixes bug 1081043
Change-Id: Iadfe5f5082b3932307eef8e76571e36c6ff9fce7