# -*- coding: utf-8 -*-
from ppms.migration.packet import *
from . import DEFAULT_CUSTOMIZING_DEPENDENCY


class ChangeSAPStatusLength(ChangeDTPPacket):
    '''Change the DF-Length of the SAP Status DI from 1 to 2'''
    version = 1
    done_after_success = True
    run_on_startup = True
    category = PacketCategory.CATEGORY_MANDATORY
    wi_number = 12319

    def get_dependencies(self):
        return DEFAULT_CUSTOMIZING_DEPENDENCY

    def fix(self, runner):
        record = self.get_record(412, ['060750'], ['df_length'])
        if not self.change_value(record, 'df_length', 1, 2):
            return self.fail()

        return self.success()
