cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jburw...@apache.org
Subject [2/2] git commit: updated refs/heads/master to e2bcbe9
Date Thu, 01 Aug 2013 04:15:12 GMT
- CLOUDSTACK-3229: Fixes a think-o in the handling of unmodifiable
  collections and adds a rail in s3xen to raise an exception if the file being
put does not exist


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/e2bcbe90
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e2bcbe90
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e2bcbe90

Branch: refs/heads/master
Commit: e2bcbe90c0befcaf784182d8406b25f2feb7b32b
Parents: 1ae682d
Author: John Burwell <jburwell@apache.org>
Authored: Thu Aug 1 00:11:40 2013 -0400
Committer: John Burwell <jburwell@apache.org>
Committed: Thu Aug 1 00:14:57 2013 -0400

----------------------------------------------------------------------
 .../com/cloud/hypervisor/xen/resource/CitrixResourceBase.java  | 5 +++--
 .../hypervisor/xen/resource/XenServerStorageProcessor.java     | 5 +++--
 scripts/vm/hypervisor/xenserver/s3xen                          | 6 +++++-
 3 files changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e2bcbe90/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
index e8a2512..f0a6964 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
@@ -290,6 +290,7 @@ import java.util.Set;
 import java.util.UUID;
 
 import static com.cloud.utils.ReflectUtil.flattenProperties;
+import static com.google.common.collect.Lists.newArrayList;
 
 /**
  * CitrixResourceBase encapsulates the calls to the XenServer Xapi process
@@ -7404,8 +7405,8 @@ public abstract class CitrixResourceBase implements ServerResource,
HypervisorRe
 
         try {
 
-            final List<String> parameters = flattenProperties(s3,
-                    S3Utils.ClientOptions.class);
+            final List<String> parameters = newArrayList(flattenProperties(s3,
+                    S3Utils.ClientOptions.class));
             parameters.addAll(Arrays.asList("operation", "put", "directory",
                     dir, "filename", filename, "iSCSIFlag",
                     iSCSIFlag.toString(), "bucket", s3.getBucketName(), "key", key));

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e2bcbe90/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerStorageProcessor.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerStorageProcessor.java
b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerStorageProcessor.java
index 68a07c0..9cd0b33 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerStorageProcessor.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerStorageProcessor.java
@@ -81,6 +81,7 @@ import java.util.Set;
 import java.util.UUID;
 
 import static com.cloud.utils.ReflectUtil.flattenProperties;
+import static com.google.common.collect.Lists.newArrayList;
 
 public class XenServerStorageProcessor implements StorageProcessor {
     private static final Logger s_logger = Logger.getLogger(XenServerStorageProcessor.class);
@@ -1073,8 +1074,8 @@ public class XenServerStorageProcessor implements StorageProcessor {
 
         try {
 
-            final List<String> parameters = flattenProperties(s3,
-                    S3Utils.ClientOptions.class);
+            final List<String> parameters = newArrayList(flattenProperties(s3,
+                    S3Utils.ClientOptions.class));
             parameters.addAll(Arrays.asList("operation", "put", "directory",
                     dir, "filename", filename, "iSCSIFlag",
                     iSCSIFlag.toString(), "bucket", s3.getBucketName(), "key", key));

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e2bcbe90/scripts/vm/hypervisor/xenserver/s3xen
----------------------------------------------------------------------
diff --git a/scripts/vm/hypervisor/xenserver/s3xen b/scripts/vm/hypervisor/xenserver/s3xen
index 4ee7c11..8c1d3d8 100644
--- a/scripts/vm/hypervisor/xenserver/s3xen
+++ b/scripts/vm/hypervisor/xenserver/s3xen
@@ -179,7 +179,7 @@ class S3Client(object):
             max_error_retry, self.DEFAULT_MAX_ERROR_RETRY)
 
     def build_canocialized_resource(self, bucket, key):
-        return "/" + join([bucket, key], '/')
+        return "/" + join([bucket, key], "/")
 
     def noop_send_body(connection):
         pass
@@ -256,6 +256,10 @@ class S3Client(object):
 
     def put(self, bucket, key, src_filename):
 
+        if not os.path.isfile(src_filename):
+            raise Exception(
+                "Attempt to put " + src_filename + " that does not exist.")
+
         headers = {
             self.HEADER_CONTENT_MD5: compute_md5(src_filename),
             self.HEADER_CONTENT_TYPE: 'application/octet-stream',


Mime
View raw message