def syncReports(self): """ Synchronize report directory using the DataManager and Plugins online We first make sure that all shared reports were added to the repo """ for root, dirs, files in os.walk(self._report_path, False): if root == self._report_path: for name in files: filename = os.path.join(root, name) model.api.devlog( "Report file is %s" % filename) parser = ReportXmlParser(filename) if (parser.report_type is not None): #TODO: get host and port from config client = PluginControllerAPIClient("127.0.0.1", 9977) model.api.devlog("The file is %s, %s" % (filename,parser.report_type)) command_string = "./%s report" % parser.report_type.lower() model.api.devlog("Executing %s" % (command_string)) new_cmd, output_file = client.send_cmd(command_string) client.send_output(command_string, filename) os.rename(filename, os.path.join(self._report_ppath, name)) self.onlinePlugins()
def syncReports(self): """ Synchronize report directory using the DataManager and Plugins online We first make sure that all shared reports were added to the repo """ for root, dirs, files in os.walk(self._report_path, False): if root == self._report_path: for name in files: filename = os.path.join(root, name) model.api.log("Report file is %s" % filename) parser = ReportParser(filename) if (parser.report_type is not None): host = CONF.getApiConInfoHost() port_rest = int(CONF.getApiRestfulConInfoPort()) client = PluginControllerAPIClient(host, port_rest) model.api.log("The file is %s, %s" % (filename, parser.report_type)) command_string = "./%s %s" % ( parser.report_type.lower(), filename) model.api.log("Executing %s" % (command_string)) new_cmd, output_file = client.send_cmd(command_string) client.send_output(command_string, filename) os.rename(filename, os.path.join(self._report_ppath, name)) self.onlinePlugins()
def syncReports(self): """ Synchronize report directory using the DataManager and Plugins online We first make sure that all shared reports were added to the repo """ for root, dirs, files in os.walk(self._report_path, False): if root == self._report_path: for name in files: filename = os.path.join(root, name) model.api.log( "Report file is %s" % filename) parser = ReportParser(filename) if (parser.report_type is not None): host = CONF.getApiConInfoHost() port_rest = int(CONF.getApiRestfulConInfoPort()) client = PluginControllerAPIClient(host, port_rest) model.api.log("The file is %s, %s" % (filename,parser.report_type)) command_string = "./%s %s" % (parser.report_type.lower(), filename) model.api.log("Executing %s" % (command_string)) new_cmd, output_file = client.send_cmd(command_string) client.send_output(command_string, filename) os.rename(filename, os.path.join(self._report_ppath, name)) self.onlinePlugins()
def syncReports(self): """ Synchronize report directory using the DataManager and Plugins online We first make sure that all shared reports were added to the repo """ self._xml_output_path = self.path if self._xml_output_path is None: return if not os.path.exists(self._xml_output_path): return False for root, dirs, files in os.walk(self._xml_output_path,False): if root == self._xml_output_path: for name in files: filename = os.path.join(root, name) model.api.devlog( "Report file is %s" % filename) parser = ReportXmlParser(filename) if (parser.report_type is not None): #TODO: get host and port from config client = PluginControllerAPIClient("127.0.0.1", 9977) #self._xml_output_path = filename model.api.devlog("The file is %s, %s" % (filename,parser.report_type)) command_string = "./%s report" % parser.report_type.lower() model.api.devlog("Executing %s" % (command_string)) # current_path ="" # new_cmd = self.plugin_controller.processCommandInput("", "", # current_path, # command_string, # False) new_cmd, output_file = client.send_cmd(command_string) #self.plugin_controller.storeCommandOutput(self._xml_output_path) client.send_output(command_string, filename) #self.plugin_controller.onCommandFinished() os.rename(filename, os.path.join(root,"process", name)) self.onlinePlugins()
def syncReports(self): """ Synchronize report directory using the DataManager and Plugins online We first make sure that all shared reports were added to the repo """ self._xml_output_path = self.path if self._xml_output_path is None: return if not os.path.exists(self._xml_output_path): return False for root, dirs, files in os.walk(self._xml_output_path, False): if root == self._xml_output_path: for name in files: filename = os.path.join(root, name) model.api.devlog("Report file is %s" % filename) parser = ReportXmlParser(filename) if (parser.report_type is not None): #TODO: get host and port from config client = PluginControllerAPIClient("127.0.0.1", 9977) #self._xml_output_path = filename model.api.devlog("The file is %s, %s" % (filename, parser.report_type)) command_string = "./%s report" % parser.report_type.lower( ) model.api.devlog("Executing %s" % (command_string)) # current_path ="" # new_cmd = self.plugin_controller.processCommandInput("", "", # current_path, # command_string, # False) new_cmd, output_file = client.send_cmd(command_string) #self.plugin_controller.storeCommandOutput(self._xml_output_path) client.send_output(command_string, filename) #self.plugin_controller.onCommandFinished() os.rename(filename, os.path.join(root, "process", name)) self.onlinePlugins()