@@ -307,27 +307,8 @@ def _set_attribute(self, location, model_name, model_value, uses_path_tokens_nam
307
307
"""
308
308
_method_name = '_set_attribute'
309
309
310
- if model_name in uses_path_tokens_names and WLSDeployArchive .isPathIntoArchive (model_value ):
311
- if self .archive_helper is not None :
312
- if self .archive_helper .contains_file (model_value ):
313
- #
314
- # We cannot extract the files until the domain directory exists
315
- # so add them to the list so that they can be extracted after
316
- # domain creation completes.
317
- #
318
- self .files_to_extract_from_archive .append (model_value )
319
- else :
320
- path = self .alias_helper .get_model_folder_path (location )
321
- archive_file_name = self .model_context .get_archive_file_name
322
- ex = exception_helper .create_create_exception ('WLSDPLY-12121' , model_name , path ,
323
- model_value , archive_file_name )
324
- self .logger .throwing (ex , class_name = self .__class_name , method_name = _method_name )
325
- raise ex
326
- else :
327
- path = self .alias_helper .get_model_folder_path (location )
328
- ex = exception_helper .create_create_exception ('WLSDPLY-12122' , model_name , path , model_value )
329
- self .logger .throwing (ex , class_name = self .__class_name , method_name = _method_name )
330
- raise ex
310
+ if (model_name in uses_path_tokens_names ) and (model_value is not None ):
311
+ self ._extract_archive_files (location , model_name , model_value )
331
312
332
313
wlst_name , wlst_value = self .alias_helper .get_wlst_attribute_name_and_value (location , model_name , model_value )
333
314
@@ -350,6 +331,49 @@ def _set_attribute(self, location, model_name, model_value, uses_path_tokens_nam
350
331
self .wlst_helper .set (wlst_name , wlst_value , masked = masked )
351
332
return
352
333
334
+ def _extract_archive_files (self , location , model_name , model_value ):
335
+ """
336
+ Extract any archive files associated with the specified model attribute value.
337
+ The attribute has already been determined to use path tokens.
338
+ :param location: the location of the attribute
339
+ :param model_name: the model attribute name
340
+ :param model_value: the model attribute value
341
+ :raises: CreateException: if an error occurs
342
+ """
343
+ _method_name = '_extract_archive_files'
344
+
345
+ # model value should be a list, comma-delimited string, or string
346
+ model_paths = model_value
347
+ if isinstance (model_value , str ):
348
+ model_paths = model_value .split (',' )
349
+
350
+ for model_path in model_paths :
351
+ model_path = model_path .strip ()
352
+
353
+ # check for path starting with "wlsdeploy/".
354
+ # skip classpath libraries, they are extracted elsewhere.
355
+ if WLSDeployArchive .isPathIntoArchive (model_path ) and not WLSDeployArchive .isClasspathEntry (model_path ):
356
+ if self .archive_helper is not None :
357
+ if self .archive_helper .contains_file (model_path ):
358
+ #
359
+ # We cannot extract the files until the domain directory exists
360
+ # so add them to the list so that they can be extracted after
361
+ # domain creation completes.
362
+ #
363
+ self .files_to_extract_from_archive .append (model_path )
364
+ else :
365
+ path = self .alias_helper .get_model_folder_path (location )
366
+ archive_file_name = self .model_context .get_archive_file_name
367
+ ex = exception_helper .create_create_exception ('WLSDPLY-12121' , model_name , path ,
368
+ model_path , archive_file_name )
369
+ self .logger .throwing (ex , class_name = self .__class_name , method_name = _method_name )
370
+ raise ex
371
+ else :
372
+ path = self .alias_helper .get_model_folder_path (location )
373
+ ex = exception_helper .create_create_exception ('WLSDPLY-12122' , model_name , path , model_path )
374
+ self .logger .throwing (ex , class_name = self .__class_name , method_name = _method_name )
375
+ raise ex
376
+
353
377
def _is_type_valid (self , location , type_name ):
354
378
"""
355
379
Verify that the specified location in valid for the current WLS version.
0 commit comments