def METHOD_NAME(
    mock_get_status_for_instance,
    mock_pick_slave_from_status,
    mock_subprocess,
    mock_get_any_mesos_master,
    mock__run,
    mock_get_mesos_master,
    mock_format_mesos_command,
    mock_load_system_paasta_config,
    mock_load_marathon_service_config,
):
    mock_status = mock.Mock(marathon=mock.Mock(app_id="appID1"))
    mock_get_status_for_instance.return_value = mock_status
    mock_args = mock.Mock(
        cluster="cluster1",
        service="mock_service",
        instance="mock_instance",
        host="host1",
        mesos_id=None,
        local=False,
    )
    mock_pick_slave_from_status.return_value = "host1"
    mock_get_any_mesos_master.return_value = "master1"
    mock__run.return_value = (0, "slave:command123")
    sysdig.paasta_sysdig(mock_args)
    mock_get_any_mesos_master.assert_called_with(
        cluster="cluster1",
        system_paasta_config=mock_load_system_paasta_config.return_value,
    )
    mock__run.assert_called_with(
        "ssh -At -o StrictHostKeyChecking=no -o LogLevel=QUIET master1 "
        '"sudo paasta sysdig blah blah --local"'
    )
    mock_subprocess.call.assert_called_with(["ssh", "-tA", "slave", "command123"])
    mock__run.return_value = (1, "slave:command123")
    with raises(SystemExit):
        sysdig.paasta_sysdig(mock_args)
    mock_args = mock.Mock(
        cluster="cluster1",
        service="mock_service",
        instance="mock_instance",
        host="host1",
        mesos_id=None,
        local=True,
    )
    mock_pick_slave_from_status.return_value = "slave1"
    fake_server_config = {"url": ["http://blah"], "user": "user", "password": "pass"}
    mock_load_system_paasta_config.return_value.get_marathon_servers = mock.Mock(
        return_value=[fake_server_config]
    )
    mock_load_system_paasta_config.return_value.get_previous_marathon_servers = (
        mock.Mock(return_value=[fake_server_config])
    )
    mock_load_marathon_service_config().get_marathon_shard.return_value = None
    mock_get_mesos_master.return_value = mock.Mock(host="http://foo")
    sysdig.paasta_sysdig(mock_args)
    mock_get_status_for_instance.assert_called_with(
        cluster="cluster1", service="mock_service", instance="mock_instance"
    )
    mock_pick_slave_from_status.assert_called_with(status=mock_status, host="host1")
    mock_format_mesos_command.assert_called_with(
        "slave1", "appID1", "http://foo", "http://user:pass@blah"
    )