def test_ansible_playbook_with_dict_sources(self, foo): foo.return_value = ('output', 'error', 'return_code') with self.assertRaises(NonRecoverableError): run( self.playbook_path, mock_sources_dict, ctx=ctx)
def test_ansible_playbook_failed(self, foo): foo.return_value = ('output', 'error', 'return_code') with self.assertRaises(NonRecoverableError): run( self.playbook_path, self.hosts_path, ctx=ctx)
def test_ansible_playbook_retry(self, foo): foo.return_value = ('output', 'error', 2) with self.assertRaises(OperationRetry): run( self.playbook_path, self.hosts_path, ctx=ctx)
def test_ansible_playbook_failed(self, foo): foo.side_effect = ProcessException('Unable to run command', -1) with self.assertRaises(NonRecoverableError): run( self.playbook_path, self.hosts_path, ctx=ctx)
def test_ansible_playbook_retry(self, foo): foo.side_effect = ProcessException( 'One or more hosts are unreachable.', 4) with self.assertRaises(OperationRetry): run( self.playbook_path, self.hosts_path, ctx=ctx)
def test_ansible_playbook_failed_sdk(self, foo): foo.side_effect = cloudify_ansible_sdk.CloudifyAnsibleSDKError( "We are failed!") with self.assertRaisesRegexp(NonRecoverableError, "We are failed!"): run( self.playbook_path, self.hosts_path, ctx=ctx)
def test_ansible_playbook_with_dict_sources(self, foo): foo.side_effect = cloudify_ansible_sdk.CloudifyAnsibleSDKError( "We are failed!" ) with self.assertRaises(NonRecoverableError): run( self.playbook_path, mock_sources_dict, ctx=ctx)
def test_zplays(self): run(self.playbook_path, self.hosts_path, ctx=ctx)
def test_ansible_playbook_with_dict_sources(self, foo): foo.return_value = ('output', 'error', 'return_code') with self.assertRaises(NonRecoverableError): run(self.playbook_path, mock_sources_dict, ctx=ctx)
def test_ansible_playbook_retry(self, foo): foo.return_value = ('output', 'error', 2) with self.assertRaises(OperationRetry): run(self.playbook_path, self.hosts_path, ctx=ctx)
def test_ansible_playbook_failed(self, foo): foo.return_value = ('output', 'error', 'return_code') with self.assertRaises(NonRecoverableError): run(self.playbook_path, self.hosts_path, ctx=ctx)
def test_ansible_playbook(self, foo): foo.return_value = ('output', 'error', 0) run(self.playbook_path, self.hosts_path, ctx=ctx)
def test_zplays(self): run( self.playbook_path, self.hosts_path, ctx=ctx)
def test_ansible_playbook(self, foo): foo.return_value = ('output', 'error', 0) run( self.playbook_path, self.hosts_path, ctx=ctx)