def unset_role(username, role):
 try:
  sendline('config terminal')
  role_line = 'no username {0} role {1}'.format(username, role)
  ret = sendline(role_line)
  sendline('end')
  sendline('copy running-config startup-config')
  return '\n'.join([role_line, ret])
 except TerminalException as e:
  log.error(e)
  return 'Failed to set password'

def unset_role ( username , role ) : try : sendline ( 'config terminal' ) role_line = 'no username {0} role {1}' . format ( username , role ) ret = sendline ( role_line ) sendline ( 'end' ) sendline ( 'copy running-config startup-config' ) return '\n' . join ( [ role_line , ret ] ) except TerminalException as e : log . error ( e ) return 'Failed to set password'
remove role from username .