mirror of
https://github.com/linux-system-roles/network.git
synced 2026-07-21 02:11:23 +00:00
Handle undefined type attribute
This fixes this exception (issue #40): [WARNING]: exception: Traceback (most recent call last): File "/tmp/ansible_FfjjGk/ansible_module_network_connections.py", line 2812, in <module> cmd.run() File "/tmp/ansible_FfjjGk/ansible_module_network_connections.py", line 2398, in run self.run_prepare() File "/tmp/ansible_FfjjGk/ansible_module_network_connections.py", line 2653, in run_prepare if connection['type'] in [ 'macvlan' ]: KeyError: 'type'
This commit is contained in:
parent
0fc1b5bbb5
commit
dd24f020a9
1 changed files with 1 additions and 1 deletions
|
|
@ -2673,7 +2673,7 @@ class Cmd_initscripts(Cmd):
|
|||
def run_prepare(self):
|
||||
Cmd.run_prepare(self)
|
||||
for idx, connection in enumerate(self.connections):
|
||||
if connection['type'] in [ 'macvlan' ]:
|
||||
if connection.get('type') in [ 'macvlan' ]:
|
||||
self.log_fatal(idx, 'unsupported type %s for initscripts provider' % (connection['type']))
|
||||
|
||||
def check_name(self, idx, name = None):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue