# Copyright (c) 2017 StackHPC Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

import unittest

import cliff.app
import cliff.commandmanager
import mock

from kayobe.cli import commands
from kayobe import utils


class TestApp(cliff.app.App):

    def __init__(self):
        super(TestApp, self).__init__(
            description='Test app',
            version='0.1',
            command_manager=cliff.commandmanager.CommandManager('kayobe.cli'))


class TestCase(unittest.TestCase):

    @mock.patch.object(utils, "galaxy_install", spec=True)
    @mock.patch.object(commands.KayobeAnsibleMixin,
                       "run_kayobe_playbooks")
    def test_control_host_bootstrap(self, mock_run, mock_install):
        command = commands.ControlHostBootstrap(TestApp(), [])
        parser = command.get_parser("test")
        parsed_args = parser.parse_args([])
        result = command.run(parsed_args)
        self.assertEqual(0, result)
        mock_install.assert_called_once_with("requirements.yml",
                                             "ansible/roles")
        expected_calls = [
            mock.call(mock.ANY, ["ansible/bootstrap.yml"]),
            mock.call(mock.ANY, ["ansible/kolla-ansible.yml"],
                      tags="install"),
        ]
        self.assertEqual(expected_calls, mock_run.call_args_list)

    @mock.patch.object(utils, "galaxy_install", spec=True)
    @mock.patch.object(commands.KayobeAnsibleMixin,
                       "run_kayobe_playbooks")
    def test_control_host_upgrade(self, mock_run, mock_install):
        command = commands.ControlHostUpgrade(TestApp(), [])
        parser = command.get_parser("test")
        parsed_args = parser.parse_args([])
        result = command.run(parsed_args)
        self.assertEqual(0, result)
        mock_install.assert_called_once_with("requirements.yml",
                                             "ansible/roles", force=True)
        expected_calls = [
            mock.call(mock.ANY, ["ansible/bootstrap.yml"]),
            mock.call(mock.ANY, ["ansible/kolla-ansible.yml"],
                      tags="install"),
        ]
        self.assertEqual(expected_calls, mock_run.call_args_list)

    @mock.patch.object(commands.KayobeAnsibleMixin,
                       "run_kayobe_playbooks")
    def test_network_connectivity_check(self, mock_run):
        command = commands.NetworkConnectivityCheck(TestApp(), [])
        parser = command.get_parser("test")
        parsed_args = parser.parse_args([])
        result = command.run(parsed_args)
        self.assertEqual(0, result)
        expected_calls = [
            mock.call(mock.ANY, ["ansible/network-connectivity.yml"]),
        ]
        self.assertEqual(expected_calls, mock_run.call_args_list)

    @mock.patch.object(commands.KayobeAnsibleMixin,
                       "run_kayobe_config_dump")
    @mock.patch.object(commands.KayobeAnsibleMixin,
                       "run_kayobe_playbooks")
    def test_seed_hypervisor_host_configure(self, mock_run, mock_dump):
        command = commands.SeedHypervisorHostConfigure(TestApp(), [])
        parser = command.get_parser("test")
        parsed_args = parser.parse_args([])
        mock_dump.return_value = "stack"

        result = command.run(parsed_args)
        self.assertEqual(0, result)

        expected_calls = [
            mock.call(mock.ANY, host="seed-hypervisor",
                      var_name="kayobe_ansible_user", tags="dump-config")
        ]
        self.assertEqual(expected_calls, mock_dump.call_args_list)

        expected_calls = [
            mock.call(
                mock.ANY,
                [
                    "ansible/ip-allocation.yml",
                    "ansible/ssh-known-host.yml",
                    "ansible/kayobe-ansible-user.yml",
                    "ansible/kayobe-target-venv.yml",
                    "ansible/users.yml",
                    "ansible/yum.yml",
                    "ansible/dev-tools.yml",
                    "ansible/network.yml",
                    "ansible/sysctl.yml",
                    "ansible/ntp.yml",
                    "ansible/seed-hypervisor-libvirt-host.yml",
                ],
                limit="seed-hypervisor",
            ),
        ]
        self.assertEqual(expected_calls, mock_run.call_args_list)

    @mock.patch.object(commands.KayobeAnsibleMixin,
                       "run_kayobe_playbooks")
    def test_seed_hypervisor_host_upgrade(self, mock_run):
        command = commands.SeedHypervisorHostUpgrade(TestApp(), [])
        parser = command.get_parser("test")
        parsed_args = parser.parse_args([])

        result = command.run(parsed_args)
        self.assertEqual(0, result)

        expected_calls = [
            mock.call(
                mock.ANY,
                [
                    "ansible/kayobe-target-venv.yml",
                    "ansible/kolla-target-venv.yml",
                ],
                limit="seed-hypervisor",
            ),
        ]
        self.assertEqual(expected_calls, mock_run.call_args_list)

    @mock.patch.object(commands.KayobeAnsibleMixin,
                       "run_kayobe_config_dump")
    @mock.patch.object(commands.KayobeAnsibleMixin,
                       "run_kayobe_playbooks")
    @mock.patch.object(commands.KollaAnsibleMixin,
                       "run_kolla_ansible_seed")
    def test_seed_host_configure(self, mock_kolla_run, mock_run, mock_dump):
        command = commands.SeedHostConfigure(TestApp(), [])
        parser = command.get_parser("test")
        parsed_args = parser.parse_args([])
        mock_dump.return_value = {
            "seed": {"kayobe_ansible_user": "stack"}
        }

        result = command.run(parsed_args)
        self.assertEqual(0, result)

        expected_calls = [
            mock.call(mock.ANY, hosts="seed", tags="dump-config")
        ]
        self.assertEqual(expected_calls, mock_dump.call_args_list)

        expected_calls = [
            mock.call(
                mock.ANY,
                [
                    "ansible/ip-allocation.yml",
                    "ansible/ssh-known-host.yml",
                    "ansible/kayobe-ansible-user.yml",
                    "ansible/kayobe-target-venv.yml",
                    "ansible/users.yml",
                    "ansible/yum.yml",
                    "ansible/dev-tools.yml",
                    "ansible/disable-selinux.yml",
                    "ansible/network.yml",
                    "ansible/sysctl.yml",
                    "ansible/ip-routing.yml",
                    "ansible/snat.yml",
                    "ansible/disable-glean.yml",
                    "ansible/ntp.yml",
                    "ansible/lvm.yml",
                ],
                limit="seed",
            ),
            mock.call(
                mock.ANY,
                ["ansible/kolla-ansible.yml"],
                tags="config",
            ),
            mock.call(
                mock.ANY,
                [
                    "ansible/kolla-target-venv.yml",
                    "ansible/kolla-host.yml",
                    "ansible/docker.yml",
                ],
                limit="seed",
            ),
        ]
        self.assertEqual(expected_calls, mock_run.call_args_list)

        expected_calls = [
            mock.call(
                mock.ANY,
                "bootstrap-servers",
                extra_vars={"ansible_user": "stack"},
            ),
        ]
        self.assertEqual(expected_calls, mock_kolla_run.call_args_list)

    @mock.patch.object(commands.KayobeAnsibleMixin,
                       "run_kayobe_config_dump")
    @mock.patch.object(commands.KayobeAnsibleMixin,
                       "run_kayobe_playbooks")
    @mock.patch.object(commands.KollaAnsibleMixin,
                       "run_kolla_ansible_seed")
    def test_seed_host_configure_kayobe_venv(self, mock_kolla_run, mock_run,
                                             mock_dump):
        command = commands.SeedHostConfigure(TestApp(), [])
        parser = command.get_parser("test")
        parsed_args = parser.parse_args([])
        mock_dump.return_value = {
            "seed": {
                "ansible_python_interpreter": "/kayobe/venv/bin/python",
                "kayobe_ansible_user": "stack",
            }
        }

        result = command.run(parsed_args)
        self.assertEqual(0, result)

        expected_calls = [
            mock.call(
                mock.ANY,
                "bootstrap-servers",
                extra_vars={
                    "ansible_python_interpreter": "/kayobe/venv/bin/python",
                    "ansible_user": "stack",
                },
            ),
        ]
        self.assertEqual(expected_calls, mock_kolla_run.call_args_list)

    @mock.patch.object(commands.KayobeAnsibleMixin,
                       "run_kayobe_config_dump")
    @mock.patch.object(commands.KayobeAnsibleMixin,
                       "run_kayobe_playbooks")
    @mock.patch.object(commands.KollaAnsibleMixin,
                       "run_kolla_ansible_seed")
    def test_seed_host_configure_kolla_venv(self, mock_kolla_run, mock_run,
                                            mock_dump):
        command = commands.SeedHostConfigure(TestApp(), [])
        parser = command.get_parser("test")
        parsed_args = parser.parse_args([])
        mock_dump.return_value = {
            "seed": {
                "kayobe_ansible_user": "stack",
                "kolla_ansible_target_venv": "/kolla/venv/bin/python",
            }
        }

        result = command.run(parsed_args)
        self.assertEqual(0, result)

        expected_calls = [
            mock.call(
                mock.ANY,
                "bootstrap-servers",
                extra_vars={
                    "ansible_python_interpreter": "/usr/bin/python",
                    "ansible_user": "stack",
                    "virtualenv": "/kolla/venv/bin/python",
                },
            ),
        ]
        self.assertEqual(expected_calls, mock_kolla_run.call_args_list)

    @mock.patch.object(commands.KayobeAnsibleMixin,
                       "run_kayobe_config_dump")
    @mock.patch.object(commands.KayobeAnsibleMixin,
                       "run_kayobe_playbooks")
    @mock.patch.object(commands.KollaAnsibleMixin,
                       "run_kolla_ansible_seed")
    def test_seed_host_configure_both_venvs(self, mock_kolla_run, mock_run,
                                            mock_dump):
        command = commands.SeedHostConfigure(TestApp(), [])
        parser = command.get_parser("test")
        parsed_args = parser.parse_args([])
        mock_dump.return_value = {
            "seed": {
                "ansible_python_interpreter": "/kayobe/venv/bin/python",
                "kayobe_ansible_user": "stack",
                "kolla_ansible_target_venv": "/kolla/venv/bin/python",
            }
        }

        result = command.run(parsed_args)
        self.assertEqual(0, result)

        expected_calls = [
            mock.call(
                mock.ANY,
                "bootstrap-servers",
                extra_vars={
                    "ansible_python_interpreter": "/kayobe/venv/bin/python",
                    "ansible_user": "stack",
                    "virtualenv": "/kolla/venv/bin/python",
                },
            ),
        ]
        self.assertEqual(expected_calls, mock_kolla_run.call_args_list)

    @mock.patch.object(commands.KayobeAnsibleMixin,
                       "run_kayobe_playbooks")
    def test_seed_host_upgrade(self, mock_run):
        command = commands.SeedHostUpgrade(TestApp(), [])
        parser = command.get_parser("test")
        parsed_args = parser.parse_args([])

        result = command.run(parsed_args)
        self.assertEqual(0, result)

        expected_calls = [
            mock.call(
                mock.ANY,
                [
                    "ansible/kayobe-target-venv.yml",
                    "ansible/kolla-target-venv.yml",
                ],
                limit="seed",
            ),
        ]
        self.assertEqual(expected_calls, mock_run.call_args_list)

    @mock.patch.object(commands.KayobeAnsibleMixin,
                       "run_kayobe_playbooks")
    def test_seed_container_image_build(self, mock_run):
        command = commands.SeedContainerImageBuild(TestApp(), [])
        parser = command.get_parser("test")
        parsed_args = parser.parse_args([])
        result = command.run(parsed_args)
        self.assertEqual(0, result)
        expected_calls = [
            mock.call(
                mock.ANY,
                [
                    "ansible/container-image-builders-check.yml",
                    "ansible/kolla-build.yml",
                    "ansible/container-image-build.yml"
                ],
                extra_vars={
                    "container_image_sets": (
                        "{{ seed_container_image_sets }}"),
                    "push_images": False,
                }
            ),
        ]
        self.assertEqual(expected_calls, mock_run.call_args_list)

    @mock.patch.object(commands.KayobeAnsibleMixin,
                       "run_kayobe_playbooks")
    def test_seed_container_image_build_with_regex(self, mock_run):
        command = commands.SeedContainerImageBuild(TestApp(), [])
        parser = command.get_parser("test")
        parsed_args = parser.parse_args(["--push", "^regex1$", "^regex2$"])
        result = command.run(parsed_args)
        self.assertEqual(0, result)
        expected_calls = [
            mock.call(
                mock.ANY,
                [
                    "ansible/container-image-builders-check.yml",
                    "ansible/kolla-build.yml",
                    "ansible/container-image-build.yml"
                ],
                extra_vars={
                    "container_image_regexes": "'^regex1$ ^regex2$'",
                    "push_images": True,
                }
            ),
        ]
        self.assertEqual(expected_calls, mock_run.call_args_list)

    @mock.patch.object(commands.KayobeAnsibleMixin,
                       "run_kayobe_playbooks")
    @mock.patch.object(commands.KollaAnsibleMixin,
                       "run_kolla_ansible_seed")
    def test_service_deploy(self, mock_kolla_run, mock_run):
        command = commands.SeedServiceDeploy(TestApp(), [])
        parser = command.get_parser("test")
        parsed_args = parser.parse_args([])

        result = command.run(parsed_args)
        self.assertEqual(0, result)

        expected_calls = [
            mock.call(
                mock.ANY,
                ["ansible/kolla-ansible.yml"],
                tags="config",
            ),
            mock.call(
                mock.ANY,
                ["ansible/kolla-bifrost.yml"],
            ),
            mock.call(
                mock.ANY,
                [
                    "ansible/overcloud-host-image-workaround-resolv.yml",
                    "ansible/seed-introspection-rules.yml",
                    "ansible/dell-switch-bmp.yml",
                ],
            ),
        ]
        self.assertEqual(expected_calls, mock_run.call_args_list)

        expected_calls = [
            mock.call(
                mock.ANY,
                "deploy-bifrost",
            ),
        ]
        self.assertEqual(expected_calls, mock_kolla_run.call_args_list)

    @mock.patch.object(commands.KayobeAnsibleMixin,
                       "run_kayobe_config_dump")
    @mock.patch.object(commands.KayobeAnsibleMixin,
                       "run_kayobe_playbooks")
    @mock.patch.object(commands.KollaAnsibleMixin,
                       "run_kolla_ansible_overcloud")
    def test_overcloud_host_configure(self, mock_kolla_run, mock_run,
                                      mock_dump):
        command = commands.OvercloudHostConfigure(TestApp(), [])
        parser = command.get_parser("test")
        parsed_args = parser.parse_args([])
        mock_dump.return_value = {
            "controller0": {"kayobe_ansible_user": "stack"}
        }

        result = command.run(parsed_args)
        self.assertEqual(0, result)

        expected_calls = [
            mock.call(mock.ANY, hosts="overcloud", tags="dump-config")
        ]
        self.assertEqual(expected_calls, mock_dump.call_args_list)

        expected_calls = [
            mock.call(
                mock.ANY,
                [
                    "ansible/ip-allocation.yml",
                    "ansible/ssh-known-host.yml",
                    "ansible/kayobe-ansible-user.yml",
                    "ansible/kayobe-target-venv.yml",
                    "ansible/users.yml",
                    "ansible/yum.yml",
                    "ansible/dev-tools.yml",
                    "ansible/disable-selinux.yml",
                    "ansible/network.yml",
                    "ansible/sysctl.yml",
                    "ansible/disable-glean.yml",
                    "ansible/disable-cloud-init.yml",
                    "ansible/ntp.yml",
                    "ansible/lvm.yml",
                ],
                limit="overcloud",
            ),
            mock.call(
                mock.ANY,
                ["ansible/kolla-ansible.yml"],
                tags="config",
            ),
            mock.call(
                mock.ANY,
                [
                    "ansible/kolla-target-venv.yml",
                    "ansible/kolla-host.yml",
                    "ansible/docker.yml",
                    "ansible/ceph-block-devices.yml",
                ],
                limit="overcloud",
            ),
        ]
        self.assertEqual(expected_calls, mock_run.call_args_list)

        expected_calls = [
            mock.call(
                mock.ANY,
                "bootstrap-servers",
                extra_vars={"ansible_user": "stack"},
            ),
        ]
        self.assertEqual(expected_calls, mock_kolla_run.call_args_list)

    @mock.patch.object(commands.KayobeAnsibleMixin,
                       "run_kayobe_config_dump")
    @mock.patch.object(commands.KayobeAnsibleMixin,
                       "run_kayobe_playbooks")
    @mock.patch.object(commands.KollaAnsibleMixin,
                       "run_kolla_ansible_overcloud")
    def test_overcloud_host_configure_kayobe_venv(self, mock_kolla_run,
                                                  mock_run, mock_dump):
        command = commands.OvercloudHostConfigure(TestApp(), [])
        parser = command.get_parser("test")
        parsed_args = parser.parse_args([])
        mock_dump.return_value = {
            "controller0": {
                "ansible_python_interpreter": "/kayobe/venv/bin/python",
                "kayobe_ansible_user": "stack",
            }
        }

        result = command.run(parsed_args)
        self.assertEqual(0, result)

        expected_calls = [
            mock.call(
                mock.ANY,
                "bootstrap-servers",
                extra_vars={
                    "ansible_python_interpreter": "/kayobe/venv/bin/python",
                    "ansible_user": "stack",
                }
            ),
        ]
        self.assertEqual(expected_calls, mock_kolla_run.call_args_list)

    @mock.patch.object(commands.KayobeAnsibleMixin,
                       "run_kayobe_config_dump")
    @mock.patch.object(commands.KayobeAnsibleMixin,
                       "run_kayobe_playbooks")
    @mock.patch.object(commands.KollaAnsibleMixin,
                       "run_kolla_ansible_overcloud")
    def test_overcloud_host_configure_kolla_venv(self, mock_kolla_run,
                                                 mock_run, mock_dump):
        command = commands.OvercloudHostConfigure(TestApp(), [])
        parser = command.get_parser("test")
        parsed_args = parser.parse_args([])
        mock_dump.return_value = {
            "controller0": {
                "kayobe_ansible_user": "stack",
                "kolla_ansible_target_venv": "/kolla/venv/bin/python",
            }
        }

        result = command.run(parsed_args)
        self.assertEqual(0, result)

        expected_calls = [
            mock.call(
                mock.ANY,
                "bootstrap-servers",
                extra_vars={
                    "ansible_python_interpreter": "/usr/bin/python",
                    "ansible_user": "stack",
                    "virtualenv": "/kolla/venv/bin/python",
                }
            ),
        ]
        self.assertEqual(expected_calls, mock_kolla_run.call_args_list)

    @mock.patch.object(commands.KayobeAnsibleMixin,
                       "run_kayobe_config_dump")
    @mock.patch.object(commands.KayobeAnsibleMixin,
                       "run_kayobe_playbooks")
    @mock.patch.object(commands.KollaAnsibleMixin,
                       "run_kolla_ansible_overcloud")
    def test_overcloud_host_configure_both_venvs(self, mock_kolla_run,
                                                 mock_run, mock_dump):
        command = commands.OvercloudHostConfigure(TestApp(), [])
        parser = command.get_parser("test")
        parsed_args = parser.parse_args([])
        mock_dump.return_value = {
            "controller0": {
                "ansible_python_interpreter": "/kayobe/venv/bin/python",
                "kayobe_ansible_user": "stack",
                "kolla_ansible_target_venv": "/kolla/venv/bin/python",
            }
        }

        result = command.run(parsed_args)
        self.assertEqual(0, result)

        expected_calls = [
            mock.call(
                mock.ANY,
                "bootstrap-servers",
                extra_vars={
                    "ansible_python_interpreter": "/kayobe/venv/bin/python",
                    "ansible_user": "stack",
                    "virtualenv": "/kolla/venv/bin/python",
                }
            ),
        ]
        self.assertEqual(expected_calls, mock_kolla_run.call_args_list)

    @mock.patch.object(commands.KayobeAnsibleMixin,
                       "run_kayobe_playbooks")
    def test_overcloud_host_upgrade(self, mock_run):
        command = commands.OvercloudHostUpgrade(TestApp(), [])
        parser = command.get_parser("test")
        parsed_args = parser.parse_args([])

        result = command.run(parsed_args)
        self.assertEqual(0, result)

        expected_calls = [
            mock.call(
                mock.ANY,
                [
                    "ansible/kayobe-target-venv.yml",
                    "ansible/kolla-target-venv.yml",
                    "ansible/overcloud-docker-sdk-upgrade.yml",
                    "ansible/overcloud-etc-hosts-fixup.yml",
                ],
                limit="overcloud",
            ),
        ]
        self.assertEqual(expected_calls, mock_run.call_args_list)

    @mock.patch.object(commands.KayobeAnsibleMixin,
                       "run_kayobe_playbooks")
    def test_overcloud_container_image_build(self, mock_run):
        command = commands.OvercloudContainerImageBuild(TestApp(), [])
        parser = command.get_parser("test")
        parsed_args = parser.parse_args([])
        result = command.run(parsed_args)
        self.assertEqual(0, result)
        expected_calls = [
            mock.call(
                mock.ANY,
                [
                    "ansible/container-image-builders-check.yml",
                    "ansible/kolla-build.yml",
                    "ansible/container-image-build.yml"
                ],
                extra_vars={
                    "container_image_sets": (
                        "{{ overcloud_container_image_sets }}"),
                    "push_images": False,
                }
            ),
        ]
        self.assertEqual(expected_calls, mock_run.call_args_list)

    @mock.patch.object(commands.KayobeAnsibleMixin,
                       "run_kayobe_playbooks")
    def test_overcloud_container_image_build_with_regex(self, mock_run):
        command = commands.OvercloudContainerImageBuild(TestApp(), [])
        parser = command.get_parser("test")
        parsed_args = parser.parse_args(["--push", "^regex1$", "^regex2$"])
        result = command.run(parsed_args)
        self.assertEqual(0, result)
        expected_calls = [
            mock.call(
                mock.ANY,
                [
                    "ansible/container-image-builders-check.yml",
                    "ansible/kolla-build.yml",
                    "ansible/container-image-build.yml"
                ],
                extra_vars={
                    "container_image_regexes": "'^regex1$ ^regex2$'",
                    "push_images": True,
                }
            ),
        ]
        self.assertEqual(expected_calls, mock_run.call_args_list)

    @mock.patch.object(commands.KayobeAnsibleMixin,
                       "run_kayobe_playbooks")
    def test_overcloud_post_configure(self, mock_run):
        command = commands.OvercloudPostConfigure(TestApp(), [])
        parser = command.get_parser("test")
        parsed_args = parser.parse_args([])

        result = command.run(parsed_args)
        self.assertEqual(0, result)

        expected_calls = [
            mock.call(
                mock.ANY,
                [
                    'ansible/overcloud-ipa-images.yml',
                    'ansible/overcloud-introspection-rules.yml',
                    'ansible/overcloud-introspection-rules-dell-lldp-workaround.yml',  # noqa
                    'ansible/provision-net.yml',
                    'ansible/overcloud-grafana-configure.yml'
                ],
            ),
        ]
        self.assertEqual(expected_calls, mock_run.call_args_list)

    @mock.patch.object(commands.KayobeAnsibleMixin,
                       "run_kayobe_playbooks")
    def test_baremetal_compute_inspect(self, mock_run):
        command = commands.BaremetalComputeInspect(TestApp(), [])
        parser = command.get_parser("test")
        parsed_args = parser.parse_args([])
        result = command.run(parsed_args)
        self.assertEqual(0, result)
        expected_calls = [
            mock.call(
                mock.ANY,
                [
                    "ansible/baremetal-compute-inspect.yml",
                ],
            ),
        ]
        self.assertEqual(expected_calls, mock_run.call_args_list)

    @mock.patch.object(commands.KayobeAnsibleMixin,
                       "run_kayobe_playbooks")
    def test_baremetal_compute_manage(self, mock_run):
        command = commands.BaremetalComputeManage(TestApp(), [])
        parser = command.get_parser("test")
        parsed_args = parser.parse_args([])
        result = command.run(parsed_args)
        self.assertEqual(0, result)
        expected_calls = [
            mock.call(
                mock.ANY,
                [
                    "ansible/baremetal-compute-manage.yml",
                ],
            ),
        ]
        self.assertEqual(expected_calls, mock_run.call_args_list)

    @mock.patch.object(commands.KayobeAnsibleMixin,
                       "run_kayobe_playbooks")
    def test_baremetal_compute_provide(self, mock_run):
        command = commands.BaremetalComputeProvide(TestApp(), [])
        parser = command.get_parser("test")
        parsed_args = parser.parse_args([])
        result = command.run(parsed_args)
        self.assertEqual(0, result)
        expected_calls = [
            mock.call(
                mock.ANY,
                [
                    "ansible/baremetal-compute-provide.yml",
                ],
            ),
        ]
        self.assertEqual(expected_calls, mock_run.call_args_list)

