summaryrefslogtreecommitdiff
path: root/lib/ansible/modules/network/ordnance
diff options
context:
space:
mode:
authorJohn Barker <john@johnrbarker.com>2017-12-07 16:27:06 +0000
committerJohn R Barker <john@johnrbarker.com>2017-12-07 20:25:55 +0000
commitc57a7f05e1b37084110d2b1bc219b40fc9023ffa (patch)
tree8cd125c6d14221a9b7302847dcb7d38ed55406fe /lib/ansible/modules/network/ordnance
parentd13d7e94043564049318b904cbc2bd7ea1a137b4 (diff)
downloadansible-c57a7f05e1b37084110d2b1bc219b40fc9023ffa.tar.gz
Bulk autopep8 (modules)
As agreed in 2017-12-07 Core meeting bulk fix pep8 issues Generated using: autopep8 1.3.3 (pycodestyle: 2.3.1) autopep8 -r --max-line-length 160 --in-place --ignore E305,E402,E722,E741 lib/ansible/modules Manually fix issues that autopep8 has introduced
Diffstat (limited to 'lib/ansible/modules/network/ordnance')
-rw-r--r--lib/ansible/modules/network/ordnance/ordnance_config.py9
-rw-r--r--lib/ansible/modules/network/ordnance/ordnance_facts.py1
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/ansible/modules/network/ordnance/ordnance_config.py b/lib/ansible/modules/network/ordnance/ordnance_config.py
index a123b0d998..6f969604fc 100644
--- a/lib/ansible/modules/network/ordnance/ordnance_config.py
+++ b/lib/ansible/modules/network/ordnance/ordnance_config.py
@@ -206,6 +206,7 @@ def check_args(module, warnings):
'match=none instead. This argument will be '
'removed in the future')
+
def extract_banners(config):
banners = {}
banner_cmds = re.findall(r'^banner (\w+)', config, re.M)
@@ -225,6 +226,7 @@ def extract_banners(config):
config = re.sub(r'banner \w+ \^C\^C', '!! banner removed', config)
return (config, banners)
+
def diff_banners(want, have):
candidate = {}
for key, value in iteritems(want):
@@ -232,6 +234,7 @@ def diff_banners(want, have):
candidate[key] = value
return candidate
+
def load_banners(module, banners):
delimiter = module.params['multiline_delimiter']
for key, value in iteritems(banners):
@@ -242,6 +245,7 @@ def load_banners(module, banners):
time.sleep(1)
module.connection.shell.receive()
+
def get_config(module, result):
contents = module.params['config']
if not contents:
@@ -251,6 +255,7 @@ def get_config(module, result):
contents, banners = extract_banners(contents)
return NetworkConfig(indent=1, contents=contents), banners
+
def get_candidate(module):
candidate = NetworkConfig(indent=1)
banners = {}
@@ -265,6 +270,7 @@ def get_candidate(module):
return candidate, banners
+
def run(module, result):
match = module.params['match']
replace = module.params['replace']
@@ -275,7 +281,7 @@ def run(module, result):
if match != 'none':
config, have_banners = get_config(module, result)
path = module.params['parents']
- configobjs = candidate.difference(config, path=path,match=match,
+ configobjs = candidate.difference(config, path=path, match=match,
replace=replace)
else:
configobjs = candidate.items
@@ -311,6 +317,7 @@ def run(module, result):
module.config.save_config()
result['changed'] = True
+
def main():
""" main entry point for module execution
"""
diff --git a/lib/ansible/modules/network/ordnance/ordnance_facts.py b/lib/ansible/modules/network/ordnance/ordnance_facts.py
index eccfc5d7a7..ae4742f192 100644
--- a/lib/ansible/modules/network/ordnance/ordnance_facts.py
+++ b/lib/ansible/modules/network/ordnance/ordnance_facts.py
@@ -223,6 +223,7 @@ FACT_SUBSETS = dict(
VALID_SUBSETS = frozenset(FACT_SUBSETS.keys())
+
def main():
spec = dict(
gather_subset=dict(default=['!config'], type='list')