Skip to content

Commit

Permalink
Fix to ensure that tacacs servers are ordered (reverse) by priority i…
Browse files Browse the repository at this point in the history
…n pam.d's config. (#3322)

Present: Servers are listed in the same order as in redis-db
Fix: Save the sort o/p, hence use sorted list to write into pam.d's conf.
     As well convert priority to integer for use by sort.
  • Loading branch information
renukamanavalan committed Aug 9, 2019
1 parent 7b0389d commit fcdf62f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion files/image_config/hostcfgd/hostcfgd
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class AaaCfg(object):
server['ip'] = addr
server.update(self.tacplus_servers[addr])
servers_conf.append(server)
sorted(servers_conf, key=lambda t: t['priority'], reverse=True)
servers_conf = sorted(servers_conf, key=lambda t: int(t['priority']), reverse=True)

template_file = os.path.abspath(PAM_AUTH_CONF_TEMPLATE)
env = jinja2.Environment(loader=jinja2.FileSystemLoader('/'), trim_blocks=True)
Expand Down

0 comments on commit fcdf62f

Please sign in to comment.