[((996, 1049), 'mock.patch.object', 'mock.patch.object', (['utils', '"""galaxy_install"""'], {'spec': '(True)'}), "(utils, 'galaxy_install', spec=True)\n", (1013, 1049), False, 'import mock\n'), ((1055, 1125), 'mock.patch.object', 'mock.patch.object', (['commands.KayobeAnsibleMixin', '"""run_kayobe_playbooks"""'], {}), "(commands.KayobeAnsibleMixin, 'run_kayobe_playbooks')\n", (1072, 1125), False, 'import mock\n'), ((1843, 1896), 'mock.patch.object', 'mock.patch.object', (['utils', '"""galaxy_install"""'], {'spec': '(True)'}), "(utils, 'galaxy_install', spec=True)\n", (1860, 1896), False, 'import mock\n'), ((1902, 1972), 'mock.patch.object', 'mock.patch.object', (['commands.KayobeAnsibleMixin', '"""run_kayobe_playbooks"""'], {}), "(commands.KayobeAnsibleMixin, 'run_kayobe_playbooks')\n", (1919, 1972), False, 'import mock\n'), ((2698, 2768), 'mock.patch.object', 'mock.patch.object', (['commands.KayobeAnsibleMixin', '"""run_kayobe_playbooks"""'], {}), "(commands.KayobeAnsibleMixin, 'run_kayobe_playbooks')\n", (2715, 2768), False, 'import mock\n'), ((3262, 3334), 'mock.patch.object', 'mock.patch.object', (['commands.KayobeAnsibleMixin', '"""run_kayobe_config_dump"""'], {}), "(commands.KayobeAnsibleMixin, 'run_kayobe_config_dump')\n", (3279, 3334), False, 'import mock\n'), ((3363, 3433), 'mock.patch.object', 'mock.patch.object', (['commands.KayobeAnsibleMixin', '"""run_kayobe_playbooks"""'], {}), "(commands.KayobeAnsibleMixin, 'run_kayobe_playbooks')\n", (3380, 3433), False, 'import mock\n'), ((4815, 4885), 'mock.patch.object', 'mock.patch.object', (['commands.KayobeAnsibleMixin', '"""run_kayobe_playbooks"""'], {}), "(commands.KayobeAnsibleMixin, 'run_kayobe_playbooks')\n", (4832, 4885), False, 'import mock\n'), ((5562, 5634), 'mock.patch.object', 'mock.patch.object', (['commands.KayobeAnsibleMixin', '"""run_kayobe_config_dump"""'], {}), "(commands.KayobeAnsibleMixin, 'run_kayobe_config_dump')\n", (5579, 5634), False, 'import mock\n'), ((5663, 5733), 'mock.patch.object', 'mock.patch.object', (['commands.KayobeAnsibleMixin', '"""run_kayobe_playbooks"""'], {}), "(commands.KayobeAnsibleMixin, 'run_kayobe_playbooks')\n", (5680, 5733), False, 'import mock\n'), ((5762, 5833), 'mock.patch.object', 'mock.patch.object', (['commands.KollaAnsibleMixin', '"""run_kolla_ansible_seed"""'], {}), "(commands.KollaAnsibleMixin, 'run_kolla_ansible_seed')\n", (5779, 5833), False, 'import mock\n'), ((8032, 8104), 'mock.patch.object', 'mock.patch.object', (['commands.KayobeAnsibleMixin', '"""run_kayobe_config_dump"""'], {}), "(commands.KayobeAnsibleMixin, 'run_kayobe_config_dump')\n", (8049, 8104), False, 'import mock\n'), ((8133, 8203), 'mock.patch.object', 'mock.patch.object', (['commands.KayobeAnsibleMixin', '"""run_kayobe_playbooks"""'], {}), "(commands.KayobeAnsibleMixin, 'run_kayobe_playbooks')\n", (8150, 8203), False, 'import mock\n'), ((8232, 8303), 'mock.patch.object', 'mock.patch.object', (['commands.KollaAnsibleMixin', '"""run_kolla_ansible_seed"""'], {}), "(commands.KollaAnsibleMixin, 'run_kolla_ansible_seed')\n", (8249, 8303), False, 'import mock\n'), ((9277, 9349), 'mock.patch.object', 'mock.patch.object', (['commands.KayobeAnsibleMixin', '"""run_kayobe_config_dump"""'], {}), "(commands.KayobeAnsibleMixin, 'run_kayobe_config_dump')\n", (9294, 9349), False, 'import mock\n'), ((9378, 9448), 'mock.patch.object', 'mock.patch.object', (['commands.KayobeAnsibleMixin', '"""run_kayobe_playbooks"""'], {}), "(commands.KayobeAnsibleMixin, 'run_kayobe_playbooks')\n", (9395, 9448), False, 'import mock\n'), ((9477, 9548), 'mock.patch.object', 'mock.patch.object', (['commands.KollaAnsibleMixin', '"""run_kolla_ansible_seed"""'], {}), "(commands.KollaAnsibleMixin, 'run_kolla_ansible_seed')\n", (9494, 9548), False, 'import mock\n'), ((10570, 10642), 'mock.patch.object', 'mock.patch.object', (['commands.KayobeAnsibleMixin', '"""run_kayobe_config_dump"""'], {}), "(commands.KayobeAnsibleMixin, 'run_kayobe_config_dump')\n", (10587, 10642), False, 'import mock\n'), ((10671, 10741), 'mock.patch.object', 'mock.patch.object', (['commands.KayobeAnsibleMixin', '"""run_kayobe_playbooks"""'], {}), "(commands.KayobeAnsibleMixin, 'run_kayobe_playbooks')\n", (10688, 10741), False, 'import mock\n'), ((10770, 10841), 'mock.patch.object', 'mock.patch.object', (['commands.KollaAnsibleMixin', '"""run_kolla_ansible_seed"""'], {}), "(commands.KollaAnsibleMixin, 'run_kolla_ansible_seed')\n", (10787, 10841), False, 'import mock\n'), ((11944, 12014), 'mock.patch.object', 'mock.patch.object', (['commands.KayobeAnsibleMixin', '"""run_kayobe_playbooks"""'], {}), "(commands.KayobeAnsibleMixin, 'run_kayobe_playbooks')\n", (11961, 12014), False, 'import mock\n'), ((12659, 12729), 'mock.patch.object', 'mock.patch.object', (['commands.KayobeAnsibleMixin', '"""run_kayobe_playbooks"""'], {}), "(commands.KayobeAnsibleMixin, 'run_kayobe_playbooks')\n", (12676, 12729), False, 'import mock\n'), ((13616, 13686), 'mock.patch.object', 'mock.patch.object', (['commands.KayobeAnsibleMixin', '"""run_kayobe_playbooks"""'], {}), "(commands.KayobeAnsibleMixin, 'run_kayobe_playbooks')\n", (13633, 13686), False, 'import mock\n'), ((14579, 14649), 'mock.patch.object', 'mock.patch.object', (['commands.KayobeAnsibleMixin', '"""run_kayobe_playbooks"""'], {}), "(commands.KayobeAnsibleMixin, 'run_kayobe_playbooks')\n", (14596, 14649), False, 'import mock\n'), ((14678, 14749), 'mock.patch.object', 'mock.patch.object', (['commands.KollaAnsibleMixin', '"""run_kolla_ansible_seed"""'], {}), "(commands.KollaAnsibleMixin, 'run_kolla_ansible_seed')\n", (14695, 14749), False, 'import mock\n'), ((15918, 15990), 'mock.patch.object', 'mock.patch.object', (['commands.KayobeAnsibleMixin', '"""run_kayobe_config_dump"""'], {}), "(commands.KayobeAnsibleMixin, 'run_kayobe_config_dump')\n", (15935, 15990), False, 'import mock\n'), ((16019, 16089), 'mock.patch.object', 'mock.patch.object', (['commands.KayobeAnsibleMixin', '"""run_kayobe_playbooks"""'], {}), "(commands.KayobeAnsibleMixin, 'run_kayobe_playbooks')\n", (16036, 16089), False, 'import mock\n'), ((16118, 16194), 'mock.patch.object', 'mock.patch.object', (['commands.KollaAnsibleMixin', '"""run_kolla_ansible_overcloud"""'], {}), "(commands.KollaAnsibleMixin, 'run_kolla_ansible_overcloud')\n", (16135, 16194), False, 'import mock\n'), ((18485, 18557), 'mock.patch.object', 'mock.patch.object', (['commands.KayobeAnsibleMixin', '"""run_kayobe_config_dump"""'], {}), "(commands.KayobeAnsibleMixin, 'run_kayobe_config_dump')\n", (18502, 18557), False, 'import mock\n'), ((18586, 18656), 'mock.patch.object', 'mock.patch.object', (['commands.KayobeAnsibleMixin', '"""run_kayobe_playbooks"""'], {}), "(commands.KayobeAnsibleMixin, 'run_kayobe_playbooks')\n", (18603, 18656), False, 'import mock\n'), ((18685, 18761), 'mock.patch.object', 'mock.patch.object', (['commands.KollaAnsibleMixin', '"""run_kolla_ansible_overcloud"""'], {}), "(commands.KollaAnsibleMixin, 'run_kolla_ansible_overcloud')\n", (18702, 18761), False, 'import mock\n'), ((19756, 19828), 'mock.patch.object', 'mock.patch.object', (['commands.KayobeAnsibleMixin', '"""run_kayobe_config_dump"""'], {}), "(commands.KayobeAnsibleMixin, 'run_kayobe_config_dump')\n", (19773, 19828), False, 'import mock\n'), ((19857, 19927), 'mock.patch.object', 'mock.patch.object', (['commands.KayobeAnsibleMixin', '"""run_kayobe_playbooks"""'], {}), "(commands.KayobeAnsibleMixin, 'run_kayobe_playbooks')\n", (19874, 19927), False, 'import mock\n'), ((19956, 20032), 'mock.patch.object', 'mock.patch.object', (['commands.KollaAnsibleMixin', '"""run_kolla_ansible_overcloud"""'], {}), "(commands.KollaAnsibleMixin, 'run_kolla_ansible_overcloud')\n", (19973, 20032), False, 'import mock\n'), ((21075, 21147), 'mock.patch.object', 'mock.patch.object', (['commands.KayobeAnsibleMixin', '"""run_kayobe_config_dump"""'], {}), "(commands.KayobeAnsibleMixin, 'run_kayobe_config_dump')\n", (21092, 21147), False, 'import mock\n'), ((21176, 21246), 'mock.patch.object', 'mock.patch.object', (['commands.KayobeAnsibleMixin', '"""run_kayobe_playbooks"""'], {}), "(commands.KayobeAnsibleMixin, 'run_kayobe_playbooks')\n", (21193, 21246), False, 'import mock\n'), ((21275, 21351), 'mock.patch.object', 'mock.patch.object', (['commands.KollaAnsibleMixin', '"""run_kolla_ansible_overcloud"""'], {}), "(commands.KollaAnsibleMixin, 'run_kolla_ansible_overcloud')\n", (21292, 21351), False, 'import mock\n'), ((22475, 22545), 'mock.patch.object', 'mock.patch.object', (['commands.KayobeAnsibleMixin', '"""run_kayobe_playbooks"""'], {}), "(commands.KayobeAnsibleMixin, 'run_kayobe_playbooks')\n", (22492, 22545), False, 'import mock\n'), ((23330, 23400), 'mock.patch.object', 'mock.patch.object', (['commands.KayobeAnsibleMixin', '"""run_kayobe_playbooks"""'], {}), "(commands.KayobeAnsibleMixin, 'run_kayobe_playbooks')\n", (23347, 23400), False, 'import mock\n'), ((24302, 24372), 'mock.patch.object', 'mock.patch.object', (['commands.KayobeAnsibleMixin', '"""run_kayobe_playbooks"""'], {}), "(commands.KayobeAnsibleMixin, 'run_kayobe_playbooks')\n", (24319, 24372), False, 'import mock\n'), ((25275, 25345), 'mock.patch.object', 'mock.patch.object', (['commands.KayobeAnsibleMixin', '"""run_kayobe_playbooks"""'], {}), "(commands.KayobeAnsibleMixin, 'run_kayobe_playbooks')\n", (25292, 25345), False, 'import mock\n'), ((26193, 26263), 'mock.patch.object', 'mock.patch.object', (['commands.KayobeAnsibleMixin', '"""run_kayobe_playbooks"""'], {}), "(commands.KayobeAnsibleMixin, 'run_kayobe_playbooks')\n", (26210, 26263), False, 'import mock\n'), ((26846, 26916), 'mock.patch.object', 'mock.patch.object', (['commands.KayobeAnsibleMixin', '"""run_kayobe_playbooks"""'], {}), "(commands.KayobeAnsibleMixin, 'run_kayobe_playbooks')\n", (26863, 26916), False, 'import mock\n'), ((27496, 27566), 'mock.patch.object', 'mock.patch.object', (['commands.KayobeAnsibleMixin', '"""run_kayobe_playbooks"""'], {}), "(commands.KayobeAnsibleMixin, 'run_kayobe_playbooks')\n", (27513, 27566), False, 'import mock\n'), ((1611, 1657), 'mock.call', 'mock.call', (['mock.ANY', "['ansible/bootstrap.yml']"], {}), "(mock.ANY, ['ansible/bootstrap.yml'])\n", (1620, 1657), False, 'import mock\n'), ((1671, 1737), 'mock.call', 'mock.call', (['mock.ANY', "['ansible/kolla-ansible.yml']"], {'tags': '"""install"""'}), "(mock.ANY, ['ansible/kolla-ansible.yml'], tags='install')\n", (1680, 1737), False, 'import mock\n'), ((2466, 2512), 'mock.call', 'mock.call', (['mock.ANY', "['ansible/bootstrap.yml']"], {}), "(mock.ANY, ['ansible/bootstrap.yml'])\n", (2475, 2512), False, 'import mock\n'), ((2526, 2592), 'mock.call', 'mock.call', (['mock.ANY', "['ansible/kolla-ansible.yml']"], {'tags': '"""install"""'}), "(mock.ANY, ['ansible/kolla-ansible.yml'], tags='install')\n", (2535, 2592), False, 'import mock\n'), ((3121, 3178), 'mock.call', 'mock.call', (['mock.ANY', "['ansible/network-connectivity.yml']"], {}), "(mock.ANY, ['ansible/network-connectivity.yml'])\n", (3130, 3178), False, 'import mock\n'), ((3847, 3946), 'mock.call', 'mock.call', (['mock.ANY'], {'host': '"""seed-hypervisor"""', 'var_name': '"""kayobe_ansible_user"""', 'tags': '"""dump-config"""'}), "(mock.ANY, host='seed-hypervisor', var_name='kayobe_ansible_user',\n    tags='dump-config')\n", (3856, 3946), False, 'import mock\n'), ((4082, 4449), 'mock.call', 'mock.call', (['mock.ANY', "['ansible/ip-allocation.yml', 'ansible/ssh-known-host.yml',\n    'ansible/kayobe-ansible-user.yml', 'ansible/kayobe-target-venv.yml',\n    'ansible/users.yml', 'ansible/yum.yml', 'ansible/dev-tools.yml',\n    'ansible/network.yml', 'ansible/sysctl.yml', 'ansible/ntp.yml',\n    'ansible/seed-hypervisor-libvirt-host.yml']"], {'limit': '"""seed-hypervisor"""'}), "(mock.ANY, ['ansible/ip-allocation.yml',\n    'ansible/ssh-known-host.yml', 'ansible/kayobe-ansible-user.yml',\n    'ansible/kayobe-target-venv.yml', 'ansible/users.yml',\n    'ansible/yum.yml', 'ansible/dev-tools.yml', 'ansible/network.yml',\n    'ansible/sysctl.yml', 'ansible/ntp.yml',\n    'ansible/seed-hypervisor-libvirt-host.yml'], limit='seed-hypervisor')\n", (4091, 4449), False, 'import mock\n'), ((5243, 5360), 'mock.call', 'mock.call', (['mock.ANY', "['ansible/kayobe-target-venv.yml', 'ansible/kolla-target-venv.yml']"], {'limit': '"""seed-hypervisor"""'}), "(mock.ANY, ['ansible/kayobe-target-venv.yml',\n    'ansible/kolla-target-venv.yml'], limit='seed-hypervisor')\n", (5252, 5360), False, 'import mock\n'), ((6299, 6352), 'mock.call', 'mock.call', (['mock.ANY'], {'hosts': '"""seed"""', 'tags': '"""dump-config"""'}), "(mock.ANY, hosts='seed', tags='dump-config')\n", (6308, 6352), False, 'import mock\n'), ((6470, 6915), 'mock.call', 'mock.call', (['mock.ANY', "['ansible/ip-allocation.yml', 'ansible/ssh-known-host.yml',\n    'ansible/kayobe-ansible-user.yml', 'ansible/kayobe-target-venv.yml',\n    'ansible/users.yml', 'ansible/yum.yml', 'ansible/dev-tools.yml',\n    'ansible/disable-selinux.yml', 'ansible/network.yml',\n    'ansible/sysctl.yml', 'ansible/ip-routing.yml', 'ansible/snat.yml',\n    'ansible/disable-glean.yml', 'ansible/ntp.yml', 'ansible/lvm.yml']"], {'limit': '"""seed"""'}), "(mock.ANY, ['ansible/ip-allocation.yml',\n    'ansible/ssh-known-host.yml', 'ansible/kayobe-ansible-user.yml',\n    'ansible/kayobe-target-venv.yml', 'ansible/users.yml',\n    'ansible/yum.yml', 'ansible/dev-tools.yml',\n    'ansible/disable-selinux.yml', 'ansible/network.yml',\n    'ansible/sysctl.yml', 'ansible/ip-routing.yml', 'ansible/snat.yml',\n    'ansible/disable-glean.yml', 'ansible/ntp.yml', 'ansible/lvm.yml'],\n    limit='seed')\n", (6479, 6915), False, 'import mock\n'), ((7283, 7348), 'mock.call', 'mock.call', (['mock.ANY', "['ansible/kolla-ansible.yml']"], {'tags': '"""config"""'}), "(mock.ANY, ['ansible/kolla-ansible.yml'], tags='config')\n", (7292, 7348), False, 'import mock\n'), ((7425, 7545), 'mock.call', 'mock.call', (['mock.ANY', "['ansible/kolla-target-venv.yml', 'ansible/kolla-host.yml',\n    'ansible/docker.yml']"], {'limit': '"""seed"""'}), "(mock.ANY, ['ansible/kolla-target-venv.yml',\n    'ansible/kolla-host.yml', 'ansible/docker.yml'], limit='seed')\n", (7434, 7545), False, 'import mock\n'), ((7801, 7879), 'mock.call', 'mock.call', (['mock.ANY', '"""bootstrap-servers"""'], {'extra_vars': "{'ansible_user': 'stack'}"}), "(mock.ANY, 'bootstrap-servers', extra_vars={'ansible_user': 'stack'})\n", (7810, 7879), False, 'import mock\n'), ((8930, 9074), 'mock.call', 'mock.call', (['mock.ANY', '"""bootstrap-servers"""'], {'extra_vars': "{'ansible_python_interpreter': '/kayobe/venv/bin/python', 'ansible_user':\n    'stack'}"}), "(mock.ANY, 'bootstrap-servers', extra_vars={\n    'ansible_python_interpreter': '/kayobe/venv/bin/python', 'ansible_user':\n    'stack'})\n", (8939, 9074), False, 'import mock\n'), ((10171, 10347), 'mock.call', 'mock.call', (['mock.ANY', '"""bootstrap-servers"""'], {'extra_vars': "{'ansible_python_interpreter': '/usr/bin/python', 'ansible_user': 'stack',\n    'virtualenv': '/kolla/venv/bin/python'}"}), "(mock.ANY, 'bootstrap-servers', extra_vars={\n    'ansible_python_interpreter': '/usr/bin/python', 'ansible_user':\n    'stack', 'virtualenv': '/kolla/venv/bin/python'})\n", (10180, 10347), False, 'import mock\n'), ((11537, 11721), 'mock.call', 'mock.call', (['mock.ANY', '"""bootstrap-servers"""'], {'extra_vars': "{'ansible_python_interpreter': '/kayobe/venv/bin/python', 'ansible_user':\n    'stack', 'virtualenv': '/kolla/venv/bin/python'}"}), "(mock.ANY, 'bootstrap-servers', extra_vars={\n    'ansible_python_interpreter': '/kayobe/venv/bin/python', 'ansible_user':\n    'stack', 'virtualenv': '/kolla/venv/bin/python'})\n", (11546, 11721), False, 'import mock\n'), ((12351, 12457), 'mock.call', 'mock.call', (['mock.ANY', "['ansible/kayobe-target-venv.yml', 'ansible/kolla-target-venv.yml']"], {'limit': '"""seed"""'}), "(mock.ANY, ['ansible/kayobe-target-venv.yml',\n    'ansible/kolla-target-venv.yml'], limit='seed')\n", (12360, 12457), False, 'import mock\n'), ((13081, 13318), 'mock.call', 'mock.call', (['mock.ANY', "['ansible/container-image-builders-check.yml', 'ansible/kolla-build.yml',\n    'ansible/container-image-build.yml']"], {'extra_vars': "{'container_image_sets': '{{ seed_container_image_sets }}', 'push_images': \n    False}"}), "(mock.ANY, ['ansible/container-image-builders-check.yml',\n    'ansible/kolla-build.yml', 'ansible/container-image-build.yml'],\n    extra_vars={'container_image_sets': '{{ seed_container_image_sets }}',\n    'push_images': False})\n", (13090, 13318), False, 'import mock\n'), ((14081, 14308), 'mock.call', 'mock.call', (['mock.ANY', "['ansible/container-image-builders-check.yml', 'ansible/kolla-build.yml',\n    'ansible/container-image-build.yml']"], {'extra_vars': '{\'container_image_regexes\': "\'^regex1$ ^regex2$\'", \'push_images\': True}'}), '(mock.ANY, [\'ansible/container-image-builders-check.yml\',\n    \'ansible/kolla-build.yml\', \'ansible/container-image-build.yml\'],\n    extra_vars={\'container_image_regexes\': "\'^regex1$ ^regex2$\'",\n    \'push_images\': True})\n', (14090, 14308), False, 'import mock\n'), ((15101, 15166), 'mock.call', 'mock.call', (['mock.ANY', "['ansible/kolla-ansible.yml']"], {'tags': '"""config"""'}), "(mock.ANY, ['ansible/kolla-ansible.yml'], tags='config')\n", (15110, 15166), False, 'import mock\n'), ((15243, 15293), 'mock.call', 'mock.call', (['mock.ANY', "['ansible/kolla-bifrost.yml']"], {}), "(mock.ANY, ['ansible/kolla-bifrost.yml'])\n", (15252, 15293), False, 'import mock\n'), ((15354, 15504), 'mock.call', 'mock.call', (['mock.ANY', "['ansible/overcloud-host-image-workaround-resolv.yml',\n    'ansible/seed-introspection-rules.yml', 'ansible/dell-switch-bmp.yml']"], {}), "(mock.ANY, ['ansible/overcloud-host-image-workaround-resolv.yml',\n    'ansible/seed-introspection-rules.yml', 'ansible/dell-switch-bmp.yml'])\n", (15363, 15504), False, 'import mock\n'), ((15744, 15781), 'mock.call', 'mock.call', (['mock.ANY', '"""deploy-bifrost"""'], {}), "(mock.ANY, 'deploy-bifrost')\n", (15753, 15781), False, 'import mock\n'), ((16715, 16773), 'mock.call', 'mock.call', (['mock.ANY'], {'hosts': '"""overcloud"""', 'tags': '"""dump-config"""'}), "(mock.ANY, hosts='overcloud', tags='dump-config')\n", (16724, 16773), False, 'import mock\n'), ((16891, 17329), 'mock.call', 'mock.call', (['mock.ANY', "['ansible/ip-allocation.yml', 'ansible/ssh-known-host.yml',\n    'ansible/kayobe-ansible-user.yml', 'ansible/kayobe-target-venv.yml',\n    'ansible/users.yml', 'ansible/yum.yml', 'ansible/dev-tools.yml',\n    'ansible/disable-selinux.yml', 'ansible/network.yml',\n    'ansible/sysctl.yml', 'ansible/disable-glean.yml',\n    'ansible/disable-cloud-init.yml', 'ansible/ntp.yml', 'ansible/lvm.yml']"], {'limit': '"""overcloud"""'}), "(mock.ANY, ['ansible/ip-allocation.yml',\n    'ansible/ssh-known-host.yml', 'ansible/kayobe-ansible-user.yml',\n    'ansible/kayobe-target-venv.yml', 'ansible/users.yml',\n    'ansible/yum.yml', 'ansible/dev-tools.yml',\n    'ansible/disable-selinux.yml', 'ansible/network.yml',\n    'ansible/sysctl.yml', 'ansible/disable-glean.yml',\n    'ansible/disable-cloud-init.yml', 'ansible/ntp.yml', 'ansible/lvm.yml'],\n    limit='overcloud')\n", (16900, 17329), False, 'import mock\n'), ((17677, 17742), 'mock.call', 'mock.call', (['mock.ANY', "['ansible/kolla-ansible.yml']"], {'tags': '"""config"""'}), "(mock.ANY, ['ansible/kolla-ansible.yml'], tags='config')\n", (17686, 17742), False, 'import mock\n'), ((17819, 17982), 'mock.call', 'mock.call', (['mock.ANY', "['ansible/kolla-target-venv.yml', 'ansible/kolla-host.yml',\n    'ansible/docker.yml', 'ansible/ceph-block-devices.yml']"], {'limit': '"""overcloud"""'}), "(mock.ANY, ['ansible/kolla-target-venv.yml',\n    'ansible/kolla-host.yml', 'ansible/docker.yml',\n    'ansible/ceph-block-devices.yml'], limit='overcloud')\n", (17828, 17982), False, 'import mock\n'), ((18254, 18332), 'mock.call', 'mock.call', (['mock.ANY', '"""bootstrap-servers"""'], {'extra_vars': "{'ansible_user': 'stack'}"}), "(mock.ANY, 'bootstrap-servers', extra_vars={'ansible_user': 'stack'})\n", (18263, 18332), False, 'import mock\n'), ((19410, 19554), 'mock.call', 'mock.call', (['mock.ANY', '"""bootstrap-servers"""'], {'extra_vars': "{'ansible_python_interpreter': '/kayobe/venv/bin/python', 'ansible_user':\n    'stack'}"}), "(mock.ANY, 'bootstrap-servers', extra_vars={\n    'ansible_python_interpreter': '/kayobe/venv/bin/python', 'ansible_user':\n    'stack'})\n", (19419, 19554), False, 'import mock\n'), ((20677, 20853), 'mock.call', 'mock.call', (['mock.ANY', '"""bootstrap-servers"""'], {'extra_vars': "{'ansible_python_interpreter': '/usr/bin/python', 'ansible_user': 'stack',\n    'virtualenv': '/kolla/venv/bin/python'}"}), "(mock.ANY, 'bootstrap-servers', extra_vars={\n    'ansible_python_interpreter': '/usr/bin/python', 'ansible_user':\n    'stack', 'virtualenv': '/kolla/venv/bin/python'})\n", (20686, 20853), False, 'import mock\n'), ((22069, 22253), 'mock.call', 'mock.call', (['mock.ANY', '"""bootstrap-servers"""'], {'extra_vars': "{'ansible_python_interpreter': '/kayobe/venv/bin/python', 'ansible_user':\n    'stack', 'virtualenv': '/kolla/venv/bin/python'}"}), "(mock.ANY, 'bootstrap-servers', extra_vars={\n    'ansible_python_interpreter': '/kayobe/venv/bin/python', 'ansible_user':\n    'stack', 'virtualenv': '/kolla/venv/bin/python'})\n", (22078, 22253), False, 'import mock\n'), ((22892, 23096), 'mock.call', 'mock.call', (['mock.ANY', "['ansible/kayobe-target-venv.yml', 'ansible/kolla-target-venv.yml',\n    'ansible/overcloud-docker-sdk-upgrade.yml',\n    'ansible/overcloud-etc-hosts-fixup.yml']"], {'limit': '"""overcloud"""'}), "(mock.ANY, ['ansible/kayobe-target-venv.yml',\n    'ansible/kolla-target-venv.yml',\n    'ansible/overcloud-docker-sdk-upgrade.yml',\n    'ansible/overcloud-etc-hosts-fixup.yml'], limit='overcloud')\n", (22901, 23096), False, 'import mock\n'), ((23762, 24004), 'mock.call', 'mock.call', (['mock.ANY', "['ansible/container-image-builders-check.yml', 'ansible/kolla-build.yml',\n    'ansible/container-image-build.yml']"], {'extra_vars': "{'container_image_sets': '{{ overcloud_container_image_sets }}',\n    'push_images': False}"}), "(mock.ANY, ['ansible/container-image-builders-check.yml',\n    'ansible/kolla-build.yml', 'ansible/container-image-build.yml'],\n    extra_vars={'container_image_sets':\n    '{{ overcloud_container_image_sets }}', 'push_images': False})\n", (23771, 24004), False, 'import mock\n'), ((24777, 25004), 'mock.call', 'mock.call', (['mock.ANY', "['ansible/container-image-builders-check.yml', 'ansible/kolla-build.yml',\n    'ansible/container-image-build.yml']"], {'extra_vars': '{\'container_image_regexes\': "\'^regex1$ ^regex2$\'", \'push_images\': True}'}), '(mock.ANY, [\'ansible/container-image-builders-check.yml\',\n    \'ansible/kolla-build.yml\', \'ansible/container-image-build.yml\'],\n    extra_vars={\'container_image_regexes\': "\'^regex1$ ^regex2$\'",\n    \'push_images\': True})\n', (24786, 25004), False, 'import mock\n'), ((25696, 25948), 'mock.call', 'mock.call', (['mock.ANY', "['ansible/overcloud-ipa-images.yml',\n    'ansible/overcloud-introspection-rules.yml',\n    'ansible/overcloud-introspection-rules-dell-lldp-workaround.yml',\n    'ansible/provision-net.yml', 'ansible/overcloud-grafana-configure.yml']"], {}), "(mock.ANY, ['ansible/overcloud-ipa-images.yml',\n    'ansible/overcloud-introspection-rules.yml',\n    'ansible/overcloud-introspection-rules-dell-lldp-workaround.yml',\n    'ansible/provision-net.yml', 'ansible/overcloud-grafana-configure.yml'])\n", (25705, 25948), False, 'import mock\n'), ((26614, 26676), 'mock.call', 'mock.call', (['mock.ANY', "['ansible/baremetal-compute-inspect.yml']"], {}), "(mock.ANY, ['ansible/baremetal-compute-inspect.yml'])\n", (26623, 26676), False, 'import mock\n'), ((27265, 27326), 'mock.call', 'mock.call', (['mock.ANY', "['ansible/baremetal-compute-manage.yml']"], {}), "(mock.ANY, ['ansible/baremetal-compute-manage.yml'])\n", (27274, 27326), False, 'import mock\n'), ((27917, 27979), 'mock.call', 'mock.call', (['mock.ANY', "['ansible/baremetal-compute-provide.yml']"], {}), "(mock.ANY, ['ansible/baremetal-compute-provide.yml'])\n", (27926, 27979), False, 'import mock\n')]