Exemplo n.º 1
0
    def print_result(self, result):

        if result == None:
            log.warn('%s %s' % (messages.module_sql_console.no_data,
                                messages.module_sql_console.check_credentials)
                    )
        elif not result:
            log.warn(messages.module_sql_console.no_data)
        else:
            Module.print_result(self, result)
Exemplo n.º 2
0
    def print_result(self, result):

        if result['error']:
            log.info(result['error'])

        if result['result']:
            Module.print_result(self, result['result'])

        elif not result['error']:

            log.warn('%s %s' % (messages.module_sql_console.no_data,
                                messages.module_sql_console.check_credentials))

            command_last_chars = utils.prettify.shorten(
                self.args['query'].rstrip(), keep_trailer=10)

            if (command_last_chars and command_last_chars[-1] != ';'):
                log.warn(messages.module_sql_console.missing_sql_trailer_s %
                         command_last_chars)
Exemplo n.º 3
0
    def print_result(self, result):

        if result['error']:
            log.info(result['error'])

        if result['result']:
            Module.print_result(self, result['result'])

        elif not result['error']:

            log.warn('%s %s' % (messages.module_sql_console.no_data,
                                messages.module_sql_console.check_credentials)
                    )

            command_last_chars = utils.prettify.shorten(
                                    self.args['query'].rstrip(),
                                    keep_trailer = 10
            )

            if (command_last_chars and command_last_chars[-1] != ';'):
                log.warn(messages.module_sql_console.missing_sql_trailer_s % command_last_chars)
Exemplo n.º 4
0
    def print_result(self, result):

        if not result: return

        result_verbose = {}

        for path, perms in result.items():

            if len(perms) == 1 and perms[0] == 'e':
                result_verbose[path] = 'exists'
            else:
                verbose_string = ' '.join([
                    'writable' if 'w' in perms else '',
                    'readable' if 'r' in perms else '',
                    'executable' if 'x' in perms else ''
                ])

                # Re split to delete multiple whitespaces
                result_verbose[path] = ' '.join(verbose_string.strip().split())

        return Module.print_result(self, result_verbose)
    def print_result(self, result):

        if not result: return

        result_verbose = {}

        for path, perms in result.items():

            if len(perms) == 1 and perms[0] == 'e':
                result_verbose[path] = 'exists'
            else:
                verbose_string = ' '.join([
                    'writable' if 'w' in perms else '',
                    'readable' if 'r' in perms else '',
                    'executable' if 'x' in perms else ''
                ])

                # Re split to delete multiple whitespaces
                result_verbose[path] = ' '.join(
                    verbose_string.strip().split()
                )

        return Module.print_result(self, result_verbose)