Skip to content

Commit e1de17a

Browse files
committed
do not prepare inbuilt extension
Signed-off-by: Abhishek Kumar <[email protected]>
1 parent 21bbc63 commit e1de17a

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

plugins/hypervisors/external/src/main/java/org/apache/cloudstack/hypervisor/external/provisioner/simpleprovisioner/SimpleExternalProvisioner.java

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -439,14 +439,8 @@ public RunCustomActionAnswer runCustomAction(String hostGuid, String extensionNa
439439
return new RunCustomActionAnswer(cmd, result.first(), result.second());
440440
}
441441

442-
protected boolean createEntryPoint(String extensionName, boolean userDefined, String extensionRelativeEntryPoint,
443-
Path destinationPathObj) throws IOException {
444-
String baseEntryPointPath = BASE_EXTERNAL_PROVISIONER_SCRIPT;
445-
if (!userDefined) {
446-
String fileName = Paths.get(extensionRelativeEntryPoint).getFileName().toString();
447-
baseEntryPointPath = BASE_EXTERNAL_PROVISIONER_SCRIPTS_DIR + File.separator + fileName;
448-
}
449-
String sourceScriptPath = Script.findScript("", baseEntryPointPath);
442+
protected boolean createEntryPoint(String extensionName, Path destinationPathObj) throws IOException {
443+
String sourceScriptPath = Script.findScript("", BASE_EXTERNAL_PROVISIONER_SCRIPT);
450444
if(sourceScriptPath == null) {
451445
logger.error("Failed to find base script for preparing extension: {}",
452446
extensionName);
@@ -460,9 +454,12 @@ protected boolean createEntryPoint(String extensionName, boolean userDefined, St
460454
@Override
461455
public void prepareExtensionEntryPoint(String extensionName, boolean userDefined,
462456
String extensionRelativeEntryPoint) {
463-
logger.debug("Preparing entry point for extension: {}, user-defined: {}", extensionName, userDefined);
457+
logger.debug("Preparing entry point for Extension [name: {}, user-defined: {}]", extensionName, userDefined);
458+
if (!userDefined) {
459+
logger.debug("Skipping preparing entry point for inbuilt extension: {}", extensionName);
460+
}
464461
String destinationPath = getExtensionEntryPoint(extensionRelativeEntryPoint);
465-
if (userDefined && !destinationPath.endsWith(".sh")) {
462+
if (!destinationPath.endsWith(".sh")) {
466463
logger.info("File {} for extension: {} is not a bash script, skipping copy.", destinationPath,
467464
extensionName);
468465
return;
@@ -493,7 +490,7 @@ public void prepareExtensionEntryPoint(String extensionName, boolean userDefined
493490
throw exception;
494491
}
495492
try {
496-
if (!createEntryPoint(extensionName, userDefined, extensionRelativeEntryPoint, destinationPathObj)) {
493+
if (!createEntryPoint(extensionName, destinationPathObj)) {
497494
throw exception;
498495
}
499496
} catch (IOException e) {

0 commit comments

Comments
 (0)