浏览代码

adding check before writing to core file

pull/114/head
Kalynovskyi 7 年前
父节点
当前提交
0a91ebe68f
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. +4
    -1
      linux/system/cpu.sls

+ 4
- 1
linux/system/cpu.sls 查看文件

@@ -32,11 +32,14 @@ ondemand_service_disable:

{% for cpu_core in range(salt['grains.get']('num_cpus', 1)) %}

{% set core_key = 'devices/system/cpu/cpu' + cpu_core|string + '/cpufreq/scaling_governor' %}
{% if salt['file.file_exists']('/sys/'+ core_key) %}
governor_write_sysfs_cpu_core_{{ cpu_core }}:
module.run:
- name: sysfs.write
- key: devices/system/cpu/cpu{{ cpu_core }}/cpufreq/scaling_governor
- key: {{ core_key }}
- value: {{ system.cpu.governor }}
{% endif %}

{%- endfor %}


正在加载...
取消
保存