def swap_slots(self):
     try:
         with self._open_device(TRANSPORT.OTP) as dev:
             controller = OtpController(dev.driver)
             controller.swap_slots()
     except YkpersError as e:
         return e.errno
示例#2
0
 def swap_slots(self):
     try:
         with self._open_device(TRANSPORT.OTP) as dev:
             controller = OtpController(dev.driver)
             controller.swap_slots()
         return {'success': True, 'error': None}
     except YkpersError as e:
         if e.errno == 3:
             return {'success': False, 'error': 'write error'}
         return {'success': False, 'error': str(e)}
     except Exception as e:
         return {'success': False, 'error': str(e)}