示例#1
0
 def ctl_remove_location(self, image_name, location,
                         start_index=0, end_index=-1):
     metadata = None
     if image_name in self._metadata_dict:
         # the image is in use on this node.
         metadata = self._metadata_dict[image_name]
     else:
         # XXX need to check if no one is using this image.
         metadata_raw = self._get_metadata(image_name)
         if metadata_raw is None:
             return errno.ENOENT
         metadata = UKAIMetadata(image_name, self._config, metadata_raw)
     metadata.remove_location(location, start_index, end_index)
     ukai_data_location_destroy(image_name, location, self._config)
     return 0