@@ -101,6 +101,7 @@ public class SystemVmTemplateRegistration {
101101 private static final String TEMPLATES_PATH = fetchTemplatesPath ();
102102 private static final String METADATA_FILE_NAME = "metadata.ini" ;
103103 private static final String METADATA_FILE = TEMPLATES_PATH + METADATA_FILE_NAME ;
104+ public static final String TEMP_DIRECTORY = "/var/tmp" ;
104105 public static final String TEMPORARY_SECONDARY_STORE = "tmp" ;
105106 private static final String PARTIAL_TEMPLATE_FOLDER = String .format ("/template/tmpl/%d/" , Account .ACCOUNT_ID_SYSTEM );
106107 private static final String storageScriptsDir = "scripts/storage/secondary" ;
@@ -360,7 +361,7 @@ public void setUpdated(Date updated) {
360361 public boolean validateIfSeeded (TemplateDataStoreVO templDataStoreVO , String url , String path , String nfsVersion ) {
361362 String filePath = null ;
362363 try {
363- filePath = Files .createTempDirectory (TEMPORARY_SECONDARY_STORE ).toString ();
364+ filePath = Files .createTempDirectory (Paths . get ( TEMP_DIRECTORY ), TEMPORARY_SECONDARY_STORE ).toString ();
364365 if (filePath == null ) {
365366 throw new CloudRuntimeException ("Failed to create temporary directory to mount secondary store" );
366367 }
@@ -962,7 +963,7 @@ public void doInTransactionWithoutResult(final TransactionStatus status) {
962963 for (Long zoneId : zoneIds ) {
963964 String filePath = null ;
964965 try {
965- filePath = Files .createTempDirectory (TEMPORARY_SECONDARY_STORE ).toString ();
966+ filePath = Files .createTempDirectory (Paths . get ( TEMP_DIRECTORY ), TEMPORARY_SECONDARY_STORE ).toString ();
966967 if (filePath == null ) {
967968 throw new CloudRuntimeException ("Failed to create temporary file path to mount the store" );
968969 }
0 commit comments