try {
Map<String, Object> tagMap = Maps.newHashMap();
for (Tag tag : tags.getTags()) {
tagMap.put(tag.getKey(), tag.getValue());
}
glanceClient.root().images().image(imageId).updateMetadata(tagMap, replace);
} catch (OpenstackException e) {
throw new OpsException("Error updating image tags", e);
}
}