Merge "Fix cinder-backup logic"

This commit is contained in:
Zuul 2022-09-07 15:08:03 +00:00 committed by Gerrit Code Review
commit 9aec82a788

View File

@ -94,13 +94,16 @@ class VolumeService(VersionedService):
return return
if is_backup: if is_backup:
service = is_backup['services'] services = is_backup['services']
if not service or service[0]['state'] == 'down': backup_enabled = 'False'
conf.set('volume-feature-enabled', 'backup', 'False') for service in services:
else: if service['state'] == 'up':
# post_configuration method is called with every volume (v2, backup_enabled = 'True'
# v3) service, therefore set the value with priority so that it break
# can't be overrided by this method called from other instance
# of volume service # post_configuration method is called with every volume (v2,
conf.set('volume-feature-enabled', 'backup', 'True', # v3) service, therefore set the value with priority so that it
priority=True) # can't be overrided by this method called from other instance
# of volume service
conf.set('volume-feature-enabled', 'backup', backup_enabled,
priority=True)