Fix indents for pep8

This commit is contained in:
lolwww
2019-06-28 00:02:52 +03:00
parent 514d113365
commit 6678a4e5bc
3 changed files with 14 additions and 5 deletions

View File

@@ -17,6 +17,7 @@
import zaza.model as zaza_model
import zaza.openstack.charm_tests.test_utils
def configure_cinder_backup():
"""Configure cinder-backup-swift."""
keystone_ip = zaza_model.get_app_ips(
@@ -40,6 +41,7 @@ def configure_cinder_backup():
zaza_model.wait_for_application_states()
_singleton = zaza.openstack.charm_tests.test_utils.OpenStackBaseTest()
_singleton.setUpClass()
with _singleton.config_change(cinder_backup_swift_conf, cinder_backup_swift_conf):
with _singleton.config_change(cinder_backup_swift_conf,
cinder_backup_swift_conf):
# wait for configuration to be applied then return
pass

View File

@@ -45,13 +45,14 @@ class CinderBackupSwiftTest(test_utils.OpenStackBaseTest):
volume_backup = openstack_utils.create_volume_backup(
self.cinder_client,
volume.id)
# Check if backup was created via Swift
record = openstack_utils.get_volume_backup_metadata(
self.cinder_client,
volume_backup.id
)
#Check if backup was created via Swift
assert record['backup_service'] == 'cinder.backup.drivers.swift.SwiftBackupDriver'
swift_driver = 'cinder.backup.drivers.swift.SwiftBackupDriver'
assert record['backup_service'] == swift_driver
# Delete volume backup
logging.info('Deleting volume backup')

View File

@@ -1692,6 +1692,7 @@ def delete_image(glance, img_id):
def delete_volume(cinder, vol_id):
"""Delete the given volume from cinder.
:param cinder: Authenticated cinderclient
:type cinder: cinderclient.Client
:param vol_id: unique name or id for the openstack resource
@@ -1702,6 +1703,7 @@ def delete_volume(cinder, vol_id):
def delete_volume_backup(cinder, vol_backup_id):
"""Delete the given volume from cinder.
:param cinder: Authenticated cinderclient
:type cinder: cinderclient.Client
:param vol_backup_id: unique name or id for the openstack resource
@@ -1710,6 +1712,7 @@ def delete_volume_backup(cinder, vol_backup_id):
delete_resource(cinder.backups, vol_backup_id,
msg="deleting cinder volume backup")
def upload_image_to_glance(glance, local_path, image_name, disk_format='qcow2',
visibility='public', container_format='bare'):
"""Upload the given image to glance and apply the given label.
@@ -1791,6 +1794,7 @@ def create_image(glance, image_url, image_name, image_cache_dir=None, tags=[]):
def create_volume(cinder, size, name=None, image=None):
"""Create cinder volume.
:param cinder: Authenticated cinderclient
:type cinder: cinder.Client
:param size: Size of the volume
@@ -1819,6 +1823,7 @@ def create_volume(cinder, size, name=None, image=None):
def create_volume_backup(cinder, volume_id, name=None):
"""Create cinder volume backup.
:param cinder: Authenticated cinderclient
:type cinder: cinder.Client
:param volume_id: the source volume's id for backup
@@ -1843,7 +1848,8 @@ def create_volume_backup(cinder, volume_id, name=None):
def get_volume_backup_metadata(cinder, backup_id):
"""Get cinder volume backup record
"""Get cinder volume backup record.
:param cinder: Authenticated cinderclient
:type cinder: cinder.Client
:param backup_id: the source backup id