def response_playbook(self, rp_path): """Nothing here yet""" print("Populating Response Playbooks..") if rp_path: rp_list = glob.glob(rp_path + '*.yml') else: rp_dir = ATCconfig.get('response_playbooks_dir') rp_list = glob.glob(rp_dir + '/*.yml') for rp_file in rp_list: try: rp = ResponsePlaybook(rp_file, apipath=self.apipath, auth=self.auth, space=self.space) rp.render_template("confluence") base = os.path.basename(rp_file) confluence_data = { "title": rp.rp_parsed_file['title'], "spacekey": self.space, "parentid": str( ATCutils.confluence_get_page_id( self.apipath, self.auth, self.space, "Response Playbooks")), "confluencecontent": rp.content, } res = ATCutils.push_to_confluence(confluence_data, self.apipath, self.auth) if res == 'Page updated': print("==> updated page: RP '" + base + "'") # print("Done: ", rp.rp_parsed_file['title']) except Exception as err: print(rp_file + " failed") print("Err message: %s" % err) print('-' * 60) traceback.print_exc(file=sys.stdout) print('-' * 60) print("Response Playbooks populated!")
def response_playbook(self, rp_path): """Nothing here yet""" if rp_path: rp_list = glob.glob(rp_path + '*.yml') else: rp_list = glob.glob('../response_playbooks/*.yml') for rp_file in rp_list: try: rp = ResponsePlaybook(rp_file) rp.render_template("markdown") rp.save_markdown_file(atc_dir=self.atc_dir) except Exception as e: print(rp_file + " failed\n\n%s\n\n" % e) print("Err message: %s" % e) print('-' * 60) traceback.print_exc(file=sys.stdout) print('-' * 60)
def response_playbook(self, rp_path): """Populate Response Playbooks""" print("Populating Response Playbooks..") if rp_path: rp_list = glob.glob(rp_path + '*.yml') else: rp_dir = ATCconfig.get('response_playbooks_dir') rp_list = glob.glob(rp_dir + '/*.yml') for rp_file in rp_list: try: rp = ResponsePlaybook(rp_file) rp.render_template("markdown") rp.save_markdown_file(atc_dir=self.atc_dir) except Exception as e: print(rp_file + " failed\n\n%s\n\n" % e) print("Err message: %s" % e) print('-' * 60) traceback.print_exc(file=sys.stdout) print('-' * 60) print("Response Playbooks populated!")