6453 Commits

Author SHA1 Message Date
Abhishek Kekane
d6ac7460ca Doc:Multiple stores support
Added documentation and modified api-ref documents to
reflect multiple stores support changes.

Related to blueprint multi-store
Change-Id: I932297df8149968d31a5367a9ca71a5629045445
2018-08-03 11:17:59 +00:00
Abhishek Kekane
cb45edf5c8 Add multi-store support
Made provision for multi-store support. Added new config option
'enabled_backends' which will be a comma separated Key:Value pair
of store identifier and store type.

DocImpact
Depends-On: https://review.openstack.org/573648
Implements: blueprint multi-store

Change-Id: I9cfa066bdce51619a78ce86a8b1f1f8d05e5bfb6
2018-08-01 08:53:47 +00:00
Brian Rosmaita
0b24dbd620 Multihash implementation for Glance
Partially implements blueprint multihash.

Requires glance_store 0.26.1

Co-authored-by: Scott McClymont <scott.mcclymont@verizonwireless.com>
Co-authored-by: Brian Rosmaita <rosmaita.fossdev@gmail.com>

Change-Id: Ib28ea1f6c431db6434dbab2a234018e82d5a6d1a
2018-07-31 21:28:38 -04:00
Zuul
ff77f59bd4 Merge "Remove Images API v1 entry points" 2018-07-27 06:08:31 +00:00
Abhishek Kekane
a308c44406 Hide old images
Added new boolean column "os_hidden" in images table. Images where
"os_hidden" = True will be omitted from the image list presented
to the user. This will apply to all image visibilities. However,
the images will continue to be discoverable. User can use
filter "os_hidden=true" in GET v2/images call to see all hidden
images.

Implements: blueprint hidden-images
Change-Id: If8f02ca94fdb8e1ac7a81853cd392988900172d1
2018-07-25 16:37:56 +00:00
Zuul
2f859cee90 Merge "Update glance documentation for trait support" 2018-07-17 07:38:57 +00:00
Lance Bragstad
3e47cbea34 Use glance.context.RequestContext in tests
There were some recent changes to oslo.policy that include specific
type checks of the ``creds`` parameter passed to the ``enforce()``
method:

  https://review.openstack.org/#/c/578995/

The above change allows consuming projects to pass instances
of oslo_context.context.RequestContext to the policy enforcer, as
opposed to building a dictionary instance from scratch multiple
different ways across projects.

The glance unit tests were failing with the new version of
oslo.policy (1.38.0) because they were passing in a Mock instance
which failed the new, more strict, type check.

This commit converts the setUp class of the tests to use an instance
of glance.context.RequestContext, which subclasses RequestContext
from oslo.context. It also sets the user_id and project_id attributes
of the context object to override authorization checks.

This should allow glance to pass with newer versions of oslo.policy.

Change-Id: I0a69bc9565d57fd6ad8484abc5fce0e8dd45f9f2
Closes-Bug: 1781976
2018-07-16 19:11:50 +00:00
Arvind Nadendla
b30ed486ae Update glance documentation for trait support
Required traits on the image allow specifying a server to be
built only on compute nodes which express those traits. The
Nova Scheduler has been updated to look at the image trait
properties when selecting compute nodes.

Updating the documentation for glance to explain the same.

Documentation is similar to flavor required traits documentation available
here: https://docs.openstack.org/nova/latest/user/flavors.html#extra-specs

Change-Id: I716821abf44238eecc9c4a1d198d8a31b87dedce
Implements: blueprint glance-image-traits
2018-07-13 11:09:37 -07:00
Erno Kuvaja
3dde3204d5 Remove Images API v1 entry points
This change removes option to configure Images API v1
This change removes Images API v1 endpoints from the router
This change removes all v1 tests
This change removes the v1 dependant glance-cache-manage command

This change does not remove all v1 codebase. Further cleanup and
decoupling will be needed.

Change-Id: Ia086230cc8c92f7b7dfd5b001923110d5bc55d4d
2018-07-13 10:21:49 +01:00
Doug Hellmann
f3496591ae fix tox python3 overrides
We want to default to running all tox environments under python 3, so
set the basepython value in each environment.

We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.

We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.

Change-Id: Ic9645685e0f9ae25b0b2b754b11e34d8aef41829
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-07-10 05:05:08 +00:00
Doug Hellmann
dd54b4881a replace cmp with total_ordering decorator
The cmp() built-in is no longer available under python 3 and the
__cmp__ method is not used. Remove __cmp__ and __ne__ and add a __lt__
method and use the functools.total_ordering decorator to provide all
of the rich comparison methods for StoreLocations.

Change-Id: Iae1d0c27bd82a42c80fc98f87c9b85edef527c51
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-07-09 12:52:20 +00:00
Zuul
4f16ddf347 Merge "Documentation for OSSN-0075 mitigation" 2018-07-06 20:59:49 +00:00
Brian Rosmaita
23d4e0e9c0 Documentation for OSSN-0075 mitigation
Updates the Glance Administration Guide and adds a release note.

