MSFT_HostsFile: Host entries that have multiple entries on a single line fail
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 42/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- powershell
- 领域
- networking
调研方向
首先定位 MSFT_HostsFile 的实现并检查第 233-259 行,这些行处理每行包含多个条目的情况,然后检查第 368 行附近的比较。使用提供的 HostsFile 配置重现此问题,并验证重复运行 LCM 不会重新写入未更改的主机条目。
由索引模型根据 Issue 内容生成。
描述
Details of the scenario you tried and the problem that is occurring
When defining multiple entries on a single line it will write them to the host file every time the LCM kicks off.
Line 233 -259 takes in account for multiple entries per line but then a compare happens later against that array and a string that was passed into the Get-HostEntry.
Suggested solution to the issue
Change line 368
FROM: if ($result.Host -eq $HostName)
TO: if ([string]$result.Host -eq HostName)
The DSC configuration that is used to reproduce the issue (as detailed as possible)
HostsFile "Test1"
{
HostName = 'test-ocsp-responder testVM.lab.local'
IPAddress = '192.168.1.50'
Ensure = 'Present'
}
The operating system the target node is running
OsName : Microsoft Windows Server 2012 R2 Standard
OsOperatingSystemSKU : StandardServerEdition
OsArchitecture : 64-bit
WindowsBuildLabEx : 9600.19358.amd64fre.winblue_ltsb_escrow.190505-1600
OsLanguage : en-US
OsMuiLanguages : {en-US}
Version and build of PowerShell the target node is running
Name Value
---- -----
PSVersion 5.1.14409.1018
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14409.1018
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Version of the DSC module that was used ('dev' if using current dev branch)
6.1.0.0 The code for this issue looks the same.
- 主要语言
- PowerShell
- 星标
- 234
- 派生
- 92
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
dsccommunity/NetworkingDsc 的其他 Issue
-
chore
难度 2/5 1-3 小时 新手友好度 72/100
dsccommunity/NetworkingDsc#544 ·
-
chore
难度 4/5 3-5 天 新手友好度 72/100
dsccommunity/NetworkingDsc#542 ·
-
chore
难度 3/5 1-2 天 新手友好度 68/100
dsccommunity/NetworkingDsc#543 ·
-
难度 2/5 1-3 小时 新手友好度 25/100
dsccommunity/NetworkingDsc#539 ·
-
难度 2/5 1-3 小时 新手友好度 25/100
dsccommunity/NetworkingDsc#538 ·
查看 dsccommunity/NetworkingDsc 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
dj-bolt/django-bolt#504 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
-
capture needed
难度 2/5 1-3 小时 新手友好度 67/100
Groundskeeper-robot/groundskeeper#56 ·
维护者通常 1 天内回复
-
type: bug
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 68/100
InukaAsith/TwinDesk#74 ·
维护者通常 2 天内回复