<font face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size="2"><div>Maybe, here some codes are worth thouhands of words:<br>keystone.catalog.backends.sql.Catalog:   <br>def get_catalog(self, user_id, tenant_id, metadata=None):<br>        d = dict(CONF.iteritems())<br>        d.update({'tenant_id': tenant_id,<br>                  'user_id': user_id})<br>        catalog = {}<br><br>        endpoints = [self.get_endpoint(e)<br>                     for e in self.list_endpoints()]<br>        for ep in endpoints:<br>            service = self.get_service(ep['service_id'])<br>            srv_type = service['type']<br>            srv_name = service['name']<br>            region = ep['region']<br><br>            if region not in catalog:<br>                catalog[region] = {}<br><br>            catalog[region][srv_type] = {}<br><br>            internal_url = ep['internalurl'].replace('$(', '%(')<br>            public_url = ep['publicurl'].replace('$(', '%(')<br>            admin_url = ep['adminurl'].replace('$(', '%(')<br>            catalog[region][srv_type]['name'] = srv_name<br>            catalog[region][srv_type]['publicURL'] = public_url % d<br>            catalog[region][srv_type]['adminURL'] = admin_url % d<br>            catalog[region][srv_type]['internalURL'] = internal_url % d<br><br>        return catalog<br><br></div><div><br><div><br></div><font color="#990099">-----openstack-bounces+gongysh=cn.ibm.com@lists.launchpad.net wrote: -----<br><br></font><blockquote style="padding-right: 0px; padding-left: 5px; margin-left: 5px; border-left: 2px solid #000000; margin-right: 0px;">To: Anne Gentle <a class="moz-txt-link-rfc2396E" href="mailto:anne@openstack.org"><anne@openstack.org></a><br>From: Pete Zaitcev <a class="moz-txt-link-rfc2396E" href="mailto:zaitcev@redhat.com"><zaitcev@redhat.com></a><br>Sent by: <a class="moz-txt-link-abbreviated" href="mailto:openstack-bounces+gongysh=cn.ibm.com@lists.launchpad.net">openstack-bounces+gongysh=cn.ibm.com@lists.launchpad.net</a><br>Date: 04/13/2012 06:44AM<br>Cc: Openstack Mail List <a class="moz-txt-link-rfc2396E" href="mailto:openstack@lists.launchpad.net"><openstack@lists.launchpad.net></a><br>Subject: Re: [Openstack] Endpoints problems<br><br><font face="Courier New,Courier,monospace" size="3">On Thu, 12 Apr 2012 15:28:21 -0500<br>Anne Gentle <a class="moz-txt-link-rfc2396E" href="mailto:anne@openstack.org"><anne@openstack.org></a> wrote:<br><br>> keystone --token 012345SECRET99TOKEN012345 --endpoint<br>> <a href="http://192.168.206.130:35357/v2.0">http://192.168.206.130:35357/v2.0</a> endpoint-create \<br>>[....]<br>>                        --internalurl<br>> <a href="http://192.168.206.130:8774/v2/$%28tenant_id%29s">http://192.168.206.130:8774/v2/$(tenant_id)s</a><br>> <br>> I haven't fixed this yet because I'm not sure if the $(tenant_id)s is<br>> literal or which tenant_id specifically to use (the Service tenant for the<br>> adminurl possibly)?<br><br>The expression "$(tenant_id)s" is really contained inside the pattern<br>in the database. It is substituded with a specific tennant ID when<br>an application makes its request. The weird syntax is inherited from<br>Python, where one can use constructs like %s or %(key)s.<br><br>-- Pete<br><br>_______________________________________________<br>Mailing list: <a href="https://launchpad.net/%7Eopenstack">https://launchpad.net/~openstack</a><br>Post to     : <a class="moz-txt-link-abbreviated" href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a><br>Unsubscribe : <a href="https://launchpad.net/%7Eopenstack">https://launchpad.net/~openstack</a><br>More help   : <a href="https://help.launchpad.net/ListHelp">https://help.launchpad.net/ListHelp</a><br><br></font> </blockquote><br></div></font> <br/>