While adding secondary storage / is not added to secondary storage cifs url.
This causes it to fail if that path doesn't begin with '/'. It works fine
while adding primary storage. Added a check to add '/' in begining if needed.


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

Branch: refs/heads/master
Commit: cfe5a6fcbf909a60947d491fb19b3fb9c5408116
Parents: cffae8e
Author: Devdeep Singh <[email protected]>
Authored: Fri Nov 14 11:12:19 2014 +0530
Committer: Devdeep Singh <[email protected]>
Committed: Fri Nov 14 11:20:25 2014 +0530

----------------------------------------------------------------------
 ui/scripts/sharedFunctions.js | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cfe5a6fc/ui/scripts/sharedFunctions.js
----------------------------------------------------------------------
diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js
index 95500a1..b148ded 100644
--- a/ui/scripts/sharedFunctions.js
+++ b/ui/scripts/sharedFunctions.js
@@ -1359,6 +1359,11 @@ var processPropertiesInImagestoreObject = 
function(jsonObj) {
 
     function nfsURL(server, path) {
         var url;
+
+        if (path.substring(0, 1) != "/") {
+            path = "/" + path;
+        }
+
         if (server.indexOf("://") == -1)
             url = "nfs://" + server + path;
         else
@@ -1368,6 +1373,11 @@ var processPropertiesInImagestoreObject = 
function(jsonObj) {
 
     function smbURL(server, path, smbUsername, smbPassword, smbDomain) {
         var url = '';
+
+        if (path.substring(0, 1) != "/") {
+            path = "/" + path;
+        }
+
         if (server.indexOf('://') == -1) {
                url += 'cifs://';
         }

Reply via email to