def dumps(self):
        nvram_text = NVRAM_TEMPLATE
        fstab_channels = []
        for i, (zvm_image, mount_point, access) in enumerate(
                self.processed_images, start=1):
            device = '/dev/%s.%s' % (i, path.basename(zvm_image))
            fstab_channel = (
                'channel=%(device)s,mountpoint=%(mount_point)s,'
                'access=%(access)s,removable=no'
                % dict(device=device, mount_point=mount_point, access=access)
            )
            fstab_channels.append(fstab_channel)

        mapping = ''
        if sys.stdin.isatty():
            mapping += 'channel=/dev/stdin,mode=char\n'
        if sys.stdout.isatty():
            mapping += 'channel=/dev/stdout,mode=char\n'
        if sys.stderr.isatty():
            mapping += 'channel=/dev/stderr,mode=char\n'

        # When ZRT presents a program with its argv, it parses the
        # nvram file. This parser is very simple. It will choke on ','
        # (it treats comma the same as newline) and it will split the
        # command line on ' '. We must therefore escape each argument
        # individually before joining them.
        args = ' '.join(map(_nvram_escape, self.program_args))

        nvram_text %= dict(
            args=args,
            fstab='\n'.join(fstab_channels),
            mapping=mapping,
            env='\n'.join([]),
        )

        if self.env is not None:
            nvram_text += '[env]\n'
            for k, v in self.env.items():
                nvram_text += 'name=%s,value=%s\n' % (k, _nvram_escape(v))
        if self.debug_verbosity is not None:
            nvram_text += '[debug]\nverbosity=%s\n' % self.debug_verbosity

        return nvram_text
Generate the text for an nvram file.
dataset/ETHPy150Open zerovm/zerovm-cli/zvshlib/zvsh.py/NVRAM.dumps