(self, container_id)
return(container_dir, container_json)
Load container metadata from container JSON payload
Load container metadata from container JSON payload
Load container metadata from container JSON payload
def _run_load_metadata(self, container_id):
        """Load container metadata from container JSON payload"""
        # get container metadata unless we are dealing with a simple directory
        # tree in which case we don't have metadata
        if Config.conf['location']:
            container_dir = ""
            container_json = []
        else:
            container_structure = \
                ContainerStructure(self.localrepo, container_id)
            (container_dir, container_json) = \
                container_structure.get_container_attr()
            if not container_dir:
                return(None, None)
            # load metadata from container
            if not self.opt["nometa"]:
                if not self.opt["user"]:
                    self.opt["user"] = \
                        container_structure.get_container_meta(
                            "User", "", container_json)
                if not self.opt["cwd"]:
                    self.opt["cwd"] = \
                        container_structure.get_container_meta(
                            "WorkingDir", "", container_json)
                if not self.opt["hostname"]:
                    self.opt["hostname"] = \
                        container_structure.get_container_meta(
                            "Hostname", "", container_json)
                if not self.opt["domain"]:
                    self.opt["domain"] = \
                        container_structure.get_container_meta(
                            "Domainname", "", container_json)
                if self.opt["entryp"] is False:
                    self.opt["entryp"] = \
                        container_structure.get_container_meta(
                            "Entrypoint", [], container_json)
                    if not self.opt["cmd"]:
                        self.opt["cmd"] = \
                            container_structure.get_container_meta(
                                "Cmd", [], container_json)
                elif not self.opt["entryp"]:
                    self.opt["entryp"] = []
                else:
                    if isinstance(self.opt["entryp"], str):
                        self.opt["entryp"] = \
                            self.opt["entryp"].strip().split(' ')
                self.opt["Volumes"] = \
                    container_structure.get_container_meta(
                        "Volumes", [], container_json)
                self.opt["portsexp"].extend(
                    container_structure.get_container_meta(
                        "ExposedPorts", [], container_json))
                self.opt["env"].extendif(
                    container_structure.get_container_meta(
                        "Env", [], container_json))
        return(container_dir, container_json)
def _run_load_metadata ( self , container_id ) : # get container metadata unless we are dealing with a simple directory # tree in which case we don't have metadata if Config . conf [ 'location' ] : container_dir = "" container_json = [ ] else : container_structure = ContainerStructure ( self . localrepo , container_id ) ( container_dir , container_json ) = container_structure . get_container_attr ( ) if not container_dir : return ( None , None ) # load metadata from container if not self . opt [ "nometa" ] : if not self . opt [ "user" ] : self . opt [ "user" ] = container_structure . get_container_meta ( "User" , "" , container_json ) if not self . opt [ "cwd" ] : self . opt [ "cwd" ] = container_structure . get_container_meta ( "WorkingDir" , "" , container_json ) if not self . opt [ "hostname" ] : self . opt [ "hostname" ] = container_structure . get_container_meta ( "Hostname" , "" , container_json ) if not self . opt [ "domain" ] : self . opt [ "domain" ] = container_structure . get_container_meta ( "Domainname" , "" , container_json ) if self . opt [ "entryp" ] is False : self . opt [ "entryp" ] = container_structure . get_container_meta ( "Entrypoint" , [ ] , container_json ) if not self . opt [ "cmd" ] : self . opt [ "cmd" ] = container_structure . get_container_meta ( "Cmd" , [ ] , container_json ) elif not self . opt [ "entryp" ] : self . opt [ "entryp" ] = [ ] else : if isinstance ( self . opt [ "entryp" ] , str ) : self . opt [ "entryp" ] = self . opt [ "entryp" ] . strip ( ) . split ( ' ' ) self . opt [ "Volumes" ] = container_structure . get_container_meta ( "Volumes" , [ ] , container_json ) self . opt [ "portsexp" ] . extend ( container_structure . get_container_meta ( "ExposedPorts" , [ ] , container_json ) ) self . opt [ "env" ] . extendif ( container_structure . get_container_meta ( "Env" , [ ] , container_json ) ) return ( container_dir , container_json )