예제 #1
0
def yum_install_pip(shutit_pexpect_session):
    # https://www.liquidweb.com/kb/how-to-install-pip-on-centos-7/
    shutit_pexpect_session.send(
        ShutItSendSpec(shutit_pexpect_session,
                       send='yum install -y epel-release',
                       loglevel=logging.INFO))
    shutit_pexpect_session.send(
        ShutItSendSpec(shutit_pexpect_session,
                       send='yum -y update',
                       loglevel=logging.INFO))
    shutit_pexpect_session.send(
        ShutItSendSpec(shutit_pexpect_session,
                       send='yum -y install python-pip',
                       loglevel=logging.INFO))
예제 #2
0
    def finalize(self, shutit):
        """Finalizes the target, exiting for us back to the original shell
		and performing any repository work required.
		"""
        # Finish with the target
        target_child_pexpect_session = shutit.get_shutit_pexpect_session_from_id(
            'target_child')
        assert not target_child_pexpect_session.sendline(
            ShutItSendSpec(
                target_child_pexpect_session, 'exit', ignore_background=True))
        host_child_pexpect_session = shutit.get_shutit_pexpect_session_from_id(
            'host_child')
        host_child = host_child_pexpect_session.pexpect_child
        shutit.set_default_shutit_pexpect_session(host_child_pexpect_session)
        shutit.set_default_shutit_pexpect_session_expect(
            shutit.expect_prompts['ORIGIN_ENV'])
        shutit.do_repository_work(
            shutit.repository['name'],
            docker_executable=shutit.host['docker_executable'],
            password=shutit.host['password'])
        # Final exits
        host_child.sendline(
            'rm -f ' + shutit.build['cidfile'])  # Ignore response, just send.
        host_child.sendline(
            'exit')  # Exit raw bash. Ignore response, just send.
        return True
	def finalize(self, shutit):
		"""Finalizes the target, exiting for us back to the original shell
		and performing any repository work required.
		"""
		# Finish with the target
		target_child_pexpect_session = shutit.get_shutit_pexpect_session_from_id('target_child')
		assert not target_child_pexpect_session.sendline(ShutItSendSpec(target_child_pexpect_session,'exit',ignore_background=True)), shutit_util.print_debug()
		return True
예제 #4
0
    def finalize(self, shutit):
        """Finalizes the target, exiting for us back to the original shell
		and performing any repository work required.
		"""
        # Finish with the target
        target_child_pexpect_session = shutit.get_shutit_pexpect_session_from_id(
            'target_child')
        assert not target_child_pexpect_session.sendline(
            ShutItSendSpec(target_child_pexpect_session, 'exit', force=True))
        host_child_session = shutit.get_shutit_pexpect_session_from_id(
            'host_child')
        shutit.set_default_shutit_pexpect_session(host_child_session)
        # Final exits
        host_child = host_child_session.pexpect_child
        host_child.sendline('exit')  # Exit raw bash, ignore response.
        return True