def query(self, wql):
try:<EOL><INDENT>self.__wql = ['<STR_LIT>', '<STR_LIT>',<EOL>self.args.domain + '<STR_LIT:\\>' + self.args.user + '<STR_LIT:%>' + self.args.password,<EOL>'<STR_LIT>' + self.args.host,<EOL>'<STR_LIT>', self.args.namespace,<EOL>'<STR_LIT>', self.args.delimiter,<EOL>wql]<EOL>self.logger.debug("<STR_LIT>".format(self.__wql))<EOL>self.__output = subprocess.check_output(self.__wql)<EOL>self.logger.debug("<STR_LIT>".format(self.__output))<EOL>self.logger.debug("<STR_LIT>")<EOL>self.__wmi_output = self.__output.splitlines()[<NUM_LIT:1>:]<EOL>self.logger.debug("<STR_LIT>".format(self.__wmi_output))<EOL>self.__csv_header = csv.DictReader(self.__wmi_output, delimiter='<STR_LIT:|>')<EOL>self.logger.debug("<STR_LIT>".format(self.__csv_header))<EOL>return list(self.__csv_header)<EOL><DEDENT>except subprocess.CalledProcessError as e:<EOL><INDENT>self.unknown("<STR_LIT>" % e)<EOL><DEDENT>
Connect by wmi and run wql.