]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
CDB base folder is now created recursively if needed
authoracolla <acolla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 31 Oct 2007 15:54:47 +0000 (15:54 +0000)
committeracolla <acolla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 31 Oct 2007 15:54:47 +0000 (15:54 +0000)
STEER/AliCDBGrid.cxx

index ce7c7ef750ab6b13a7307c3dc0c5fee09d64b9ea..647fa52d61f3a10d3af95e131219dfeb0d2c24e3 100644 (file)
@@ -80,8 +80,11 @@ fCleanupInterval(cleanupInterval)
        // check DBFolder: trying to cd to DBFolder; if it does not exist, create it
        if(!gGrid->Cd(fDBFolder.Data(),0)){
                AliDebug(2,Form("Creating new folder <%s> ...",fDBFolder.Data()));
        // check DBFolder: trying to cd to DBFolder; if it does not exist, create it
        if(!gGrid->Cd(fDBFolder.Data(),0)){
                AliDebug(2,Form("Creating new folder <%s> ...",fDBFolder.Data()));
-               if(!gGrid->Mkdir(fDBFolder.Data(),"",0)){
-                       AliError(Form("Cannot create folder <%s> !",fDBFolder.Data()));
+               TGridResult* res = gGrid->Command(Form("mkdir -p %s",fDBFolder.Data()));
+               TString result = res->GetKey(0,"__result__");
+               if(result == "0"){
+                       AliFatal(Form("Cannot create folder <%s> !",fDBFolder.Data()));
+                       return;
                }
        } else {
                AliDebug(2,Form("Folder <%s> found",fDBFolder.Data()));
                }
        } else {
                AliDebug(2,Form("Folder <%s> found",fDBFolder.Data()));
@@ -1038,17 +1041,17 @@ AliCDBParam* AliCDBGridFactory::CreateParameter(const char* gridString) {
                else if (key.Contains("user",TString::kIgnoreCase)){
                        user = value;
                }
                else if (key.Contains("user",TString::kIgnoreCase)){
                        user = value;
                }
-               else if (key.Contains("folder",TString::kIgnoreCase)){
-                       dbFolder = value;
-               }
                else if (key.Contains("se",TString::kIgnoreCase)){
                        se = value;
                }
                else if (key.Contains("se",TString::kIgnoreCase)){
                        se = value;
                }
-               else if (key.Contains("cacheFold",TString::kIgnoreCase)){
+               else if (key.Contains("cacheF",TString::kIgnoreCase)){
                        cacheFolder = value;
                        if (!cacheFolder.EndsWith("/"))
                                cacheFolder += "/";
                }
                        cacheFolder = value;
                        if (!cacheFolder.EndsWith("/"))
                                cacheFolder += "/";
                }
+               else if (key.Contains("folder",TString::kIgnoreCase)){
+                       dbFolder = value;
+               }
                else if (key.Contains("operateDisc",TString::kIgnoreCase)){
                        if(value == "kTRUE") {
                                operateDisconnected = kTRUE;
                else if (key.Contains("operateDisc",TString::kIgnoreCase)){
                        if(value == "kTRUE") {
                                operateDisconnected = kTRUE;
@@ -1061,7 +1064,7 @@ AliCDBParam* AliCDBGridFactory::CreateParameter(const char* gridString) {
                                return NULL;
                        }
                }
                                return NULL;
                        }
                }
-               else if (key.Contains("cacheSiz",TString::kIgnoreCase)){
+               else if (key.Contains("cacheS",TString::kIgnoreCase)){
                        if(value.IsDigit()) {
                                cacheSize = value.Atoi();
                        } else {
                        if(value.IsDigit()) {
                                cacheSize = value.Atoi();
                        } else {