(self, param, default, container_json)
return default
Get the container metadata from the container
Get the container metadata from the container
Get the container metadata from the container
def get_container_meta(self, param, default, container_json):
        """Get the container metadata from the container"""
        confidx = ""
        if "config" in container_json:
            confidx = "config"
        elif "container_config" in container_json:
            confidx = "container_config"
        if container_json[confidx]  and param in container_json[confidx]:
            if container_json[confidx][param] is None:
                pass
            elif (is_genstr(container_json[confidx][param]) and
                  (isinstance(default, (list, tuple)))):
                return container_json[confidx][param].strip().split()
            elif (is_genstr(default) and (
                    isinstance(container_json[confidx][param], (list, tuple)))):
                return " ".join(container_json[confidx][param])
            elif (is_genstr(default) and (
                    isinstance(container_json[confidx][param], dict))):
                return self._dict_to_str(container_json[confidx][param])
            elif (isinstance(default, list) and (
                    isinstance(container_json[confidx][param], dict))):
                return self._dict_to_list(container_json[confidx][param])
            else:
                return container_json[confidx][param]
        return default
def get_container_meta ( self , param , default , container_json ) : confidx = "" if "config" in container_json : confidx = "config" elif "container_config" in container_json : confidx = "container_config" if container_json [ confidx ] and param in container_json [ confidx ] : if container_json [ confidx ] [ param ] is None : pass elif ( is_genstr ( container_json [ confidx ] [ param ] ) and ( isinstance ( default , ( list , tuple ) ) ) ) : return container_json [ confidx ] [ param ] . strip ( ) . split ( ) elif ( is_genstr ( default ) and ( isinstance ( container_json [ confidx ] [ param ] , ( list , tuple ) ) ) ) : return " " . join ( container_json [ confidx ] [ param ] ) elif ( is_genstr ( default ) and ( isinstance ( container_json [ confidx ] [ param ] , dict ) ) ) : return self . _dict_to_str ( container_json [ confidx ] [ param ] ) elif ( isinstance ( default , list ) and ( isinstance ( container_json [ confidx ] [ param ] , dict ) ) ) : return self . _dict_to_list ( container_json [ confidx ] [ param ] ) else : return container_json [ confidx ] [ param ] return default