(self)
set uid and gid mappings
set uid and gid mappings
set uid and gid mappings
def _set_id_mappings(self):
        """set uid and gid mappings"""
        json_obj = self._container_specjson
        if "uidMappings" in json_obj["linux"]:
            for idmap in json_obj["linux"]["uidMappings"]:
                if "hostID" in idmap:
                    idmap["hostID"] = HostInfo.uid
        else:
            json_obj["linux"]["uidMappings"] = [ \
                    {"containerID": 0, "hostID": HostInfo.uid, "size":1, }, ]
        if "gidMappings" in json_obj["linux"]:
            for idmap in json_obj["linux"]["gidMappings"]:
                if "hostID" in idmap:
                    idmap["hostID"] = HostInfo.gid
        else:
            json_obj["linux"]["gidMappings"] = [ \
                    {"containerID": 0, "hostID": HostInfo.gid, "size":1, }, ]
def _set_id_mappings ( self ) : json_obj = self . _container_specjson if "uidMappings" in json_obj [ "linux" ] : for idmap in json_obj [ "linux" ] [ "uidMappings" ] : if "hostID" in idmap : idmap [ "hostID" ] = HostInfo . uid else : json_obj [ "linux" ] [ "uidMappings" ] = [ { "containerID" : 0 , "hostID" : HostInfo . uid , "size" : 1 , } , ] if "gidMappings" in json_obj [ "linux" ] : for idmap in json_obj [ "linux" ] [ "gidMappings" ] : if "hostID" in idmap : idmap [ "hostID" ] = HostInfo . gid else : json_obj [ "linux" ] [ "gidMappings" ] = [ { "containerID" : 0 , "hostID" : HostInfo . gid , "size" : 1 , } , ]