Github user pdube commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1332#discussion_r49606475
  
    --- Diff: 
plugins/storage/image/swift/src/org/apache/cloudstack/storage/datastore/driver/SwiftImageStoreDriverImpl.java
 ---
    @@ -67,7 +73,28 @@ public DataStoreTO getStoreTO(DataStore store) {
     
         @Override
         public String createEntityExtractUrl(DataStore store, String 
installPath, ImageFormat format, DataObject dataObject) {
    -        throw new UnsupportedServiceException("Extract entity url is not 
yet supported for Swift image store provider");
    +
    +        SwiftTO swiftTO = (SwiftTO)store.getTO();
    +        String tempKey = UUID.randomUUID().toString();
    +        boolean result = SwiftUtil.setTempKey(swiftTO, tempKey);
    +
    +        if (!result) {
    +            s_logger.error("Unable to set Temp-Key: " + tempKey);
    +            return "";
    +        }
    +
    +        String containerName = 
SwiftUtil.getContainerName(dataObject.getType().toString(), dataObject.getId());
    +        String objectName = installPath.split("\\/")[1];
    +        // Get extract url expiration interval set in global configuration 
(in seconds)
    +        int urlExpirationInterval = 
Integer.parseInt(_configDao.getValue(Config.ExtractURLExpirationInterval.toString()));
    +
    +        URL swiftUrl = SwiftUtil.generateTempUrl(swiftTO, containerName, 
objectName, tempKey, urlExpirationInterval);
    +        if (swiftUrl != null) {
    +            s_logger.info("Swift temp-url: " + swiftUrl.toString());
    --- End diff --
    
    Should probably be DEBUG instead of INFO, or remove this the log statement


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to