Browse Source

Deprecate scenario.img_dir option

Starting Tempest 25.0.0 release, CONF.scenario.img_file needs
a full path for the image. CONF.scenario.img_dir was deprecated
and is removed in 27.0.0 release [2].

This patch does analogically the same change as was done in Tempest,
in order to give users of the plugin some time for removing img_dir.

[1] https://review.opendev.org/#/c/710996
[2] https://review.opendev.org/c/openstack/tempest/+/754927

Related-Bug: #1393881
Change-Id: I81313bd2b87f1c0603221ac3e04050f85215c846
changes/71/740671/3
Martin Kopec 10 months ago
parent
commit
b2e548518a
1 changed files with 17 additions and 1 deletions
  1. +17
    -1
      novajoin_tempest_plugin/tests/scenario/manager.py

+ 17
- 1
novajoin_tempest_plugin/tests/scenario/manager.py View File

@ -14,6 +14,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import os
from oslo_log import log
from tempest.common import image as common_image
@ -197,7 +198,22 @@ class ScenarioTest(tempest.test.BaseTestCase):
image = body['image'] if 'image' in body else body
# self.addCleanup(self.image_client.delete_image, image['id'])
self.assertEqual("queued", image['status'])
img_path = CONF.scenario.img_dir + "/" + CONF.scenario.img_file
img_path = CONF.scenario.img_file
if not os.path.exists(img_path):
# TODO(kopecmartin): replace LOG.warning for raising
# InvalidConfiguration exception when this plugin is meant to be
# used with only Tempest 27.0.0 and higher
LOG.warning(
'Starting Tempest 25.0.0 release, CONF.scenario.img_file need '
'a full path for the image. CONF.scenario.img_dir was '
'deprecated and is removed in 27.0.0 release. Till Tempest '
'27.0.0 (excluding), old behavior is maintained and kept '
'working but starting Tempest 27.0.0, only full path '
'CONF.scenario.img_file config option is accepted by the '
'Tempest.')
img_path = os.path.join(CONF.scenario.img_dir, img_path)
with open(img_path, 'rb') as image_file:
if CONF.image_feature_enabled.api_v1:
self.image_client.update_image(image['id'], data=image_file)


Loading…
Cancel
Save