code: def _lock(self):
          
          if not self.locked:
              try:
                  self.device.cu.lock()
                  self.locked = True
              except JnprLockError as jle:
                  raise LockError(py23_compat.text_type(jle))
docs: Lock the config DB.