dir = self._instroot + "/tmp")
s.script = s.script.replace("\r", "")
os.write(fd, s.script)
+ if s.interp == '/bin/sh' or s.interp == '/bin/bash':
+ os.write(fd, '\n')
+ os.write(fd, 'exit 0\n')
os.close(fd)
os.chmod(path, 0700)
for item in os.listdir(self._imgdir):
stderr = subprocess.STDOUT)
while p.poll() == None:
msger.info(p.stdout.readline().strip())
+ if p.returncode != 0:
+ raise CreatorError("Failed to execute %%sign script "
+ "with '%s'" % (s.interp))
except OSError, (err, msg):
raise CreatorError("Failed to execute %%sign script "
"with '%s' : %s" % (s.interp, msg))
s.script = s.script.replace("\r", "")
os.write(fd, s.script)
+ if s.interp == '/bin/sh' or s.interp == '/bin/bash':
+ os.write(fd, '\n')
+ os.write(fd, 'exit 0\n')
os.close(fd)
os.chmod(path, 0700)
end_time = time.time()
if (end_time - start_time)/60 > MAX_RUN_TIME:
raise CreatorError("Your post script is executed more than "+MAX_RUN_TIME+"mins, please check it!")
+ if p.returncode != 0:
+ raise CreatorError("Failed to execute %%post script "
+ "with '%s'" % (s.interp))
except OSError, (err, msg):
raise CreatorError("Failed to execute %%post script "
"with '%s' : %s" % (s.interp, msg))