You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2018/01/19 13:06:38 UTC

[GitHub] rafaelweingartner commented on a change in pull request #2412: CLOUDSTACK-9677: Adding storage policy support for swift as secondary?

rafaelweingartner commented on a change in pull request #2412: CLOUDSTACK-9677: Adding storage policy support for swift as secondary?
URL: https://github.com/apache/cloudstack/pull/2412#discussion_r162615113
 
 

 ##########
 File path: plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServerStorageProcessor.java
 ##########
 @@ -914,20 +917,45 @@ public Answer copyVolumeFromPrimaryToSecondary(final CopyCommand cmd) {
 
     private boolean swiftUpload(final Connection conn, final SwiftTO swift, final String container, final String ldir, final String lfilename, final Boolean isISCSI,
             final int wait) {
-        String result = null;
+
+        List<String> params = getSwiftParams(swift, container, ldir, lfilename, isISCSI);
+
         try {
-            result =
-                    hypervisorResource.callHostPluginAsync(conn, "swiftxenserver", "swift", wait, "op", "upload", "url", swift.getUrl(), "account", swift.getAccount(), "username",
-                            swift.getUserName(), "key", swift.getKey(), "container", container, "ldir", ldir, "lfilename", lfilename, "isISCSI", isISCSI.toString());
-            if (result != null && result.equals("true")) {
-                return true;
-            }
+            String result = hypervisorResource.callHostPluginAsync(conn, "swiftxenserver", "swift", wait, params.toArray(new String[params.size()]));
+            return "true".equals(result);
 
 Review comment:
   what about using `org.apache.commons.lang3.BooleanUtils.toBoolean(String)` here?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services