Skip to content
This repository has been archived by the owner on Jan 7, 2023. It is now read-only.

Commit

Permalink
Merge pull request #287 from liangzhaowang/liangzw_wip_fix_generate_c…
Browse files Browse the repository at this point in the history
…sv_issue

fix the generate ceph cpu detail csv issue
  • Loading branch information
xuechendi authored Jan 4, 2018
2 parents aa5c769 + 826b17c commit c53997c
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions visualizer/visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,8 @@ def add_html_framework(self, maindata):

def save_data_to_csv(self,data,node_type,field_type,session_name):
common.printout("LOG","save %s %s detail data to csv file." % (node_type,field_type))
if not os.path.exists(os.path.join(self.db_path,session_name,"include/csv")):
common.bash("mkdir -p %s"%(os.path.join(self.db_path,session_name,"include/csv")))
if not os.path.exists("../visualizer/include/csv/"):
common.bash("mkdir -p %s"%("../visualizer/include/csv/"))
csv_list = []
title_row = []
title_row = common.get_title_list(data)
Expand All @@ -345,12 +345,11 @@ def save_data_to_csv(self,data,node_type,field_type,session_name):
continue
row.append(detail_data[title])
csv_list.append(row)
file_name = "%s_%s_detail_data.csv"%(node_type,field_type)
csv_path = os.path.join(self.db_path,session_name,"include/csv/",file_name)
csvfile = file(csv_path, 'wb')
csv_writer = csv.writer(csvfile)
for row in csv_list:
csv_writer.writerow(row)
csv_name = "%s_%s_detail_data.csv"%(node_type,field_type)
with open('../visualizer/include/csv/%s' % csv_name, 'w') as f:
csv_writer = csv.writer(f)
for row in csv_list:
csv_writer.writerow(row)

def generate_node_view(self, node_type):
output = []
Expand Down

0 comments on commit c53997c

Please sign in to comment.