Fixing offline mode in ConfigurationManager
@@ -156,10 +156,11 @@ public class ConfigurationManager {
"You have provided both a hub signature scanner url AND a local hub signature scanner path. Only one of these properties can be set at a time. If both are used together, the *correct* source of the signature scanner can not be determined.",
ExitCodeType.FAILURE_GENERAL_ERROR);
}
-
+ Boolean originalOfflineMode = detectConfigWrapper.getBooleanProperty(DetectProperty.BLACKDUCK_HUB_OFFLINE_MODE);
+ hubOfflineMode = originalOfflineMode;
if (StringUtils.isNotBlank(detectConfigWrapper.getProperty(DetectProperty.DETECT_HUB_SIGNATURE_SCANNER_HOST_URL))) {
logger.info("A hub signature scanner url was provided, which requires hub offline mode. Setting hub offline mode to true.");
- if (hubOfflineMode == false) {
+ if (originalOfflineMode == false) {
addFieldWarning(detectOptions, DetectProperty.DETECT_HUB_SIGNATURE_SCANNER_HOST_URL, "A hub signature scanner host url was provided but hub offline mode was false. In the future set hub offline mode to true.");
addFieldWarning(detectOptions, DetectProperty.BLACKDUCK_HUB_OFFLINE_MODE, "A signature scanner url was provided, so hub offline mode was forced to true.");
}
@@ -167,7 +168,7 @@ public class ConfigurationManager {
}
if (StringUtils.isNotBlank(detectConfigWrapper.getProperty(DetectProperty.DETECT_HUB_SIGNATURE_SCANNER_OFFLINE_LOCAL_PATH))) {
logger.info("A local hub signature scanner path was provided, which requires hub offline mode. Setting hub offline mode to true.");
- if (hubOfflineMode == false) {
+ if (originalOfflineMode == false) {
addFieldWarning(detectOptions, DetectProperty.DETECT_HUB_SIGNATURE_SCANNER_OFFLINE_LOCAL_PATH, "A local hub signature scanner was provided but hub offline mode was false. In the future set hub offline mode to true.");
addFieldWarning(detectOptions, DetectProperty.BLACKDUCK_HUB_OFFLINE_MODE, "A signature scanner path was provided, so hub offline mode was forced to true.");
}
