Add simple script to setup mysql and postgresql databases, this script
can be run by users during testing and will be run by CI systems for
specific setup before running unit tests. This is exactly what is
currently done by OpenStack CI in project-config.
This allows to change in project-config the python-db jobs to
python-jobs since python-jobs will call this script initially.
See also
http://lists.openstack.org/pipermail/openstack-dev/2016-November/107784.html
Change-Id: I5191afb3e8c0fff9f82cb2d937343a67348c9c34
Needed-By: I5ca756d8aeb4fe90fd4ca7ac381a7f684b5c56fb
(cherry picked from commit b628acec24)
This releasenote describes the effect of the following changes:
* Ie8594ff339a13bf190aefa308f54e97ee20ecfa2
* I77921366a05ba6f9841143af89c1f4059d8454c6
* Ie839e0f240436dce7b151de5b464373516ff5a64
* I34f5623d6804e9fe594e6b5b196ea4a162578196
Change-Id: Iaa411c3f3bbe5397da239409f504dcb4d769b08b
This patch adds equivalent expand/migrate/contract migration scripts for
Community Images. The expand migration
'ocata_expand01_add_visibility.py' creates a new migration branch 'expand'
from the last known migration i.e., 'mitaka02'. Similarly, the contract
migration 'ocata_contract01_drop_is_public.py' creates another new
migration branch called 'contract' from the last known migration.
The data migration 'ocata_migrate01_community_images.py' migrates
all rows in the database at once. There is possibility of performance
degradation while the data migrations are running.
Change-Id: I34f5623d6804e9fe594e6b5b196ea4a162578196
Partially-Implements: blueprint database-strategy-for-rolling-upgrades
Co-Authored-By: Hemanth Makkapati <hemanth.makkapati@rackspace.com>
Depends-On: Ie839e0f240436dce7b151de5b464373516ff5a64
The parent of this patch introduced the change to Alembic-based
migrations. This commit builds on top of that by adding expand,
migrate and contract commands to the glance-manage tool.
Appropriate documentation is updated and failing tests are adjusted
to accomodate the new database versioning schema.
Data migrations are expected to be run in the background with older
Glance services being active during the upgrade process.
Partially-Implements: blueprint database-strategy-for-rolling-upgrades
Co-Authored-By: Hemanth Makkapati <hemanth.makkapati@rackspace.com>
Change-Id: Ie839e0f240436dce7b151de5b464373516ff5a64
Depends-On: I77921366a05ba6f9841143af89c1f4059d8454c6
* Functional tests now use alembic instead of sqlalchmey-migrate
to build and destroy test database.
* All tests now use a file-based sqlite db as opposed to an in-memory
database.
Partially-Implements: blueprint alembic-migrations
Change-Id: I77921366a05ba6f9841143af89c1f4059d8454c6
Depends-On: Ie8594ff339a13bf190aefa308f54e97ee20ecfa2
This change proposes the use of Alembic to manage Glance migrations.
* Introduce new directory ``alembic_migrations`` under
``glance/db/sqlalchemy``. This directory is the home for all glance
migrations henceforth. All the migration scripts reside under
``versions`` directory.
* All the migrations up to Liberty are consolidated into one migration
called ``liberty_initial`` as those migrations are not supported
any more. Mitaka migrations are retained but under a different naming
convention.
* All the glance manage db commands are changed appropriately. They now
use alembic to perform operations such as ``version``, ``upgrade``,
``sync`` and ``version_control``.
* The database versions are not numerical any more. They are the revision
ID of the last migration applied on the database. Since we don't
support migrations before Mitaka, the Liberty version ``42`` will now
appear as ``liberty``. Migration ``43`` and ``44`` in Mitaka appear as
``mitaka01`` and ``mitaka02`` respectively.
* When one performs a ``sync`` or ``upgrade`` command, the database is
first stamped with an equivalent alembic version before upgrading.
* The older migration scripts are retained so that users can correlate
with the new migrations. Also, it is probably safe to retain them until
the alembic migrations become stable. Similarly, the ``migrate_version``
table is not removed yet.
Partially-Implements: blueprint alembic-migrations
Change-Id: Ie8594ff339a13bf190aefa308f54e97ee20ecfa2
Co-Authored-By: Alexander Bashmakov <alexander.bashmakov@intel.com>
Depends-On: I1596499529af249bc48dfe859bbd31e90c48a5e0
Current release note says adding a member to a private image will
result in a 409, but it actually results in a 403. Changing the text
to say the more neutral "4xx response" without specifying a return
code, because there are several errors that could happen here, for
example, 401, 404, 403. Interested parties will know to look in the
api-ref, where the error codes can be listed with more context than
is appropriate for a release note.
Change-Id: If513e5a0441b2c110c9339544a47ad33d77afaaf
Add text to the api-ref to document the changes introduced by
"Implement and Enable Community Images", whose change identifier
is I94bc7708b291ce37319539e27b3e88c9a17e1a9f.
Change-Id: Ib18c6ac226267ec15b399b71dbfefed33a1dbffd
This change updates the glare plugin loader tests to avoid mocking
private methods of objects coming from the stevedore library. It looks
like some of the tests could probably be deleted, since they seem to be
testing stevedore and not glance, but it was easier to just fix them
than to verify that.
Change-Id: I5ee634d0af9d7942bfd5b69c3e7336876ab42269
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
The query added with CI change [0] was using the python 'and'
instead of sqlalchemy's 'and_()'. This patch changes that.
This patch also further refines the query to look specifically
for visility 'private' instead of '<> public' for accuracy during
setting of visibility to 'shared'.
[0] I94bc7708b291ce37319539e27b3e88c9a17e1a9f
Change-Id: I6851aa0e5ca8cecaff518609c14cd528bca95ade
See Id675f335957a95fcfce61934dfbfbb2c64af761a, the
_find_entry_points is now list_entry_points.
We should be using extension.ExtensionManager.make_test_instance
to set up the extensions like the one in:
Ie9af444e7f8842ffb3e275ede52b802de02e6e99
Just to get past the problem we have merging stevedore
upper constraints, filing this review
Change-Id: I141b17f9dd2acebe2b23f8fc93206e23bc70b568
This patch fixes tests that were using mock to replace a private method
of a library instead of using the public testing interface provided by
that library. The new release of stevedore changes the name of that
private method, which breaks these tests. Because the requirements list
is gated on glance's unit tests, the test failure is preventing other
projects from adopting the new release of stevedore.
Change-Id: Ie9af444e7f8842ffb3e275ede52b802de02e6e99
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This option will be mentioned in an upcoming OSSN. I think it will
be confusing to operators if the option is removed now, and it will
also be confusing if the text says "will be removed in the Ocata
release". This patch changes the text to say "will be removed in
the Pike release or later".
Corresponding release note has been added.
Co-Authored-By: Brian Rosmaita <brian.rosmaita@rackspace.com>
Co-Authored-By: Nikhil Komawar <nik.komawar@gmail.com>
Change-Id: Ib599afaee8f48f141be125a4016aece1e40e36cf
This is the release note for "Implement and Enable Community Images",
whose change identifier is I94bc7708b291ce37319539e27b3e88c9a17e1a9f.
Change-Id: I3502de58b1d2460f8a79500b033dd58f7de28f5e
Change [1] fixed partial downloads in glance and changed the
status codes to be more appropriate. Updating api-ref to reflect
what the v2 code will now do.
[1] I3cd47b998be79604511b3cd4879209820cf776b7
Change-Id: I70e3f60c3ce3d0eeb7b457496dbbe623b2ff473e
In most places, the api-ref refers to the 'namespace_name' in URLs,
but in two places in the metadefs-namespaces-properties file, the
term 'namespace_id' is used. This patch fixes those two occurrences
in the interest of consistency, but also because it is causing a
warning that's interpreted as an error in the latest version of
os_api_ref [0].
[0] http://lists.openstack.org/pipermail/openstack-dev/2017-January/110606.html
Change-Id: I86435a216c9c8d8bd391fb662049662d7d303ae5
These tests check the value of the is_public attribute after attempting
to set it in an image update. Before https://review.openstack.org/369110
these work, after test_update_image_private() fails.
https://review.openstack.org/#/c/423499/ fixes the regression, let's
add these tests from the Every-Little-Bit-Helps Dept. to verify one last time.
Depends-on: I996fbed2e31df8559c025cca31e5e12c4fb76548
Change-Id: I992da5c291036279c84bff53b83661e461f80ad1
Updating an image in v1 skipped the work to ensure that the image dictionary
would be Image v2 compliant. It was hidden inside an else clause and was only
run when there was no image id provided. This meant that only sometimes would
is_public be appropriately converted to visibility.
A functional test has been added to prevent regression and the code has been
mildly altered to fix the issue.
Closes-bug: #1658164
Change-Id: I996fbed2e31df8559c025cca31e5e12c4fb76548
Change-Id I94bc7708b291ce37319539e27b3e88c9a17e1a9f (Community
Images) entails a minor version bump in the v2 API.
Change-Id: I2b7cd5ec9b974ebc738feb89ef22c428fbe3be06
Depends-On: I94bc7708b291ce37319539e27b3e88c9a17e1a9f
This change replaces the existing boolean 'is_public' column for
the 'images' table with enum 'visibility' column featuring the
four explicit visibility values - public, private, shared,
and community.
This change also implements and enables all backend code to
utilize the new values.
Co-Authored-By: Timothy Symanczyk <timothy_symanczyk@symantec.com>
Co-Authored-By: Dharini Chandrasekar <dharini.chandrasekar@intel.com>
Implements: blueprint community-level-v2-image-sharing
Closes-Bug: #1394299
Closes-Bug: #1452443
Depends-On: I6e3268f3712cbc0aadb51d204c694023b92d55a5
Change-Id: I94bc7708b291ce37319539e27b3e88c9a17e1a9f
Added section about minor typos in comments being disallowed,
following the discussion at the Glance meeting on 3 November.
Change-Id: Ic6c6369895a7095c01c1810358f4355c5cc8f0fa
psutil 2.x and above has a lot of API changes as described in:
https://github.com/giampaolo/psutil/blob/master/HISTORY.rst
So we should work correctly with both old and new psutil
versions by using a version check and use the correct
method/attributes. This allows to eventually unlift the version
cap that starts to hurt.
Related-Bug: 1645918
Change-Id: I6be775e83876271012f6b7a777ea2b5cc3a008f6