本文介绍了(SaltStack) SLS dog中的ID dog不是字典的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我一直试图在/etc/modules 文件中找到一个模式 (bcm2708_wdog),如果没有,则将其添加到底部.每次我尝试这个时,我都会得到SLS dog 中的 ID dog is not a dictionary".我不知道这是什么意思.这是文件:
I have been trying to find a pattern (bcm2708_wdog) in the /etc/modules file and if it isnt there add it to the bottom. Every time I try this I get the "ID dog in SLS dog is not a dictionary". I have no idea what this means.Here is the file:
dog:
- file.replace:
- name: /etc/modules
- pattern: 'bcm2708_wdog'
- append_if_not_found: True
推荐答案
它可能应该是这样的:
dog:
file.replace: # <--------this line was your problem.
- name: /etc/modules
- pattern: 'bcm2708_wdog'
- append_if_not_found: True
以-"开头的行表示列表中的项目.在您的版本中,您已将顶级dog"元素定义为包含字典的列表.Salt 期望它是一个直接的字典,因此错误.
Lines beginning with "-" denote items in a list. In your version, you've defined the top-level "dog" element as a list containing a dictionary. Salt expects it to be a straight dictionary instead, hence the error.
这篇关于(SaltStack) SLS dog中的ID dog不是字典的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!