Revision 091c0335 image_creator/os_type/freebsd.py
b/image_creator/os_type/freebsd.py | ||
---|---|---|
49 | 49 |
|
50 | 50 |
master_passwd = [] |
51 | 51 |
|
52 |
for line in self.g.cat('/etc/master.passwd').splitlines(): |
|
52 |
for line in self.image.g.cat('/etc/master.passwd').splitlines():
|
|
53 | 53 |
|
54 | 54 |
# Check for empty or comment lines |
55 | 55 |
if len(line.split('#')[0]) == 0: |
... | ... | |
62 | 62 |
|
63 | 63 |
master_passwd.append(":".join(fields)) |
64 | 64 |
|
65 |
self.g.write('/etc/master.passwd', "\n".join(master_passwd) + '\n') |
|
65 |
self.image.g.write( |
|
66 |
'/etc/master.passwd', "\n".join(master_passwd) + '\n') |
|
66 | 67 |
|
67 | 68 |
# Make sure no one can login on the system |
68 |
self.g.rm_rf('/etc/spwd.db') |
|
69 |
self.image.g.rm_rf('/etc/spwd.db')
|
|
69 | 70 |
|
70 | 71 |
def _do_collect_metadata(self): |
71 | 72 |
"""Collect metadata about the OS""" |
... | ... | |
88 | 89 |
'^([^:]+):((?:![^:]+)|(?:[^!*][^:]+)|):(?:[^:]*:){7}(?:[^:]*)' |
89 | 90 |
) |
90 | 91 |
|
91 |
for line in self.g.cat('/etc/master.passwd').splitlines(): |
|
92 |
for line in self.image.g.cat('/etc/master.passwd').splitlines():
|
|
92 | 93 |
line = line.split('#')[0] |
93 | 94 |
match = regexp.match(line) |
94 | 95 |
if not match: |
... | ... | |
120 | 121 |
group3 = int(match.group(3)) |
121 | 122 |
dev = '/dev/sd%c%d' % (chr(ord('a') + group2), group3) |
122 | 123 |
try: |
123 |
self.g.mount_vfs(mopts, 'ufs', dev, mp) |
|
124 |
self.image.g.mount_vfs(mopts, 'ufs', dev, mp)
|
|
124 | 125 |
except RuntimeError as msg: |
125 | 126 |
if mp in critical_mpoints: |
126 | 127 |
self.out.warn('unable to mount %s. Reason: %s' % (mp, msg)) |
Also available in: Unified diff