Skip to content

Commit

Permalink
Fix Nic creation issue in stack (#4008)
Browse files Browse the repository at this point in the history
* Fix Nic creation issue in stack

* Remove white space

* Edits with comments for refactoring

* Fix build error (long line)

* Remove trailing white space
  • Loading branch information
viananth authored and tjprescott committed Jul 13, 2017
1 parent 9eb33c1 commit 168a6b4
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# --------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -1134,14 +1134,19 @@ def create_nic(resource_group_name, network_interface_name, subnet, location=Non
public_ip_address=None, virtual_network_name=None, enable_accelerated_networking=None):
client = _network_client_factory().network_interfaces
NetworkInterface = get_sdk(ResourceType.MGMT_NETWORK, 'NetworkInterface', mod='models')

NetworkInterfaceDnsSettings = get_sdk(
ResourceType.MGMT_NETWORK,
'NetworkInterfaceDnsSettings', mod='models')

dns_settings = NetworkInterfaceDnsSettings(internal_dns_name_label=internal_dns_name_label,
dns_servers=dns_servers or [])

nic = NetworkInterface(location=location, tags=tags, enable_ip_forwarding=enable_ip_forwarding,
dns_settings=dns_settings, enable_accelerated_networking=enable_accelerated_networking)
dns_settings=dns_settings)

if supported_api_version(ResourceType.MGMT_NETWORK, min_api='2016-09-01'):
nic.enable_accelerated_networking = enable_accelerated_networking

if network_security_group:
nic.network_security_group = NetworkSecurityGroup(id=network_security_group)
Expand Down

0 comments on commit 168a6b4

Please sign in to comment.