Example #1
0
    def write_fdu_error(self, fdu_uuid, instance_uuid, errno, errmsg):
        '''
        Writes the given error for the given FDU instance in YAKS

        parameters
        ----------
        fdu_uuid : string
            UUID of the FDU
        instance_uuid : string
            UUID of the instance
        errno : int
            Error number
        errmsg : string
            Error message
        '''
        record = self.connector.loc.actual.get_node_fdu(
            self.node, self.uuid, fdu_uuid, instance_uuid)
        if record is None:
            record = self.connector.loc.desired.get_node_fdu(
                self.node, self.uuid, fdu_uuid, instance_uuid)
        record = InfraFDU(record)
        record.set_status('ERROR')
        record.set_error_code(errno)
        record.set_error_msg('{}'.format(errmsg))
        self.connector.loc.actual.add_node_fdu(self.node, self.uuid, fdu_uuid,
                                               instance_uuid, record.to_json())
Example #2
0
 def write_fdu_error(self, fdu_uuid, instance_uuid, errno, errmsg):
     record = self.connector.loc.actual.get_node_fdu(
         self.node, self.uuid, fdu_uuid, instance_uuid)
     if record is None:
         record = self.connector.loc.desired.get_node_fdu(
             self.node, self.uuid, fdu_uuid, instance_uuid)
     record = InfraFDU(record)
     record.set_status('ERROR')
     record.set_error_code(errno)
     record.set_error_msg('{}'.format(errmsg))
     self.connector.loc.actual.add_node_fdu(self.node, self.uuid, fdu_uuid,
                                            instance_uuid, record.to_json())