mirror of https://github.com/winsw/winsw
Update yaml extension support
Improve error messages improve boolean parser remove unncessary logspull/638/head
parent
362ea03104
commit
9f7047012a
|
@ -280,7 +280,6 @@ namespace WinSW
|
|||
Log.Info("Starting " + this.descriptor.Executable + ' ' + startArguments);
|
||||
|
||||
// Load and start extensions
|
||||
Console.WriteLine("Loading extensinos");
|
||||
this.ExtensionManager.LoadExtensions();
|
||||
this.ExtensionManager.FireOnWrapperStarted();
|
||||
|
||||
|
|
|
@ -648,16 +648,27 @@ namespace WinSW.Configuration
|
|||
{
|
||||
get
|
||||
{
|
||||
int extensionNumber = 1;
|
||||
|
||||
if (this.YamlExtensionsConfiguration is null)
|
||||
{
|
||||
return new List<string>(0);
|
||||
}
|
||||
|
||||
var result = new List<string>();
|
||||
var result = new List<string>(this.YamlExtensionsConfiguration.Count);
|
||||
|
||||
foreach (var item in this.YamlExtensionsConfiguration)
|
||||
{
|
||||
result.Add(item.GetId());
|
||||
try
|
||||
{
|
||||
result.Add(item.GetId());
|
||||
}
|
||||
catch (InvalidDataException)
|
||||
{
|
||||
throw new InvalidDataException("Id is null in Extension " + extensionNumber);
|
||||
}
|
||||
|
||||
extensionNumber++;
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace WinSW.Configuration
|
|||
{
|
||||
if (this.ExtensionId is null)
|
||||
{
|
||||
throw new InvalidDataException("Extension Id can't be empty");
|
||||
throw new InvalidDataException();
|
||||
}
|
||||
|
||||
return this.ExtensionId;
|
||||
|
@ -32,7 +32,7 @@ namespace WinSW.Configuration
|
|||
{
|
||||
if (this.ExtensionClassName is null)
|
||||
{
|
||||
throw new InvalidDataException("Extension ClassName can't be empty");
|
||||
throw new InvalidDataException($@"Extension ClassName is empty in extension {this.GetId()}");
|
||||
}
|
||||
|
||||
return this.ExtensionClassName;
|
||||
|
@ -42,7 +42,7 @@ namespace WinSW.Configuration
|
|||
{
|
||||
if (this.Settings is null)
|
||||
{
|
||||
throw new InvalidDataException("Extension settings not found");
|
||||
throw new InvalidDataException(@$"Extension settings is empty in extension {this.GetId()}");
|
||||
}
|
||||
|
||||
return this.Settings;
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace WinSW.Extensions
|
|||
/// <summary>
|
||||
/// Configure the extension from Yaml configuration
|
||||
/// </summary>
|
||||
/// <param name="descriptor">Yaml Service Descptor</param>
|
||||
/// <param name="descriptor">YamlConfiguration</param>
|
||||
/// <param name="config">Configuration Node</param>
|
||||
void Configure(IWinSWConfiguration descriptor, YamlExtensionConfiguration config);
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ namespace WinSW.Util
|
|||
{
|
||||
value = value.ToLower();
|
||||
|
||||
if (value.Equals("true") || value.Equals("yes") || value.Equals("on"))
|
||||
if (value.Equals("true") || value.Equals("yes") || value.Equals("on") || value.Equals("y") || value.Equals("1"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue