Skip to content

Commit

Permalink
Merge pull request #110 from blkart/bugfix3
Browse files Browse the repository at this point in the history
[doctor env]: fix bug #4313
  • Loading branch information
mathslinux committed Jun 29, 2015
2 parents a362c38 + e94d444 commit 95e40b7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions eayunstack_tools/doctor/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,9 @@ def check_network():
@userful_msg()
@register
def check_cpu():
if not intel_pstate_enabled():
LOG.debug('kernel parameter "intel_pstate" was disabled.')
return
(status, out) = commands.getstatusoutput(
"cpupower frequency-info | grep \"current policy\" | awk \'{print $7}\'")
if status != 0:
Expand Down Expand Up @@ -305,6 +308,14 @@ def check_cpu():
else:
LOG.error('Current CPU Frequency: %s %s. Not within %s %s and %s %s' % (cpu_cur_freq, cpu_cur_freq_unit, cpu_min_freq, cpu_min_freq_unit, cpu_max_freq, cpu_max_freq_unit))

def intel_pstate_enabled():
(status, out) = commands.getstatusoutput(
"lsmod | grep -q \"^acpi_cpufreq\"")
if status == 0:
return True
else:
return False

def check_nodes(obj_name):
# node_list = get_node_list('all')
for role in ['controller','compute','mongo','ceph-osd']:
Expand Down

0 comments on commit 95e40b7

Please sign in to comment.