def stub_out_nw_api(stubs, cls=None, private=None, publics=None):
    if (not private):
        private = '192.168.0.3'
    if (not publics):
        publics = ['1.2.3.4']

    class Fake(object):

        def __init__(self, skip_policy_check=False):
            pass

        def get_instance_nw_info(*args, **kwargs):
            pass

        def get_floating_ips_by_fixed_address(*args, **kwargs):
            return publics

        def validate_networks(self, context, networks, max_count):
            return max_count

        def create_pci_requests_for_sriov_ports(self, context, system_metadata, requested_networks):
            pass
    if (cls is None):
        cls = Fake
    stubs.Set(network_api, 'API', cls)
    fake_network.stub_out_nw_api_get_instance_nw_info(stubs)
def stub_out_nw_api(stubs, cls=None, private=None, publics=None):
    if (not private):
        private = '192.168.0.3'
    if (not publics):
        publics = ['1.2.3.4']

    class Fake(object):

        def __init__(self, skip_policy_check=False):
            pass

        def get_instance_nw_info(*args, **kwargs):
            pass

        def get_floating_ips_by_fixed_address(*args, **kwargs):
            return publics

        def validate_networks(self, context, networks, max_count):
            return max_count

        def create_pci_requests_for_sriov_ports(self, context, system_metadata, requested_networks):
            pass
    if (cls is None):
        cls = Fake
    stubs.Set(network_api, 'API', cls)
    fake_network.stub_out_nw_api_get_instance_nw_info(stubs)