273
273
def configure_face(self):
274
274
PHOTO_PATH = '/var/lib/ubiquity/webcam_photo.png'
275
275
target_user = self.db.get('passwd/username')
276
uid = subprocess.Popen(['chroot', self.target, 'sudo', '-u',
277
target_user, '--', 'id', '-u'], stdout=subprocess.PIPE)
276
uid = subprocess.Popen(
277
['chroot', self.target, 'sudo', '-u', target_user, '--',
278
'id', '-u'], stdout=subprocess.PIPE, universal_newlines=True)
278
279
uid = uid.communicate()[0].strip('\n')
279
gid = subprocess.Popen(['chroot', self.target, 'sudo', '-u',
280
target_user, '--', 'id', '-g'], stdout=subprocess.PIPE)
280
gid = subprocess.Popen(
281
['chroot', self.target, 'sudo', '-u', target_user, '--',
282
'id', '-g'], stdout=subprocess.PIPE, universal_newlines=True)
281
283
gid = gid.communicate()[0].strip('\n')
321
323
# Modules provided by the core Debian Python packages.
322
324
default = subprocess.Popen(
323
325
['chroot', self.target, 'pyversions', '-d'],
324
stdout=subprocess.PIPE).communicate()[0].rstrip('\n')
326
stdout=subprocess.PIPE,
327
universal_newlines=True).communicate()[0].rstrip('\n')
326
329
install_misc.chrex(self.target, default, '-m', 'compileall',
327
330
'/usr/share/python/')
341
344
if osextras.find_on_path_root(self.target, 'pyversions'):
342
345
supported = subprocess.Popen(
343
346
['chroot', self.target, 'pyversions', '-s'],
344
stdout=subprocess.PIPE).communicate()[0].rstrip('\n')
347
stdout=subprocess.PIPE,
348
universal_newlines=True).communicate()[0].rstrip('\n')
345
349
for python in supported.split():
347
351
cachedpython = cache['%s-minimal' % python]
362
366
if osextras.find_on_path_root(self.target, 'py3versions'):
363
367
supported = subprocess.Popen(
364
368
['chroot', self.target, 'py3versions', '-s'],
365
stdout=subprocess.PIPE).communicate()[0].rstrip('\n')
369
stdout=subprocess.PIPE,
370
universal_newlines=True).communicate()[0].rstrip('\n')
366
371
for python in supported.split():
368
373
cachedpython = cache['%s-minimal' % python]
857
862
resume_uuid = subprocess.Popen(
858
863
['block-attr', '--uuid', resume],
859
stdout=subprocess.PIPE).communicate()[0].rstrip('\n')
864
stdout=subprocess.PIPE,
865
universal_newlines=True).communicate()[0].rstrip('\n')
1226
1232
inst_composite = ['chroot', self.target, 'jockey-text',
1227
1233
'-C', '--no-dbus', '-k', self.kernel_version]
1228
1234
p = subprocess.Popen(inst_composite, stdin=subprocess.PIPE,
1229
stdout=sys.stderr, env=env)
1235
stdout=sys.stderr, env=env,
1236
universal_newlines=True)
1230
1237
p.communicate('y\n')
1231
1238
except OSError:
1232
1239
syslog.syslog(syslog.LOG_WARNING,
1630
1637
'/usr/lib/gnome-settings-daemon/'
1631
1638
'gnome-update-wallpaper-cache'])
1632
1639
# copy to targeted user
1633
uid = subprocess.Popen(['chroot', self.target, 'sudo', '-u',
1634
target_user, '--', 'id', '-u'],
1635
stdout=subprocess.PIPE).communicate()[0].strip('\n')
1636
gid = subprocess.Popen(['chroot', self.target, 'sudo', '-u',
1637
target_user, '--', 'id', '-g'],
1638
stdout=subprocess.PIPE).communicate()[0].strip('\n')
1640
uid = subprocess.Popen(
1641
['chroot', self.target, 'sudo', '-u', target_user, '--',
1643
stdout=subprocess.PIPE,
1644
universal_newlines=True).communicate()[0].strip('\n')
1645
gid = subprocess.Popen(
1646
['chroot', self.target, 'sudo', '-u', target_user, '--',
1648
stdout=subprocess.PIPE,
1649
universal_newlines=True).communicate()[0].strip('\n')
1641
1652
self.copy_tree(casper_user_wallpaper_cache_dir,