Depends-on: https://review.openstack.org/#/c/579507/
Change-Id: I87343b67614da8dea3a09b10456f4bfc0042ed0e
2018-07-06 15:04:18 -04:00
Erno Kuvaja
864d1ad714 Change default age of purge_images_table to 180
The `glance manage purge-images-table` is supposed to be used
only if really required due to OSSN-0075. And the advice is
not to purge any freshly deleted rows due to the possible
ID collision of still in use images. This change increases
the default of "age_in_days" to 180 from it's original 30 to
stress this out. User can still define smaller age if they
must.

Change-Id: Idb13288b72b31940a357fc9b11db2d6bcd396261
2018-07-06 13:05:23 +01:00
Zuul
0a82f98084 Merge "Mitigate OSSN-0075" 2018-07-06 11:46:50 +00:00
Zuul
d01c004ccc Merge "Prevent taskflow creation in impossible import" 2018-07-05 16:32:14 +00:00
Abhishek Kekane
5cc9d99935 Mitigate OSSN-0075
Modified the current ``glance-manage db purge`` command to eliminate images
table from purging the records. Added new command
``glance-manage db purge_images_table`` to purge the records from images
table.

DocImpact
SecurityImpact

Change-Id: Ie6641659b54543ed9f96c393d664e52a26bfaf6a
Implements: blueprint mitigate-ossn-0075
2018-07-05 13:33:36 +00:00
Erno Kuvaja
0376185fb3 Prevent taskflow creation in impossible import
This change prevents taskflow creation during image import in cases
we know for sure that the image activation won't be successful.

The change follows the Glance principles of failing early and tries
to provide as meaningful error messages to the end user as possible.

Co-authored-by: Abhishek Kekane <akekane@redhat.com>
Closes-bug: 1758943
Change-Id: Iaee2781d07f4c0afd4f886f0b30b523bd47f1058
2018-07-02 13:53:21 +01:00
Kashyap Chamarthy
9a893e80c2 useful-image-properties.rst: Update default RNG source
Nova's libvirt driver has changed[*] the default source from /dev/random
to /dev/urandom:

    "Since libvirt 1.3.4, any RNG (Random Number Generator) device path
    (that returns random numbers when read!) is accepted. However, the
    recommended source of entropy is `/dev/urandom` (it is non-blocking;
    and doesn't have the same limitations of `dev/random`, which is a
    legacy interface)."

Update the relevant Glance documentation to reflect that.

[*] https://git.openstack.org/cgit/openstack/nova/commit/?id=814bfd93

Change-Id: I656b5c244b98202f3c8d019d0bbeddc4e7c0314a
Signed-off-by: Kashyap Chamarthy <kchamart@redhat.com>
2018-07-02 14:41:10 +02:00
Zuul
54329c6a21 Merge "Replace Chinese punctuation with English punctuation" 2018-06-20 17:22:14 +00:00
Zuul
83fd304ebe Merge "Refactor wait_for_scrubber_shutdown function" 2018-06-19 04:18:40 +00:00
Zuul
24e999932c Merge "Use group_regex to serialize scrubber tests" 2018-06-19 04:14:58 +00:00
Zuul
eb526faa72 Merge "Convert to string before using assertIn" 2018-06-19 04:14:57 +00:00
Zuul
e005e65833 Merge "Update Release CPL doc about periodic jobs" 2018-06-14 16:10:21 +00:00
Zuul
1b6f5998a0 Merge "Add image conversion plugin" 2018-06-12 06:30:38 +00:00
Erno Kuvaja
c6a663ea6d Add image conversion plugin
This change adds image conversion plugin for Interoperable
Image Import workflow.

Change-Id: Icd4f4f30b12f6dd073dcdbf7f842e933c75ae249
2018-06-11 21:23:50 +01:00
Zuul
5f89e04018 Merge "convert windows line endings to unix format" 2018-06-07 22:12:40 +00:00
Zuul
7d3ae1e9a6 Merge "Regenerate sample config files" 2018-06-07 20:15:45 +00:00
Zuul
0ec96bf910 Merge "Remove deprecated 'enable_image_import' option" 2018-06-07 14:47:03 +00:00
Brian Rosmaita
978be1f57e Regenerate sample config files
Regenerate the config files for Rocky-2 milestone release.

Change-Id: I4d008daacd500ffcc8c0551ae085af854828b8c1
2018-06-07 09:54:09 -04:00
Brian Rosmaita
bc80aad4f3 Update Release CPL doc about periodic jobs
At the weekly Glance meeting on 2018-05-17 it was agreed that the
Release CPL will monitor the periodic "tips" test jobs and report
on their status at the weekly meeting.  This patch updates the
appropriate section of the Glance Contributor's Guide.

Change-Id: Ieeab3e3a42b8197f8b0544e97748ffdb8f620f13
2018-06-07 13:34:47 +00:00
Zane Bitter
7ef796bbcf Use group_regex to serialize scrubber tests
Instead of doing two separate test runs, use the group_regex option to
stestr to group tests that cannot be run in parallel into the same
worker.

