(self)
return json_obj
Set spec values
Set spec values
Set spec values
def _set_spec(self):
        """Set spec values"""
        json_obj = self._container_specjson
        json_obj["root"]["path"] = os.path.realpath(self.container_root)
        json_obj["root"]["readonly"] = False
        if '.' in self.opt["hostname"]:
            json_obj["hostname"] = self.opt["hostname"]
        else:
            json_obj["hostname"] = platform.node()

        if self.opt["cwd"]:
            json_obj["process"]["cwd"] = self.opt["cwd"]

        json_obj["process"]["terminal"] = sys.stdout.isatty()
        if self.engine_type == "crun":
            json_obj["process"]["terminal"] = False

        json_obj["process"]["env"] = []
        for (env_key, env_val) in self.opt["env"]:
            json_obj["process"]["env"].append("%s=%s" % (env_key, env_val))

        json_obj["process"]["args"] = self.opt["cmd"]
        return json_obj
def _set_spec ( self ) : json_obj = self . _container_specjson json_obj [ "root" ] [ "path" ] = os . path . realpath ( self . container_root ) json_obj [ "root" ] [ "readonly" ] = False if '.' in self . opt [ "hostname" ] : json_obj [ "hostname" ] = self . opt [ "hostname" ] else : json_obj [ "hostname" ] = platform . node ( ) if self . opt [ "cwd" ] : json_obj [ "process" ] [ "cwd" ] = self . opt [ "cwd" ] json_obj [ "process" ] [ "terminal" ] = sys . stdout . isatty ( ) if self . engine_type == "crun" : json_obj [ "process" ] [ "terminal" ] = False json_obj [ "process" ] [ "env" ] = [ ] for ( env_key , env_val ) in self . opt [ "env" ] : json_obj [ "process" ] [ "env" ] . append ( "%s=%s" % ( env_key , env_val ) ) json_obj [ "process" ] [ "args" ] = self . opt [ "cmd" ] return json_obj