sort control filenames
Often controls filenames are numbered, sorting them makes the output more logical instead of randomized.
This also enables our use case: Running inspec with attributes file 'exceptions.yml' that contains exceptions. The profile controls folder contains files like file-01.rb, file-02.rb etc. and a zzSkip_Control.rb This last file contains no tests only logic that iterates over all controls, if a control is in the exceptions file it is skipped. This enables a multi layered model; controls defined in exceptions.yml are skipped during the profile handling, instead of the skip_control examples that require a 'master' profile to skip exceptions in 'child' profile.
Also, the 'master'-'child' model only can handle a single layer, the multi layer model can have multiple layers; layer 3 profile (the one that is executed) depends on layer 2 profiles, depends on layer 1 profiles. The skip_control is available on each layer when using the technique as described above.
Fixes #3797 (sort control files)
EDIT: link to open issue
该提问来源于开源项目:inspec/inspec
weixin_39636610
2020/12/01 12:19- 点赞
- 收藏
- 回答
5个回复
