def get_hosting_device_resources(self, context, id, complementary_id,<EOL>tenant_id, mgmt_nw_id):
mgmt_port = None<EOL>query = context.session.query(models_v2.Port)<EOL>query = query.filter(expr.or_(<EOL>models_v2.Port.device_id == id,<EOL>models_v2.Port.device_owner == complementary_id))<EOL>for port in query:<EOL><INDENT>if port['<STR_LIT>'] != mgmt_nw_id:<EOL><INDENT>raise Exception<EOL><DEDENT>else:<EOL><INDENT>mgmt_port = port<EOL><DEDENT><DEDENT>return {'<STR_LIT>': mgmt_port}<EOL>
Returns information about all resources for a hosting device.