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