def start_interactive_shell(self): command = list(self.command) command.extend(( '--shell', self.distro, )) return call(command)
def update(self): command = list(self.command) command.extend(( '--update', '--distribution', self.distro, )) command.extend(self.extra_options) return call(command)
def execute_scripts(self, scripts): command = list(self.command) for script in scripts: command.extend(( '--execute-script', script, self.distro, )) return call(command)
def create(self, extra_packages=None): command = list(self.command) if extra_packages: command.append(('--extrapackages', ','.join(extra_packages))) command.extend(( '--create', '--distribution', self.distro, )) command.extend(self.extra_options) return call(command)
def execute_script(self, script): if os.path.exists(self.basetgz): self.update() else: self.create() command = list(self.command) command.append('--execute', ) command.extend(self.extra_options) command.extend(( '--', script, )) return call(command)
def create(self, extra_packages=None): command = list(self.command) if extra_packages: command.append(( '--extrapackages', ','.join(extra_packages) )) command.extend(( '--create', '--distribution', self.distro, )) command.extend(self.extra_options) return call(command)
def execute_script(self, script): if os.path.exists(self.basetgz): self.update() else: self.create() command = list(self.command) command.append( '--execute', ) command.extend(self.extra_options) command.extend(( '--', script, )) return call(command)
def start_interactive_shell(self): command = list(self.command) command.append('--login') command.extend(self.extra_options) return call(command)
def execute_scripts(self, scripts): command = list(self.command) command = self.add_mock_script(scripts=scripts, command=command) command.append(self.distro) return call(command)
def start_interactive_shell(self, script=None): command = list(self.command) if script: command = self.add_mock_script(scripts=[script], command=command) command.extend(('--shell', self.distro)) return call(command)