Change-Id: I3d69d5c72d69484f4e1c9c0b11122d0cf3703d60
Related-Bug: #1768077
2018-06-07 09:25:04 -04:00
Zuul
8eb423be80 Merge "Refactor exception handling in cmd.api" 2018-06-07 09:52:46 +00:00
inspurericzhang
612e5cf12b Replace Chinese punctuation with English punctuation
Curly quotes(Chinese punctuation) usually input from Chinese input method.
When read from english context, it makes some confusion.

Change-Id: I9b8830179fb98f3a6bef479bbaa12df70311269a
2018-06-07 17:00:12 +08:00
Erno Kuvaja
95327964e3 Remove deprecated 'enable_image_import' option
Change-Id: I7752b30f0fabed07282d959e1ad313af072fdea5
2018-06-07 08:16:43 +01:00
Doug Hellmann
c3bcadf662 convert windows line endings to unix format
Under python 3 the linter does not like line endings with \r\n so
replace them with just \n.

Change-Id: I6728ee3fc39a5b22ca06fcd9055872271ab79a53
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-06-06 18:50:32 -04:00
Brian Rosmaita
837937f8d2 Add glance-eventlet-ssl-handshake-broken-py35 job
Blacklist the two currently skipped functional-py35 tests and
include them in a new non-voting job so that their failure is
obvious instead of hidden.

Change-Id: Ice8e114c6590b25f3ec79fbe4c06efaa245706c0
Partial-bug: #1769006
2018-06-05 22:32:28 -04:00
Zuul
3b2da73490 Merge "Fix wrong scheduler_hints name in CIM::ProcessorAllocationSettingData" 2018-06-05 20:31:35 +00:00
Zuul
2a1ce3a498 Merge "Modify the empty list ensure method" 2018-06-05 16:52:58 +00:00
Zuul
b19dd14878 Merge "Update pypi url to new url" 2018-06-05 02:08:48 +00:00
Zuul
08b87aaa3b Merge "Fix unreachable 'ImageSizeLimitExceeded' exception in image-upload" 2018-06-05 02:07:12 +00:00
Zuul
3466cf9cec Merge "Add periodic tips jobs" 2018-06-05 02:02:43 +00:00
Brian Rosmaita
3e6542a6e3 Convert to string before using assertIn
Convert actual output to a string before checking it so that we
avoid a mismatch error.

Change-Id: Id106583c113a9d8c7d0aa6bc6e6468ad75e77b0d
Closes-bug: #1775071
2018-06-04 16:34:29 -04:00
Brian Rosmaita
f6a24beb7c Add periodic tips jobs
Add jobs to the periodic queue that run the glance unit and
functional tests against the master of various libraries we
consume so that we don't have to wait for a release to detect
a change that could be problematic.

The dependency is needed for the *glance_store-tips jobs to
be processed properly.

Change-Id: I0385646991140debc06ea27a194a6e7f6f749e6b
Depends-On: https://review.openstack.org/#/c/571005/
2018-05-30 18:32:39 -04:00
Brian Rosmaita
7f47da7a50 Add py35 statement
Add a statement about the current state of Glance Python 3.5
support to the install docs.

Change-Id: I2cb2e05f81c22c00aad55d3b8a1d3463ced6cf28
Partial-bug: #1769006
2018-05-30 12:55:17 -04:00
Zuul
8ec217693e Merge "update "auth_url" in document" 2018-05-30 15:26:19 +00:00
Abhishek Kekane
ffc3923e93 Fix unreachable 'ImageSizeLimitExceeded' exception in image-upload
ImageSizeLimitExceeded exception block [1] is unreachable in upload because
it is caught at [2] and raised StorageQuotaFull exception from there. The
problem here is that we have nested usage of the limiting reader.

To make it correct changed the limiting reader to accept
exception class as parameter so that we can pass the StorageQuotaFull
in case LimitingReader is used for quota check and ImageSizeExceeded exception
if it is used for image size cap check.

[1] fd16fa4f25/glance/api/v2/image_data.py (L230)
[2] fd16fa4f25/glance/quota/__init__.py (L305)

Closes-Bug: #1734832
Change-Id: I5a419b763bee7f983c2a94c6f3a2245281e86743
2018-05-30 04:53:30 +00:00
inspurericzhang
1370b15f01 Update pypi url to new url
Pypi url changed from [1] to [2]

[1] https://pypi.python.org/pypi/<package>
[2] https://pypi.org/project/<package>

Change-Id: I22b323065448425acad5c7052e2ccb7da419af28
2018-05-21 09:57:58 +08:00
jiangpch
7edf7ff66d Refactor exception handling in cmd.api
Replace the known exception tuple with a map of exception classes
to error codes to preserve backward compatibility of exit codes.
Also change the code to handle unknown members of the Exception
hierarchy without breaking.

Co-authored-by: jiangpch <jiangpengcheng@navercorp.com>
Co-authored-by: Brian Rosmaita <rosmaita.fossdev@gmail.com>

Closes-Bug: #1726213

Change-Id: Iabfc2ded45a576a18bdb30a6c3ada8b9799a3196
2018-05-20 11:56:53 -04:00
Zuul
fd16fa4f25 Merge "Update some url links of rally/README.rst" 2018-05-14 18:07:17 +00:00