def get_portal_by_name(self, portal_name):
portals = self.get_portals_list()<EOL>for p in portals:<EOL><INDENT>if portal_name == p[<NUM_LIT:1>]:<EOL><INDENT>self.set_portal_name( p[<NUM_LIT:1>] )<EOL>self.set_portal_id( p[<NUM_LIT:0>] )<EOL>self.set_portal_cik( p[<NUM_LIT:2>][<NUM_LIT:1>]['<STR_LIT:info>']['<STR_LIT:key>'] )<EOL>return p<EOL><DEDENT><DEDENT>return None<EOL>
Set active portal according to the name passed in 'portal_name'.

Returns dictionary of device 'serial_number: rid'