We would like to fully remove mox from the test tree. Even for tests
that don't use mox's validation, many of them are using the symbol
patching with self.stubs.Set. We can do the same thing with the
monkeypatch fixture instead.
This introduces self.stub_out to nova/test.py and an example of what a
stubs => stub_out change would look like.
The teardown function in the converted test was removed at the same
time, as those should no longer be used.
Part of the mox community goal for Rocky.
Change-Id: I8f471ff8fee600ebb4e8907bf240007b7b4fe59f
Signed-off-by: Chuck Short <chucks@redhat.com>
The store values 'filesystem' and 'vmware_datastore' were
deprecated for 'store_type_preference' as per [1] in Newton.
This was to maintain uniformity with the values accepted for
'store' opt and 'store_type_preference' opt.
This patch removes acceptance for the old store values
and ensures uniformity between store names used in glance
and glance_store.
[1] I3d8593cdae6780ae721afedcf47dd45afa684f25
Change-Id: Id225275f7aad308bde450bef8bc6fd6ad7e3c6d2
Oslo.config make CONF.set_override with enforce_type=True by default
in Ifa552de0a994e40388cbc9f7dbaa55700ca276b0 and
I5b62427495179edb7672c6e5c508037f8b9d0b84, these changes break Glance's
tests[1], this commit fixes failures:
* Method config will raise ValueError in oslo.config 4.0 , so add it
in expected exception list,
* Oslo.config ensures option 'location_strategy' only allow two values,
so remove invalid test.
[1] http://logs.openstack.org/periodic/periodic-glance-py35-with-oslo-master/290de5d/testr_results.html.gz
Related-Bug: #1517839
Change-Id: I366042c7a739e74c270ae8cc7eca047a23ea2dd9
The store names used in glance and glance_store are not in sync with
each other.
This can confuse operators who have to use different names to refer to
the same store while setting values for configuration options such as
``store_type_preference`` in glance and configuration option like
``store`` in glance_store. This inconsistency may also confuse
developers during code changes, complicating future code changes with
respect to this.
Mapping store names: ``vmware_datastore`` and ``filesystem``
to ``vmware`` and ``file`` respectively to be in sync with glance_store
entry point names and at the same time accommodate backward
compatibility for old configuration files that might still be using
``filesystem`` and ``vmware_datastore``.
Note: This change applies only when multiple image locations are being
used and ``location_strategy`` configuration option is set to
``store_type``.
Note: This change does not require a config refresh change.
Impact:
UpgradeImpact
Credit:
This patch has a release note authored by Brian Rosmaita
Change-Id: I3d8593cdae6780ae721afedcf47dd45afa684f25
Closes-Bug: #1615852
As we are removing the s3 driver from source tree per change
I032b0fc16400cbd2112687d38e010128be699221 , it seems right to remove the
references of the same in the glance tree.
Updated here are files that referenced s3; these files include:
* documentation files
* documentation of the glance architecture (source and png files)
* config help text
* stores associated with location strategy
* tests
UpgradeImpact
Change-Id: I680ee2baf39b49156d173e2ae108ae5d0221eca7
Depends-On: I032b0fc16400cbd2112687d38e010128be699221
Depends-On: I5d2da0611365b838f41285b64cdcfef9adf50e85
Some tests used incorrect order assertEqual(observed, expected).
The correct order expected by testtools is
assertEqual(expected, observed).
At some places, corrected argument order for assertNotEqual method as well
and replaced assertEqual with assertTrue/assertFalse wherever required.
Closes-Bug: #1259292
Change-Id: I6fff8a3eedd053d0de8e261245a32f9a9fdab213
* Open file in text mode to write a paste configuration file, don't open
in binary mode
* Replace dict.keys()[0] with list(dict.keys())[0], dict.keys() now
returns an iterator on Python 3
* Replace xrange() with range()
* tox.ini: add the following glance.tests.unit.common tests to Python
3.4:
- test_config
- test_exception
- test_semver
Change-Id: Ibcfd106cad985b5e08f1e821b3b60a4d0d0911be
This fixes an issue where copy.deepcopy was being a called
on an ImmutableLocations object, causing a Forbidden to be
raised.
Change-Id: Ia7ac121478cf63d68bd5a3d91faa51a42afeb2fe
Closes-Bug: 1287888
Replace assertEqual(None, *) with assertIsNone in glance's
tests to have more clear messages in case of failure.
Also, replace assertTrue(* is not None) with assertIsNotNone
for the same reason.
Change-Id: If41a71bd750057c7136b03bef94c04517092134c
Closes-Bug: #1280522
An image can be saved to more than one backend storage by multi-location
mechanism, Glance should have a capability to select the best backend
storage for improving image consuming performance. This change
implements two strategy modules: "location_order" and "store_type", and
allow Admin configure some strategy-specified options for Glance as
their deployment required.
As an end user, he can get VM or consuming image faster base on this
enhancement. This is not only for 'download' transport handling on the
API server side but also for client since they can obtain locations by
standard 'direct URL' interface.
docImpact
Implements bp: image-location-selection-strategy
Change-Id: I86f192aeae8e5f21a72f946552f6507654c25a6c
Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>