Esempio n. 1
0
 def __call_script(self, name):
     if os.path.exists(self.root_dir + '/image/' + name):
         config_script = Command.call(
             ['chroot', self.root_dir, 'bash', '/image/' + name]
         )
         process = CommandProcess(
             command=config_script, log_topic='Calling ' + name + ' script'
         )
         result = process.poll_and_watch()
         if result.returncode != 0:
             raise KiwiScriptFailed(
                 '%s failed: %s' % (name, format(result.stderr))
             )
Esempio n. 2
0
 def __call_script_no_chroot(self, name, option_list):
     if os.path.exists(self.root_dir + '/image/' + name):
         bash_command = [
             'cd', self.root_dir, '&&',
             'bash', '--norc', 'image/' + name, ' '.join(option_list)
         ]
         config_script = Command.call(
             ['bash', '-c', ' '.join(bash_command)]
         )
         process = CommandProcess(
             command=config_script, log_topic='Calling ' + name + ' script'
         )
         result = process.poll_and_watch()
         if result.returncode != 0:
             raise KiwiScriptFailed(
                 '%s failed: %s' % (name, format(result.stderr))
             )