def sync_mic(bootstrap, binpth = '/usr/bin/mic',
libpth='/usr/lib',
plugin='/usr/lib/mic/plugins',
- pylib = '/usr/lib/python2.7/site-packages',
+ pylib = '/usr/lib/python3/site-packages',
conf = '/etc/mic/mic.conf'):
_path = lambda p: os.path.join(bootstrap, p.lstrip('/'))
raise errors.BootstrapError(err)
# auto select backend
- conf_str = file(_path(conf)).read()
+ conf_str = open(_path(conf)).read()
conf_str = re.sub("pkgmgr\s*=\s*.*", "pkgmgr=auto", conf_str)
with open(_path(conf), 'w') as wf:
wf.write(conf_str)
# chmod +x /usr/bin/mic
os.chmod(_path(binpth), 0o777)
- # correct python interpreter
- mic_cont = file(_path(binpth)).read()
- mic_cont = "#!/usr/bin/python3\n" + mic_cont
- with open(_path(binpth), 'w') as wf:
- wf.write(mic_cont)
-
-
def safecopy(src, dst, symlinks=False, ignore_ptns=()):
if os.path.isdir(src):
if os.path.isdir(dst):