added bug fix for if Kusto Cluster does not have value

This commit is contained in:
Victoria 2024-07-24 13:37:37 -07:00
Родитель 25fae718e6
Коммит 952785905c
2 изменённых файлов: 6 добавлений и 5 удалений

Просмотреть файл

@ -411,7 +411,7 @@ namespace CollectSFData.Common
DatabasePersistence = CmdLineApp.Option("-dp|--databasePersistence",
"[bool] default false to create a volatile database. a value of true will" +
$"{newLine} persist the database a given path in your container.",
$"{newLine} persist the database on a given path in your container.",
CommandOptionType.SingleValue);
DatabasePersistencePath = CmdLineApp.Option("-dpp|--databasePersistencePath",

Просмотреть файл

@ -441,7 +441,7 @@ namespace CollectSFData.Common
public bool IsLocalIngestionConfigured()
{
return Regex.IsMatch(KustoCluster, Constants.LocalWebServerPattern) & HasValue(LocalPath);
return HasValue(KustoCluster) && Regex.IsMatch(KustoCluster, Constants.LocalWebServerPattern) && HasValue(LocalPath);
}
public bool IsKustoConfigured()
@ -610,6 +610,7 @@ namespace CollectSFData.Common
options.Remove("Examples");
options.Remove("ExePath");
options.Remove("FileType");
options.Remove("IsIngestionLocal");
options.Remove("IsValid");
options.Remove("NeedsValidation");
options.Remove("SasEndpointInfo");
@ -888,19 +889,19 @@ namespace CollectSFData.Common
UseMemoryStream = false;
}
if (Regex.IsMatch(KustoCluster, Constants.KustoUrlPattern) && HasValue(LocalPath))
if (HasValue(KustoCluster) && Regex.IsMatch(KustoCluster, Constants.KustoUrlPattern) && HasValue(LocalPath))
{
Log.Error($"local and remote ingestion *cannot* both be enabled. please either remove input for LocalPath field or provide a local web server url instead.");
retval = false;
}
if (Regex.IsMatch(KustoCluster, Constants.LocalWebServerPattern) && !HasValue(LocalPath))
if (HasValue(KustoCluster) && Regex.IsMatch(KustoCluster, Constants.LocalWebServerPattern) && !HasValue(LocalPath))
{
Log.Error($"if connecting to a local web server, please provide a value for the LocalPath field.");
retval = false;
}
if (Regex.IsMatch(KustoCluster, Constants.KustoUrlPattern) && (DatabasePersistence || HasValue(DatabasePersistencePath)))
if (HasValue(KustoCluster) && Regex.IsMatch(KustoCluster, Constants.KustoUrlPattern) && (DatabasePersistence || HasValue(DatabasePersistencePath)))
{
Log.Error($"persistent database creation is only available for local ingestion.");
retval = false;