3 í«„^ã@sHddlZddlmZmZddlmZddlmZGdd„deeeƒZdS)éNé)Ú MatchContextÚ MatchName)Ú PolicyQuery)Ú match_regexcsFeZdZdZdZedd„ƒZejdd„ƒZ‡fdd„Zdd „Z ‡Z S) ÚIbendportconQueryav Infiniband endport context query. Parameter: policy The policy to query. Keyword Parameters/Class attributes: name The name of the network interface to match. name_regex If true, regular expression matching will be used for matching the name. port The port number to match. user The criteria to match the context's user. user_regex If true, regular expression matching will be used on the user. role The criteria to match the context's role. role_regex If true, regular expression matching will be used on the role. type_ The criteria to match the context's type. type_regex If true, regular expression matching will be used on the type. range_ The criteria to match the context's range. range_subset If true, the criteria will match if it is a subset of the context's range. range_overlap If true, the criteria will match if it overlaps any of the context's range. range_superset If true, the criteria will match if it is a superset of the context's range. range_proper If true, use proper superset/subset operations. No effect if not using set operations. NcCs|jS)N)Ú_port)Úself©r ú)/usr/lib64/python3.6/ibendportconquery.pyÚport=szIbendportconQuery.portcCs>|r4t|ƒ}d|kodkns,tdƒ‚||_nd|_dS)NrézEndport value must be 1-255.)ÚintÚ ValueErrorr)r ÚvalueZ pending_valuer r r r As c s$tt|ƒj|f|Žtjtƒ|_dS)N)ÚsuperrÚ__init__ÚloggingZ getLoggerÚ__name__Úlog)r ÚpolicyÚkwargs)Ú __class__r r rLszIbendportconQuery.__init__ccsœ|jjdj|ƒƒ|j|jƒ|jjdj|ƒƒ|j|jƒxZ|jjƒD]L}|jrht |j|j|j ƒ rhqH|j dk r€|j |j kr€qH|j |j ƒsŽqH|VqHWdS)z2Generator which yields all matching ibendportcons.z/Generating ibendportcon results from {0.policy}zPort: {0.port!r}N)rÚinfoÚformatZ_match_name_debugÚdebugZ_match_context_debugrZ ibendportconsÚnamerZ name_regexr Z_match_contextÚcontext)r Zendportr r r ÚresultsPs    zIbendportconQuery.results) rÚ __module__Ú __qualname__Ú__doc__rÚpropertyr ÚsetterrrÚ __classcell__r r )rr rs   r) rZmixinsrrZqueryrÚutilrrr r r r Ús