(self, cmdp)
return self.STATUS_ERROR
inspect: print container metadata JSON from an imagerepo or container
        inspect <container-id or repo/image:tag>
        -p                         :print container directory path on host
inspect: print container metadata JSON from an imagerepo or container
        inspect <container-id or repo/image:tag>
        -p                         :print container directory path on host
inspect : print container metadata JSON from an imagerepo or container inspect <container - id or repo / image : tag > - p : print container directory path on host
def do_inspect(self, cmdp):
        """
        inspect: print container metadata JSON from an imagerepo or container
        inspect <container-id or repo/image:tag>
        -p                         :print container directory path on host
        """
        container_or_image = cmdp.get("P1")
        container_id = self.localrepo.get_container_id(container_or_image)
        print_dir = cmdp.get("-p")
        if cmdp.missing_options():               # syntax error
            return self.STATUS_ERROR

        if container_id:
            (container_dir, container_json) = ContainerStructure(
                self.localrepo, container_id).get_container_attr()
        else:
            (imagerepo, tag) = self._check_imagespec(container_or_image)
            if self.localrepo.cd_imagerepo(imagerepo, tag):
                (container_json, dummy) = self.localrepo.get_image_attributes()
            else:
                Msg().err("Error: image not found", imagerepo)
                return self.STATUS_ERROR

        if print_dir:
            if container_id and container_dir:
                Msg().out(str(container_dir) + "/ROOT")
                return self.STATUS_OK
        elif container_json:
            try:
                Msg().out(json.dumps(container_json, sort_keys=True,
                                     indent=4, separators=(',', ': ')))
            except (IOError, OSError, AttributeError, ValueError, TypeError):
                Msg().out(container_json)
            return self.STATUS_OK

        Msg().err("Error: image or container not found", container_or_image)
        return self.STATUS_ERROR
def do_inspect ( self , cmdp ) : container_or_image = cmdp . get ( "P1" ) container_id = self . localrepo . get_container_id ( container_or_image ) print_dir = cmdp . get ( "-p" ) if cmdp . missing_options ( ) : # syntax error return self . STATUS_ERROR if container_id : ( container_dir , container_json ) = ContainerStructure ( self . localrepo , container_id ) . get_container_attr ( ) else : ( imagerepo , tag ) = self . _check_imagespec ( container_or_image ) if self . localrepo . cd_imagerepo ( imagerepo , tag ) : ( container_json , dummy ) = self . localrepo . get_image_attributes ( ) else : Msg ( ) . err ( "Error: image not found" , imagerepo ) return self . STATUS_ERROR if print_dir : if container_id and container_dir : Msg ( ) . out ( str ( container_dir ) + "/ROOT" ) return self . STATUS_OK elif container_json : try : Msg ( ) . out ( json . dumps ( container_json , sort_keys = True , indent = 4 , separators = ( ',' , ': ' ) ) ) except ( IOError , OSError , AttributeError , ValueError , TypeError ) : Msg ( ) . out ( container_json ) return self . STATUS_OK Msg ( ) . err ( "Error: image or container not found" , container_or_image ) return self . STATUS_ERROR