diff options
-rw-r--r-- | .gitreview | 2 | ||||
-rw-r--r-- | .zuul.yaml | 36 | ||||
-rw-r--r-- | glance_store/_drivers/swift/store.py | 9 | ||||
-rw-r--r-- | glance_store/tests/unit/test_swift_store.py | 3 | ||||
-rw-r--r-- | glance_store/tests/unit/test_swift_store_multibackend.py | 3 | ||||
-rw-r--r-- | lower-constraints.txt | 1 | ||||
-rw-r--r-- | test-requirements.txt | 1 | ||||
-rw-r--r-- | tox.ini | 15 |
8 files changed, 28 insertions, 42 deletions
@@ -1,4 +1,4 @@ [gerrit] -host=review.openstack.org +host=review.opendev.org port=29418 project=openstack/glance_store.git @@ -22,7 +22,7 @@ ceilometer-api: false ceilometer-collector: false # Hardcode glance_store path so the job can be run on glance patches - zuul_work_dir: src/git.openstack.org/openstack/glance_store + zuul_work_dir: src/opendev.org/openstack/glance_store - job: name: glance_store-dsvm-functional-filesystem @@ -63,12 +63,12 @@ tox_envlist: py27 - job: - name: glance_store-tox-py35-cinder-tips + name: glance_store-tox-py36-cinder-tips parent: glance_store-tox-cinder-tips-base description: | - glance_store py35 unit tests vs. cinder masters + glance_store py36 unit tests vs. cinder masters vars: - tox_envlist: py35 + tox_envlist: py36 - job: name: glance_store-tox-keystone-tips-base @@ -88,12 +88,12 @@ tox_envlist: py27 - job: - name: glance_store-tox-py35-keystone-tips + name: glance_store-tox-py36-keystone-tips parent: glance_store-tox-keystone-tips-base description: | - glance_store py35 unit tests vs. keystone masters + glance_store py36 unit tests vs. keystone masters vars: - tox_envlist: py35 + tox_envlist: py36 - job: name: glance_store-tox-oslo-tips-base @@ -120,12 +120,12 @@ tox_envlist: py27 - job: - name: glance_store-tox-py35-oslo-tips + name: glance_store-tox-py36-oslo-tips parent: glance_store-tox-oslo-tips-base description: | - glance_store py35 unit tests vs. oslo masters + glance_store py36 unit tests vs. oslo masters vars: - tox_envlist: py35 + tox_envlist: py36 - job: name: glance_store-tox-swift-tips-base @@ -144,12 +144,12 @@ tox_envlist: py27 - job: - name: glance_store-tox-py35-swift-tips + name: glance_store-tox-py36-swift-tips parent: glance_store-tox-swift-tips-base description: | - glance_store py35 unit tests vs. swift masters + glance_store py36 unit tests vs. swift masters vars: - tox_envlist: py35 + tox_envlist: py36 - project: templates: @@ -190,22 +190,22 @@ # The "tips" jobs can be removed from the stable branch .zuul.yaml # files if someone is so inclined, but that would require manual # maintenance, so we do not do it by default. Another option is - # to define these jobs in the openstack-infra/project-config repo. + # to define these jobs in the openstack/project-config repo. # That would make us less agile in adjusting these tests, so we # aren't doing that either. - glance_store-tox-py27-cinder-tips: branches: master - - glance_store-tox-py35-cinder-tips: + - glance_store-tox-py36-cinder-tips: branches: master - glance_store-tox-py27-keystone-tips: branches: master - - glance_store-tox-py35-keystone-tips: + - glance_store-tox-py36-keystone-tips: branches: master - glance_store-tox-py27-oslo-tips: branches: master - - glance_store-tox-py35-oslo-tips: + - glance_store-tox-py36-oslo-tips: branches: master - glance_store-tox-py27-swift-tips: branches: master - - glance_store-tox-py35-swift-tips: + - glance_store-tox-py36-swift-tips: branches: master diff --git a/glance_store/_drivers/swift/store.py b/glance_store/_drivers/swift/store.py index 5de7e6c..706d352 100644 --- a/glance_store/_drivers/swift/store.py +++ b/glance_store/_drivers/swift/store.py @@ -1030,11 +1030,12 @@ class BaseStore(driver.Store): if image_size == 0: image_size = combined_chunks_size - # Now we write the object manifest and return the - # manifest's etag... + # Now we write the object manifest in X-Object-Manifest + # header as defined for Dynamic Large Objects (DLO) Mode. + # This request does not include ETag as PUT request has not + # actual content that we need to verify. manifest = "%s/%s-" % (location.container, location.obj) - headers = {'ETag': hashlib.md5(b"").hexdigest(), - 'X-Object-Manifest': manifest} + headers = {'X-Object-Manifest': manifest} # The ETag returned for the manifest is actually the # MD5 hash of the concatenated checksums of the strings diff --git a/glance_store/tests/unit/test_swift_store.py b/glance_store/tests/unit/test_swift_store.py index 287097c..400fff6 100644 --- a/glance_store/tests/unit/test_swift_store.py +++ b/glance_store/tests/unit/test_swift_store.py @@ -118,8 +118,9 @@ class SwiftTests(object): fixture_key = "%s/%s" % (container, name) if fixture_key not in fixture_headers: if kwargs.get('headers'): - etag = kwargs['headers']['ETag'] manifest = kwargs.get('headers').get('X-Object-Manifest') + etag = kwargs.get('headers') \ + .get('ETag', hashlib.md5(b'').hexdigest()) fixture_headers[fixture_key] = { 'manifest': True, 'etag': etag, diff --git a/glance_store/tests/unit/test_swift_store_multibackend.py b/glance_store/tests/unit/test_swift_store_multibackend.py index fa26301..07c44d9 100644 --- a/glance_store/tests/unit/test_swift_store_multibackend.py +++ b/glance_store/tests/unit/test_swift_store_multibackend.py @@ -109,8 +109,9 @@ class SwiftTests(object): fixture_key = "%s/%s" % (container, name) if fixture_key not in fixture_headers: if kwargs.get('headers'): - etag = kwargs['headers']['ETag'] manifest = kwargs.get('headers').get('X-Object-Manifest') + etag = kwargs.get('headers') \ + .get('ETag', hashlib.md5(b'').hexdigest()) fixture_headers[fixture_key] = { 'manifest': True, 'etag': etag, diff --git a/lower-constraints.txt b/lower-constraints.txt index 6d7c5a1..5879fc5 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -1,7 +1,6 @@ alabaster==0.7.10 appdirs==1.4.3 Babel==2.5.3 -bandit==1.1.0 certifi==2018.1.18 chardet==3.0.4 cliff==2.11.0 diff --git a/test-requirements.txt b/test-requirements.txt index 2ddcc91..c3b3255 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -20,7 +20,6 @@ testscenarios>=0.4 # Apache-2.0/BSD testtools>=2.2.0 # MIT oslotest>=3.2.0 # Apache-2.0 os-testr>=1.0.0 # Apache-2.0 -bandit>=1.1.0 # Apache-2.0 # Dependencies for each of the optional stores oslo.vmware>=2.17.0 # Apache-2.0 @@ -28,23 +28,8 @@ basepython = python3 commands = flake8 {posargs} # Run security linter - # The following bandit tests are being skipped: - # B101 - Use of assert detected. - # B110 - Try, Except, Pass detected. - # B303 - Use of insecure MD2, MD4, or MD5 hash function. - bandit -r glance_store -x tests --skip B101,B110,B303 doc8 {posargs} -[testenv:bandit] -basepython = python3 -# NOTE(browne): This is required for the integration test job of the bandit -# project. Please do not remove. -# The following bandit tests are being skipped: -# B101 - Use of assert detected. -# B110 - Try, Except, Pass detected. -# B303 - Use of insecure MD2, MD4, or MD5 hash function. -commands = bandit -r glance_store -x tests --skip B101,B110,B303 - [testenv:cover] basepython = python3 setenv = |