Fixes to httpapi for EAPI (#40675)

* Replace errant uses of str

* Hook up become to eapi

* Hook become up to nxapi, too
This commit is contained in:
Nathaniel Case 2018-05-24 14:25:19 -04:00 committed by GitHub
commit 0ad4b7b785
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 36 additions and 17 deletions

View file

@ -100,7 +100,7 @@ def map_obj_to_commands(updates, module):
state = module.params['state']
if state == 'absent' and have.get('text'):
if isinstance(have['text'], str):
if isinstance(have['text'], string_types):
commands.append('no banner %s' % module.params['banner'])
elif have['text'].get('loginBanner') or have['text'].get('motd'):
commands.append({'cmd': 'no banner %s' % module.params['banner']})
@ -147,7 +147,7 @@ def map_config_to_obj(module):
def map_params_to_obj(module):
text = module.params['text']
if text:
text = str(text).strip()
text = to_text(text).strip()
return {
'banner': module.params['banner'],