Ejemplo n.º 1
0
    def __init__(self, **kwargs):
        """QueryCommand initialization.
        """
        self.device_name = kwargs[cs.UI_ARG_DEVICE]
        self.vHCAid = kwargs[cs.UI_ARG_VHCAID]
        self.data = None

    def get_data(self):
        """call the QueryData for getting the menu data.
        """
        self.data = QueryData.get_query(self.device_name, self.vHCAid)

    def print_data(self):
        """call the data printer with the right configuration for print the menu to screen.
        """
        DataPrinter.print_query_data(self.data)

    def validate(self):
        """call the capability validator and check if the core dump supported by the FW.
        """

        if CapabilityValidator.validate():
            return True
        else:
            raise Exception(
                "Resource Dump register is not supported by the FW")


CommandFactory.register(constants.RESOURCE_DUMP_COMMAND_TYPE_QUERY,
                        QueryCommand)
Ejemplo n.º 2
0
        self.data = DumpData.get_dump(device_name=self.device_name,
                                      segment=self.segment,
                                      vHCAid=self.vHCAid,
                                      index1=self.index1,
                                      index2=self.index2,
                                      numOfObj1=self.numOfObj1,
                                      numOfObj2=self.numOfObj2,
                                      depth=self.depth,
                                      bin=self.bin)

    def print_data(self):
        """call the data printer with the right configuration for print the dump data to
        screen or in a binary format (choosed by the user).
        """
        DataPrinter.print_dump_data(self.data, self.bin)

    def validate(self):
        """call the capability validator and check if the core dump supported by the FW.
        """
        validation_status = False

        if CapabilityValidator.validate():
            validation_status = True
        else:
            print("resource dump register is not supported by FW")

        return validation_status


CommandFactory.register(cs.RESOURCE_DUMP_COMMAND_TYPE_DUMP, DumpCommand)