This repository was archived by the owner on Mar 6, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -716,13 +716,14 @@ def delete_nic(self, index):
716716 indices = [None ] * 10
717717 nic_not_found = True
718718 # find the nic with the given index
719- for nc in net_conn_section .NetworkConnection :
720- if int (nc .NetworkConnectionIndex .text ) == index :
721- net_conn_section .remove (nc )
722- nic_not_found = False
723- else :
724- indices [int (nc .NetworkConnectionIndex .
725- text )] = nc .NetworkConnectionIndex .text
719+ if hasattr (net_conn_section , 'NetworkConnection' ):
720+ for nc in net_conn_section .NetworkConnection :
721+ if int (nc .NetworkConnectionIndex .text ) == index :
722+ net_conn_section .remove (nc )
723+ nic_not_found = False
724+ else :
725+ indices [int (nc .NetworkConnectionIndex .
726+ text )] = nc .NetworkConnectionIndex .text
726727
727728 if nic_not_found :
728729 raise InvalidParameterException (
You can’t perform that action at this time.
0 commit comments