Revision 4a2fd05c

b/image_creator/os_type/__init__.py
120 120
        wrapper = textwrap.TextWrapper()
121 121
        wrapper.subsequent_indent = '\t'
122 122
        wrapper.initial_indent = '\t'
123
        wrapper.width = 72
123 124

  
124 125
        output("Enabled system preperation operations:")
125 126
        if len(enabled) == 0:
......
127 128
        else:
128 129
            for sysprep in enabled:
129 130
                name = sysprep.__name__.replace('_', '-')
130
                descr = wrapper.fill(sysprep.__doc__)
131
                descr = wrapper.fill(textwrap.dedent(sysprep.__doc__))
131 132
                output('    %s:\n%s\n' % (name, descr))
132 133

  
133 134
        output("Disabled system preperation operations:")
......
136 137
        else:
137 138
            for sysprep in disabled:
138 139
                name = sysprep.__name__.replace('_', '-')
139
                descr = wrapper.fill(sysprep.__doc__)
140
                descr = wrapper.fill(textwrap.dedent(sysprep.__doc__))
140 141
                output('    %s:\n%s\n' % (name, descr))
141 142

  
142 143
    @add_prefix
b/image_creator/os_type/linux.py
126 126
            self.g.rm(rule_file)
127 127

  
128 128
    @sysprep()
129
    def remove_swap_entry(self, print_header=True):
130
        """Remove swap entry from /etc/fstab. If swap is the last partition
131
        then the partition will be removed when shrinking is performed. If the
132
        swap partition is not the last partition in the disk or if you are not
133
        going to shrink the image you should probably disable this.
134
        """
135

  
136
        if print_header:
137
            output('Removing swap entry from fstab')
138

  
139
        new_fstab = ""
140
        fstab = self.g.cat('/etc/fstab')
141
        for line in fstab.splitlines():
142

  
143
            entry = line.split('#')[0].strip().split()
144
            if len(entry) == 6 and entry[2] == 'swap':
145
                continue
146

  
147
            new_fstab += "%s\n" % line
148

  
149
        self.g.write('/etc/fstab', new_fstab)
150

  
151
    @sysprep()
129 152
    def persistent_devs(self, print_header=True):
130 153
        """Scan fstab & grub configuration files and replace all non-persistent
131 154
        device appearences with UUIDs.

Also available in: Unified diff