summaryrefslogtreecommitdiff
path: root/plugins/modules/_vyos_interface.py
diff options
context:
space:
mode:
authorBradley A. Thornton <bthornto@thethorntons.net>2019-08-09 12:05:55 -0700
committerBradley A. Thornton <bthornto@thethorntons.net>2019-08-09 12:05:55 -0700
commit29c342fa51c7a9866366cfc20968be7270e02fc5 (patch)
tree196722c57cca4211e79781edefe1a101d9c4b0c5 /plugins/modules/_vyos_interface.py
parent5fb9df4e907a6ab2da7a6c2dafdec9c1971e8d44 (diff)
downloadvyos-ansible-collection-29c342fa51c7a9866366cfc20968be7270e02fc5.tar.gz
vyos-ansible-collection-29c342fa51c7a9866366cfc20968be7270e02fc5.zip
79
Diffstat (limited to 'plugins/modules/_vyos_interface.py')
-rw-r--r--plugins/modules/_vyos_interface.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/plugins/modules/_vyos_interface.py b/plugins/modules/_vyos_interface.py
index ee82107..5128574 100644
--- a/plugins/modules/_vyos_interface.py
+++ b/plugins/modules/_vyos_interface.py
@@ -175,7 +175,10 @@ from time import sleep
from ansible.module_utils._text import to_text
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.connection import exec_command
-from ansible.module_utils.network.common.utils import conditional, remove_default_spec
+from ansible.module_utils.network.common.utils import (
+ conditional,
+ remove_default_spec,
+)
from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.vyos import (
load_config,
get_config,
@@ -218,7 +221,9 @@ def map_obj_to_commands(updates):
if value and value != obj_in_have.get(item):
if item == "description":
value = "'" + str(value) + "'"
- commands.append(set_interface + " " + item + " " + str(value))
+ commands.append(
+ set_interface + " " + item + " " + str(value)
+ )
if disable and not obj_in_have.get("disable", False):
commands.append(set_interface + " disable")
@@ -231,7 +236,9 @@ def map_obj_to_commands(updates):
if value:
if item == "description":
value = "'" + str(value) + "'"
- commands.append(set_interface + " " + item + " " + str(value))
+ commands.append(
+ set_interface + " " + item + " " + str(value)
+ )
if disable:
commands.append(set_interface + " disable")
@@ -399,7 +406,9 @@ def main():
enabled=dict(default=True, type="bool"),
neighbors=dict(type="list", elements="dict", options=neighbors_spec),
delay=dict(default=10, type="int"),
- state=dict(default="present", choices=["present", "absent", "up", "down"]),
+ state=dict(
+ default="present", choices=["present", "absent", "up", "down"]
+ ),
)
aggregate_spec = deepcopy(element_spec)