From 989793483f7a6d499f96e67dc810187e281797bb Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Fri, 16 Sep 2016 22:09:58 -0400 Subject: [PATCH] fix up eos_eapi module * fixes TypeError: load_config() got an unexpected keyword argument 'session'\n" * removes qos argument ref #4869 --- lib/ansible/modules/network/eos/eos_eapi.py | 30 ++++----------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/lib/ansible/modules/network/eos/eos_eapi.py b/lib/ansible/modules/network/eos/eos_eapi.py index 7edbe3fcda6..79d1c541eec 100644 --- a/lib/ansible/modules/network/eos/eos_eapi.py +++ b/lib/ansible/modules/network/eos/eos_eapi.py @@ -113,14 +113,6 @@ options: required: false default: default version_added: "2.2" - qos: - description: - - The C(qos) argument configures the IP DSCP value to assign to - eAPI response packets. This argument accepts integer values - in the valid IP DSCP range of 0 to 63. - required: false - default: 0 - version_added: "2.2" config: description: - The module, by default, will connect to the remote device and @@ -256,11 +248,6 @@ def set_vrf(module, commands): module.fail_json(msg="vrf '%s' is not configured" % vrf) commands.append('vrf %s' % vrf) -def set_qos(module, commands): - if not 0 <= module.params['qos'] <= 63: - module.fail_json(msg='qos must be between 0 and 63') - commands.append('qos dscp %s' % module.params['qos']) - def get_config(module): contents = module.params['config'] if not contents: @@ -270,17 +257,11 @@ def get_config(module): return config def load_config(module, commands, result): - session = 'ansible_%s' % int(time.time()) commit = not module.check_mode - - diff = module.config.load_config(commands, session=session, commit=commit) - - # once the configuration is done, remove the config session and - # remove the session name from the result - module.cli(['no configure session %s' % session]) - - result['diff'] = dict(prepared=diff) - result['changed'] = diff is not None + diff = module.config.load_config(commands, commit=commit) + if diff: + result['diff'] = dict(prepared=diff) + result['changed'] = True def load(module, commands, result): candidate = NetworkConfig(indent=3) @@ -330,12 +311,11 @@ def main(): socket=dict(aliases=['enable_socket'], default=False, type='bool'), vrf=dict(default='default'), - qos=dict(default=0, type='int'), config=dict(), # Only allow use of transport cli when configuring eAPI - transport=dict(required=True, choices=['cli']), + transport=dict(default='cli', choices=['cli']), state=dict(default='started', choices=['stopped', 'started']), )