mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-28 16:14:09 +02:00
Fix CA2202 code analysis warning in the Windows wizard
This commit is contained in:
parent
979b99ea6f
commit
98d81ffc85
@ -83,10 +83,16 @@ namespace Icinga
|
||||
|
||||
private void EnableFeature(string feature)
|
||||
{
|
||||
using (FileStream fp = File.Open(Icinga2InstallDir + String.Format("\\etc\\icinga2\\features-enabled\\{0}.conf", feature), FileMode.Create)) {
|
||||
FileStream fp = null;
|
||||
try {
|
||||
fp = File.Open(Icinga2InstallDir + String.Format("\\etc\\icinga2\\features-enabled\\{0}.conf", feature), FileMode.Create);
|
||||
using (StreamWriter sw = new StreamWriter(fp, Encoding.ASCII)) {
|
||||
fp = null;
|
||||
sw.Write(String.Format("include \"../features-available/{0}.conf\"\n", feature));
|
||||
}
|
||||
} finally {
|
||||
if (fp != null)
|
||||
fp.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user