def do_unprotect(self, cmdp):
"""
unprotect: remove delete protection
unprotect <container-id or repo/image:tag>
"""
arg = cmdp.get("P1")
if cmdp.missing_options(): # syntax error
return False
if self.localrepo.get_container_id(arg):
if not self.localrepo.unprotect_container(arg):
Msg().err("Error: unprotect container failed")
return False
return True
else:
(imagerepo, tag) = self._check_imagespec(arg)
if imagerepo:
if self.localrepo.unprotect_imagerepo(imagerepo, tag):
return True
Msg().err("Error: unprotect image failed")
return False
评论列表
文章目录