示例#1
0
    def validate_tools(self, print_path=False):

        self.relaxed_version_check = self.env.get('FW_RELAX_VERSION', False)

        self.client = FWAdminClient(
            admin_name=self.env['FW_ADMIN_USER'],
            admin_pwd=self.env['FW_ADMIN_PASSWORD'],
            server_host=self.env['FW_SERVER_HOST'],
            server_port=self.env['FW_SERVER_PORT'],
            print_output=False
        )

        if print_path:
            print "Path to Admin Tool:", FWAdminClient.get_admin_tool_path()

        self.version = self.client.get_version()
        self.major, self.minor, self.patch = self.version.split('.')
        if int(self.major) < 10:
            if self.relaxed_version_check:
                self.output("FileWave Version 10.0 must be installed - you have version %s" % (self.version))
            else:
                raise ProcessorError("FileWave Version 10.0 must be installed - you have version %s" % (self.version))

        self.can_list_filesets = "No"
        self.exit_status_message = "VALIDATION OK"
        self.exception = None

        try:
            the_filesets = self.client.get_filesets()
            count_filesets = sum(1 for i in the_filesets)
            self.can_list_filesets = "Yes" if count_filesets >= 0 else "No"
        except CalledProcessError, e:
            self.exception = e
            self.exit_status_message = FWAdminClient.ExitStatusDescription[e.returncode][1]
示例#2
0
class FWTool(DmgMounter):
    """Validates that the FileWave Admin Command Line tools are available on this machine."""

    description = __doc__

    input_variables = COMMON_FILEWAVE_VARIABLES

    output_variables = {
        FWTOOL_SUMMARY_RESULT: {
            "description": "The results of the installation/validation check."
        },
    }

    client = None

    def validate_tools(self, print_path=False):

        self.relaxed_version_check = self.env.get('FW_RELAX_VERSION', False)

        self.client = FWAdminClient(admin_name=self.env['FW_ADMIN_USER'],
                                    admin_pwd=self.env['FW_ADMIN_PASSWORD'],
                                    server_host=self.env['FW_SERVER_HOST'],
                                    server_port=self.env['FW_SERVER_PORT'],
                                    print_output=False)

        if print_path:
            print "Path to Admin Tool:", FWAdminClient.get_admin_tool_path()

        self.version = self.client.get_version()
        self.major, self.minor, self.patch = self.version.split('.')
        if int(self.major) < 10:
            if self.relaxed_version_check:
                self.output(
                    "FileWave Version 10.0 must be installed - you have version %s"
                    % (self.version))
            else:
                raise ProcessorError(
                    "FileWave Version 10.0 must be installed - you have version %s"
                    % (self.version))

        self.can_list_filesets = "No"
        self.exit_status_message = "VALIDATION OK"
        self.exception = None

        try:
            the_filesets = self.client.get_filesets()
            count_filesets = sum(1 for i in the_filesets)
            self.can_list_filesets = "Yes" if count_filesets >= 0 else "No"
        except CalledProcessError, e:
            self.exception = e
            self.exit_status_message = FWAdminClient.ExitStatusDescription[
                e.returncode][1]
        except Exception, e:
            self.exception = e
示例#3
0
class FWTool(DmgMounter):
    """Validates that the FileWave Admin Command Line tools are available on this machine."""

    description = __doc__

    input_variables = COMMON_FILEWAVE_VARIABLES

    output_variables = {
        FWTOOL_SUMMARY_RESULT: {
            "description": "The results of the installation/validation check."
        },
    }

    client = None

    def validate_tools(self, print_path=False):

        self.relaxed_version_check = self.env.get('FW_RELAX_VERSION', False)

        self.client = FWAdminClient(
            admin_name=self.env['FW_ADMIN_USER'],
            admin_pwd=self.env['FW_ADMIN_PASSWORD'],
            server_host=self.env['FW_SERVER_HOST'],
            server_port=self.env['FW_SERVER_PORT'],
            print_output=False
        )

        if print_path:
            print "Path to Admin Tool:", FWAdminClient.get_admin_tool_path()

        self.version = self.client.get_version()
        self.major, self.minor, self.patch = self.version.split('.')
        if int(self.major) < 10:
            if self.relaxed_version_check:
                self.output("FileWave Version 10.0 must be installed - you have version %s" % (self.version))
            else:
                raise ProcessorError("FileWave Version 10.0 must be installed - you have version %s" % (self.version))

        self.can_list_filesets = "No"
        self.exit_status_message = "VALIDATION OK"
        self.exception = None

        try:
            the_filesets = self.client.get_filesets()
            count_filesets = sum(1 for i in the_filesets)
            self.can_list_filesets = "Yes" if count_filesets >= 0 else "No"
        except CalledProcessError, e:
            self.exception = e
            self.exit_status_message = FWAdminClient.ExitStatusDescription[e.returncode][1]
        except Exception, e:
            self.exception = e
