Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

D39139_Added error MSG for Plug in installation failed #3652

Merged
merged 2 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 19 additions & 9 deletions Ginger/Ginger/PluginsLib/PluginsIndexPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ limitations under the License.
using Amdocs.Ginger.CoreNET.PlugInsLib;
using Amdocs.Ginger.Repository;
using Ginger.UserControls;
using System;
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;
Expand Down Expand Up @@ -170,16 +171,25 @@ private void xInstallButonn_Click(object sender, RoutedEventArgs e)
}
Task.Factory.StartNew(() =>
{
WorkSpace.Instance.PlugInsManager.InstallPluginPackage(onlinePluginPackage, release);
onlinePluginPackage.Status = "Installed";
}).ContinueWith((a) =>
{
Dispatcher.Invoke(() =>
try
{
xProcessingImage.Visibility = Visibility.Collapsed;
xInstallButton.ButtonText = "Install";
xInstalledVersion.Text = onlinePluginPackage.CurrentPackage;
});
WorkSpace.Instance.PlugInsManager.InstallPluginPackage(onlinePluginPackage, release);
onlinePluginPackage.Status = "Installed";
}
catch (Exception ex)
{
onlinePluginPackage.Status = "Error in installation,Please check error logs";
throw;
}
finally
{
Dispatcher.Invoke(() =>
{
xProcessingImage.Visibility = Visibility.Collapsed;
xInstallButton.ButtonText = "Install";
xInstalledVersion.Text = onlinePluginPackage.CurrentPackage;
});
}
});
xInstalledSection.Visibility = Visibility.Visible;

Expand Down
25 changes: 17 additions & 8 deletions Ginger/GingerCoreNET/PlugInsLib/PluginsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ limitations under the License.
using Amdocs.Ginger.Common.Repository.PlugInsLib;
using Amdocs.Ginger.CoreNET.Drivers.CommunicationProtocol;
using Amdocs.Ginger.CoreNET.PlugInsLib;
using log4net.Plugin;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -69,16 +70,24 @@ public class DriverInfo

public void AddPluginPackage(string folder)
{
// Verify folder exist
if (!System.IO.Directory.Exists(folder))
try
{
throw new Exception("Plugin folder not found: " + folder);
}
// Verify folder exist
if (!System.IO.Directory.Exists(folder))
{
throw new Exception("Plugin folder not found: " + folder);
}

PluginPackage pluginPackage = new PluginPackage(folder);
pluginPackage.PluginPackageOperations = new PluginPackageOperations(pluginPackage);
pluginPackage.PluginPackageOperations.LoadPluginPackage(folder);
mSolutionRepository.AddRepositoryItem(pluginPackage);
PluginPackage pluginPackage = new PluginPackage(folder);
pluginPackage.PluginPackageOperations = new PluginPackageOperations(pluginPackage);
pluginPackage.PluginPackageOperations.LoadPluginPackage(folder);
mSolutionRepository.AddRepositoryItem(pluginPackage);
}
catch (Exception ex)
prashelke marked this conversation as resolved.
Show resolved Hide resolved
{
Reporter.ToLog(eLogLevel.ERROR, "Error occurred while downloading/updating the Ginger Plugins packages", ex);
throw;
}
}

private void CurrentDomain_AssemblyLoad(object sender, AssemblyLoadEventArgs args)
Expand Down
Loading