def query(self, klass): """ Executes a query using the wmi-client command. """ # i don't want to have to repeat the -U stuff credentials = self._make_credential_args() # Let's make the query construction independent, but also if there's a # space then it's probably just a regular query. if " " not in klass: queryx = self._construct_query(klass) else: queryx = klass # and these are just configuration setup = self._setup_params() # construct the arguments to wmic arguments = setup + credentials + [queryx] # execute the command output = sh.wmic(*arguments) # just to be sure? sh is weird sometimes. output = str(output) # and now parse the output return WmiClientWrapper._parse_wmic_output(output, delimiter=self.delimiter)