示例#4
0
    def validate_tools(self, print_path=False):

        self.relaxed_version_check = self.env.get('FW_RELAX_VERSION', False)

        self.client = FWAdminClient(admin_name=self.env['FW_ADMIN_USER'],
                                    admin_pwd=self.env['FW_ADMIN_PASSWORD'],
                                    server_host=self.env['FW_SERVER_HOST'],
                                    server_port=self.env['FW_SERVER_PORT'],
                                    print_output=False)

        if print_path:
            print("Path to Admin Tool:", FWAdminClient.get_admin_tool_path())

        self.version = self.client.get_version()
        self.major, self.minor, self.patch = self.version.split('.')
        if int(self.major) < 10:
            if self.relaxed_version_check:
                self.output(
                    "FileWave Version 10.0 must be installed - you have version %s"
                    % (self.version))
            else:
                raise ProcessorError(
                    "FileWave Version 10.0 must be installed - you have version %s"
                    % (self.version))

        self.can_list_filesets = "No"
        self.exit_status_message = "VALIDATION OK"
        self.exception = None

        try:
            the_filesets = self.client.get_filesets()
            count_filesets = sum(1 for i in the_filesets)
            self.can_list_filesets = "Yes" if count_filesets >= 0 else "No"
        except CalledProcessError as e:
            self.exception = e
            self.exit_status_message = FWAdminClient.ExitStatusDescription[
                e.returncode][1]
        except Exception as e:
            self.exception = e

        if self.env['FW_ADMIN_USER'] == 'fwadmin':
            self.output(
                "WARNING: You are using the FileWave super-user account (fwadmin)"
            )
示例#5
0
class FWTool(DmgMounter):
    """Validates that the FileWave Admin Command Line tools are available on this machine."""

    description = __doc__

    input_variables = COMMON_FILEWAVE_VARIABLES

    output_variables = {
        FWTOOL_SUMMARY_RESULT: {
            "description": "The results of the installation/validation check."
        },
    }

    client = None

    def validate_tools(self, print_path=False):

        self.relaxed_version_check = self.env.get('FW_RELAX_VERSION', False)

        self.client = FWAdminClient(admin_name=self.env['FW_ADMIN_USER'],
                                    admin_pwd=self.env['FW_ADMIN_PASSWORD'],
                                    server_host=self.env['FW_SERVER_HOST'],
                                    server_port=self.env['FW_SERVER_PORT'],
                                    print_output=False)

        if print_path:
            print("Path to Admin Tool:", FWAdminClient.get_admin_tool_path())

        self.version = self.client.get_version()
        self.major, self.minor, self.patch = self.version.split('.')
        if int(self.major) < 10:
            if self.relaxed_version_check:
                self.output(
                    "FileWave Version 10.0 must be installed - you have version %s"
                    % (self.version))
            else:
                raise ProcessorError(
                    "FileWave Version 10.0 must be installed - you have version %s"
                    % (self.version))

        self.can_list_filesets = "No"
        self.exit_status_message = "VALIDATION OK"
        self.exception = None

        try:
            the_filesets = self.client.get_filesets()
            count_filesets = sum(1 for i in the_filesets)
            self.can_list_filesets = "Yes" if count_filesets >= 0 else "No"
        except CalledProcessError as e:
            self.exception = e
            self.exit_status_message = FWAdminClient.ExitStatusDescription[
                e.returncode][1]
        except Exception as e:
            self.exception = e

        if self.env['FW_ADMIN_USER'] == 'fwadmin':
            self.output(
                "WARNING: You are using the FileWave super-user account (fwadmin)"
            )

    def main(self):
        self.validate_tools(print_path=True)

        if FWTOOL_SUMMARY_RESULT in self.env:
            del self.env[FWTOOL_SUMMARY_RESULT]

        self.env[FWTOOL_SUMMARY_RESULT] = {
            'summary_text':
            'Here are the results of installation validation:',
            'report_fields': [
                'fw_admin_console_version', 'fw_admin_user', 'fw_server_host',
                'fw_server_port', 'fw_can_list_filesets', 'fw_message'
            ],
            'data': {
                'fw_admin_console_version': self.version,
                'fw_admin_user': self.env['FW_ADMIN_USER'],
                'fw_server_host': self.env['FW_SERVER_HOST'],
                'fw_server_port': self.env['FW_SERVER_PORT'],
                'fw_can_list_filesets': self.can_list_filesets,
                'fw_message': self.exit_status_message
            }
        }

        if self.exception is not None:
            print(self.exception)