Repeat-condition construct 编辑

Repeat-condition construct

The repeat-condition construct is evaluated in each iteration of a repeat construct and the result determines whether to build the configuration object in that iteration or to move to the next iteration. The following example shows the use of the repeat-condition construct:

Example:

components

   -

      name: der-key-files-comp

      type: ns::systemfile  

      repeat:

      repeat-list: $parameters.certificates

      repeat-item: certificate

        repeat-condition: $certificate.ssl-inform == DER

        properties:

         filecontent: base64($certificate.keyfile.contents)

         fileencoding: BASE64

         filelocation: /nsconfig/ssl

         filename: $certificate.keyfile.file
<!--NeedCopy-->

In this example, the der-key-files-comp component iterates over all the certificates given by the user but it only builds configuration objects that correspond to certificates with DER encoding. In each iteration, the repeat-condition expression is evaluated to test whether the certificate encoding is of type DER. If it is not of type DER, no configuration object is built in the current iteration, and the iteration moves to the next certificate in the list.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:90 次

字数:1397

最后编辑:6 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文