2017-11-30 10:45:28.813 8323 DEBUG karbor.services.protection.bank_plugins.file_system_bank_plugin [-] FsBank: list_objects. key: /checkpoints/4ef27d47-e42c-42c4-bd74-1a33dc5b9741/resource-data/7ea065ce-ee99-45a1-9b08-0e7fa67546ce/ list_objects /usr/lib/python2.7/site-packages/karbor/services/protection/bank_plugins/file_system_bank_plugin.py:183
2017-11-30 10:46:11.079 8323 DEBUG karbor.services.protection.bank_plugins.file_system_bank_plugin [-] FsBank: list_objects. key: /checkpoints/4ef27d47-e42c-42c4-bd74-1a33dc5b9741/resource-data/7ea065ce-ee99-45a1-9b08-0e7fa67546ce/ list_objects /usr/lib/python2.7/site-packages/karbor/services/protection/bank_plugins/file_system_bank_plugin.py:183
2017-11-30 10:47:34.757 8323 DEBUG karbor.services.protection.bank_plugins.file_system_bank_plugin [-] FsBank: get_object. key: /checkpoints/4ef27d47-e42c-42c4-bd74-1a33dc5b9741/resource-data/7ea065ce-ee99-45a1-9b08-0e7fa67546ce/metadata get_object /usr/lib/python2.7/site-packages/karbor/services/protection/bank_plugins/file_system_bank_plugin.py:166
2017-11-30 10:48:20.184 8323 DEBUG karbor.services.protection.bank_plugins.file_system_bank_plugin [-] FsBank: list_objects. key: /checkpoints/4ef27d47-e42c-42c4-bd74-1a33dc5b9741/resource-data/7ea065ce-ee99-45a1-9b08-0e7fa67546ce/ list_objects /usr/lib/python2.7/site-packages/karbor/services/protection/bank_plugins/file_system_bank_plugin.py:183
2017-11-30 10:49:35.168 8323 DEBUG karbor.services.protection.protection_plugins.image.image_protection_plugin [-] object num: 0, chunk num: 21 on_main /usr/lib/python2.7/site-packages/karbor/services/protection/protection_plugins/image/image_protection_plugin.py:207
2017-11-30 10:49:35.170 8323 ERROR karbor.services.protection.protection_plugins.image.image_protection_plugin [-] Restore image backup failed, image_id: 7ea065ce-ee99-45a1-9b08-0e7fa67546ce.: RestoreResourceFailed: Restore Image Backup failed: The chunks_num of restored image is invalid., id=7ea065ce-ee99-45a1-9b08-0e7fa67546ce, type=OS::Glance::Image
def _list_object(self, path):
obj_file_path = self.object_container_path + path
if not os.path.isdir(obj_file_path):
LOG.debug(_("Path is not a directory. name: %s"), obj_file_path)
return ()
try:
if os.path.isdir(obj_file_path):
return os.listdir(obj_file_path)//the problem is here
else:
base_dir = os.path.dirname(obj_file_path)
base_name = os.path.basename(obj_file_path)
return (
base_dir + '/' + obj_file
for obj_file in os.listdir(base_dir)
if obj_file.startswith(base_name)
)
except OSError:
LOG.exception(_("List the object failed. path: %s"), obj_file_path)
raise
Modified as follows, restore can be successful.
def _list_object(self, path):
obj_file_ path = self.object_ container_ path + path isdir(obj_ file_path) :
LOG. debug(_ ("Path is not a directory. name: %s"), obj_file_path) isdir(obj_ file_path) :
LOG.info( _("Path is a directory. name: %s"), obj_file_path)
return os.listdir( obj_file_ path)
base_ dir = os.path. dirname( obj_file_ path)
base_ name = os.path. basename( obj_file_ path)
return (
path + obj_file
for obj_file in os.listdir( base_dir)
if obj_file. startswith( base_name)
#return os.listdir( obj_file_ path)
base_ dir = os.path. dirname( obj_file_ path)
base_ name = os.path. basename( obj_file_ path)
return (
base_ dir + '/' + obj_file
for obj_file in os.listdir( base_dir)
if obj_file. startswith( base_name)
LOG. exception( _("List the object failed. path: %s"), obj_file_path)
if not os.path.
return ()
try:
if os.path.
if 'indices' in obj_file_path:
)
else:
)
except OSError:
raise