Re: [Openstack] Endpoints problems
On Fri, 13 Apr 2012 04:24:56 + Justin Shepherd jshep...@rackspace.com wrote: And if i am reading the code correctly they support both of the following variable declarations: %(tennant_id)s $(tennant_id)s since it appears the code replaces $( with %( Exactly why documentation is important, since it codifies the intent and not artefacts of implementation. I only wish we had an implementation that left 's' for Python-like %(key)s, and supported a Make-like $(key) without 's'. However, putting it in post-Essex is going to break compatibility, so it's too late. -- Pete ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp
Re: [Openstack] Endpoints problems
I've tried to execute the following command: keystone --token ADMIN --endpoint http://192.168.100.142:35357/v2.0 endpoint-create --region RegionOne --service_id=1fd7b5f1add74aa4b6efc514fd153e72 --publicurl=http://192.168.100.142:8774/v2/$(tenant_id)s --adminurl=http://192.168.100.142:8774/v2/$(tenant_id)s --internalurl=http://192.168.100.142:8774/v2/$(tenant_id)s But I'm getting a tenant_id: command not found. When I list the endpoints all my url's are like http://192.168.100.142:8774/v2/s; for the created endpoint. Am I doing something wrong ? Thanks. From: a...@openstack.org Date: Thu, 12 Apr 2012 15:28:21 -0500 Subject: Re: [Openstack] Endpoints problems To: guib...@hotmail.com CC: openstack@lists.launchpad.net Hi Guilherme - Sorry you ran into a doc bug - https://bugs.launchpad.net/openstack-manuals/+bug/977905. Basically, the bug states that the nova endpoint definition should be: keystone --token 012345SECRET99TOKEN012345 --endpoint http://192.168.206.130:35357/v2.0 endpoint-create \ --region RegionOne \ --service_id=abc0f03c02904c24abdcc3b7910e2eed \ --publicurl http://192.168.206.130:8774/v2/$(tenant_id)s \ --adminurl http://192.168.206.130:8774/v2/$(tenant_id)s \ --internalurl http://192.168.206.130:8774/v2/$(tenant_id)s I haven't fixed this yet because I'm not sure if the $(tenant_id)s is literal or which tenant_id specifically to use (the Service tenant for the adminurl possibly)? If someone on the list could offer more input here and on the doc bug it would be greatly appreciated! Anne On Thu, Apr 12, 2012 at 12:25 PM, Guilherme Birk guib...@hotmail.com wrote: I'm having problems setting up the nova endpoint. I've followed the manual http://docs.openstack.org/trunk/openstack-compute/install/content/setting-up-tenants-users-and-roles.html, putting the tenant id on the url's, like the manual says to do. But when I try execute nova list I got a malformed url error. When I set the endpoint without the tenant id on the url's I got a 404 error. Anyone having the same problem? I can access the dashboard normally, but I'm unable to retrieve instance list. ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp
Re: [Openstack] Endpoints problems
Use single quotes, instead of double quotes. $() has a special meaning in bash.. it executes whatever is between the braces and substitutes the whole thing for the STDOUT of the command it ran... Thanks, Kiall On Fri, Apr 13, 2012 at 2:28 PM, Guilherme Birk guib...@hotmail.com wrote: I've tried to execute the following command: keystone --token ADMIN --endpoint http://192.168.100.142:35357/v2.0endpoint-create --region RegionOne --service_id=1fd7b5f1add74aa4b6efc514fd153e72 --publicurl= http://192.168.100.142:8774/v2/$(tenant_id)s --adminurl= http://192.168.100.142:8774/v2/$(tenant_id)s --internalurl= http://192.168.100.142:8774/v2/$(tenant_id)s But I'm getting a tenant_id: command not found. When I list the endpoints all my url's are like http://192.168.100.142:8774/v2/s; for the created endpoint. Am I doing something wrong ? Thanks. -- From: a...@openstack.org Date: Thu, 12 Apr 2012 15:28:21 -0500 Subject: Re: [Openstack] Endpoints problems To: guib...@hotmail.com CC: openstack@lists.launchpad.net Hi Guilherme - Sorry you ran into a doc bug - https://bugs.launchpad.net/openstack-manuals/+bug/977905. Basically, the bug states that the nova endpoint definition should be: keystone --token 012345SECRET99TOKEN012345 --endpoint http://192.168.206.130:35357/v2.0 endpoint-create \ --region RegionOne \ --service_id=abc0f03c02904c24abdcc3b7910e2eed \ --publicurl http://192.168.206.130:8774/v2/$(tenant_id)s \ --adminurl http://192.168.206.130:8774/v2/$(tenant_id)s \ --internalurl http://192.168.206.130:8774/v2/$(tenant_id)s I haven't fixed this yet because I'm not sure if the $(tenant_id)s is literal or which tenant_id specifically to use (the Service tenant for the adminurl possibly)? If someone on the list could offer more input here and on the doc bug it would be greatly appreciated! Anne On Thu, Apr 12, 2012 at 12:25 PM, Guilherme Birk guib...@hotmail.comwrote: I'm having problems setting up the nova endpoint. I've followed the manual http://docs.openstack.org/trunk/openstack-compute/install/content/setting-up-tenants-users-and-roles.html, putting the tenant id on the url's, like the manual says to do. But when I try execute nova list I got a malformed url error. When I set the endpoint without the tenant id on the url's I got a 404 error. Anyone having the same problem? I can access the dashboard normally, but I'm unable to retrieve instance list. ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp
Re: [Openstack] Endpoints problems
Thanks Kiall, that worked. Looks like my endpoints are working now, I can execute the nova list command without problems. Thanks all. From: ki...@managedit.ie Date: Fri, 13 Apr 2012 14:40:59 +0100 Subject: Re: [Openstack] Endpoints problems To: guib...@hotmail.com CC: openstack@lists.launchpad.net Use single quotes, instead of double quotes. $() has a special meaning in bash.. it executes whatever is between the braces and substitutes the whole thing for the STDOUT of the command it ran... Thanks, Kiall On Fri, Apr 13, 2012 at 2:28 PM, Guilherme Birk guib...@hotmail.com wrote: I've tried to execute the following command: keystone --token ADMIN --endpoint http://192.168.100.142:35357/v2.0 endpoint-create --region RegionOne --service_id=1fd7b5f1add74aa4b6efc514fd153e72 --publicurl=http://192.168.100.142:8774/v2/$(tenant_id)s --adminurl=http://192.168.100.142:8774/v2/$(tenant_id)s --internalurl=http://192.168.100.142:8774/v2/$(tenant_id)s But I'm getting a tenant_id: command not found. When I list the endpoints all my url's are like http://192.168.100.142:8774/v2/s; for the created endpoint. Am I doing something wrong ? Thanks. From: a...@openstack.org Date: Thu, 12 Apr 2012 15:28:21 -0500 Subject: Re: [Openstack] Endpoints problems To: guib...@hotmail.com CC: openstack@lists.launchpad.net Hi Guilherme - Sorry you ran into a doc bug - https://bugs.launchpad.net/openstack-manuals/+bug/977905. Basically, the bug states that the nova endpoint definition should be: keystone --token 012345SECRET99TOKEN012345 --endpoint http://192.168.206.130:35357/v2.0 endpoint-create \ --region RegionOne \ --service_id=abc0f03c02904c24abdcc3b7910e2eed \ --publicurl http://192.168.206.130:8774/v2/$(tenant_id)s \ --adminurl http://192.168.206.130:8774/v2/$(tenant_id)s \ --internalurl http://192.168.206.130:8774/v2/$(tenant_id)s I haven't fixed this yet because I'm not sure if the $(tenant_id)s is literal or which tenant_id specifically to use (the Service tenant for the adminurl possibly)? If someone on the list could offer more input here and on the doc bug it would be greatly appreciated! Anne On Thu, Apr 12, 2012 at 12:25 PM, Guilherme Birk guib...@hotmail.com wrote: I'm having problems setting up the nova endpoint. I've followed the manual http://docs.openstack.org/trunk/openstack-compute/install/content/setting-up-tenants-users-and-roles.html, putting the tenant id on the url's, like the manual says to do. But when I try execute nova list I got a malformed url error. When I set the endpoint without the tenant id on the url's I got a 404 error. Anyone having the same problem? I can access the dashboard normally, but I'm unable to retrieve instance list. ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp
Re: [Openstack] Endpoints problems
On Fri, Apr 13, 2012 at 8:28 AM, Guilherme Birk guib...@hotmail.com wrote: keystone --token ADMIN --endpoint http://192.168.100.142:35357/v2.0 endpoint-create --region RegionOne --service_id=1fd7b5f1add74aa4b6efc514fd153e72 --publicurl=http://192.168.100.142:8774/v2/$(tenant_id)s --adminurl=http://192.168.100.142:8774/v2/$(tenant_id)s --internalurl=http://192.168.100.142:8774/v2/$(tenant_id)s But I'm getting a tenant_id: command not found. When I list the endpoints all my url's are like http://192.168.100.142:8774/v2/s; for the created endpoint. Am I doing something wrong ? You need to escape the '$'s in your URLs or change the double quotes around them to single quotes. The shell sees the $(tenant_id) and attempts to execute a command called tenant_id. dt -- Dean Troyer dtro...@gmail.com ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp
Re: [Openstack] Endpoints problems
As far as my experience goes, you have to use %(tenant_id)s. I ran into this problem the first time I did it as well. $ makes the shell think it's a variable. David Kranz Quanta Research Cambridge On 4/13/2012 9:28 AM, Guilherme Birk wrote: I've tried to execute the following command: keystone --token ADMIN --endpoint http://192.168.100.142:35357/v2.0 endpoint-create --region RegionOne --service_id=1fd7b5f1add74aa4b6efc514fd153e72 --publicurl=http://192.168.100.142:8774/v2/$(tenant_id)s --adminurl=http://192.168.100.142:8774/v2/$(tenant_id)s --internalurl=http://192.168.100.142:8774/v2/$(tenant_id)s But I'm getting a tenant_id: command not found. When I list the endpoints all my url's are like http://192.168.100.142:8774/v2/s; for the created endpoint. Am I doing something wrong ? Thanks. From: a...@openstack.org Date: Thu, 12 Apr 2012 15:28:21 -0500 Subject: Re: [Openstack] Endpoints problems To: guib...@hotmail.com CC: openstack@lists.launchpad.net Hi Guilherme - Sorry you ran into a doc bug - https://bugs.launchpad.net/openstack-manuals/+bug/977905. Basically, the bug states that the nova endpoint definition should be: keystone --token 012345SECRET99TOKEN012345 --endpoint http://192.168.206.130:35357/v2.0 endpoint-create \ --region RegionOne \ --service_id=abc0f03c02904c24abdcc3b7910e2eed \ --publicurl http://192.168.206.130:8774/v2/$(tenant_id)s http://192.168.206.130:8774/v2/%24%28tenant_id%29s \ --adminurl http://192.168.206.130:8774/v2/$(tenant_id)s http://192.168.206.130:8774/v2/%24%28tenant_id%29s \ --internalurl http://192.168.206.130:8774/v2/$(tenant_id)s http://192.168.206.130:8774/v2/%24%28tenant_id%29s I haven't fixed this yet because I'm not sure if the $(tenant_id)s is literal or which tenant_id specifically to use (the Service tenant for the adminurl possibly)? If someone on the list could offer more input here and on the doc bug it would be greatly appreciated! Anne On Thu, Apr 12, 2012 at 12:25 PM, Guilherme Birk guib...@hotmail.com mailto:guib...@hotmail.com wrote: I'm having problems setting up the nova endpoint. I've followed the manual http://docs.openstack.org/trunk/openstack-compute/install/content/setting-up-tenants-users-and-roles.html, putting the tenant id on the url's, like the manual says to do. But when I try execute nova list I got a malformed url error. When I set the endpoint without the tenant id on the url's I got a 404 error. Anyone having the same problem? I can access the dashboard normally, but I'm unable to retrieve instance list. ___ Mailing list: https://launchpad.net/~openstack https://launchpad.net/%7Eopenstack Post to : openstack@lists.launchpad.net mailto:openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack https://launchpad.net/%7Eopenstack More help : https://help.launchpad.net/ListHelp ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp
Re: [Openstack] Endpoints problems
On Fri, 13 Apr 2012 13:28:36 + Guilherme Birk guib...@hotmail.com wrote: keystone --token ADMIN --publicurl=http://192.168.100.142:8774/v2/$(tenant_id)s But I'm getting a tenant_id: command not found. Shell expands variables in the double quote () strings, so you have to use single quote ('). -- Pete ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp
Re: [Openstack] Endpoints problems
I would be surprised if you could simply interchange the $ with a %.. Never tried it though! Anyway - $ is defiantly the correct character to use: https://github.com/openstack-dev/devstack/blob/master/files/default_catalog.templates Thanks, Kiall On Fri, Apr 13, 2012 at 2:48 PM, David Kranz david.kr...@qrclab.com wrote: As far as my experience goes, you have to use %(tenant_id)s. I ran into this problem the first time I did it as well. $ makes the shell think it's a variable. David Kranz Quanta Research Cambridge On 4/13/2012 9:28 AM, Guilherme Birk wrote: I've tried to execute the following command: keystone --token ADMIN --endpoint http://192.168.100.142:35357/v2.0endpoint-create --region RegionOne --service_id=1fd7b5f1add74aa4b6efc514fd153e72 --publicurl= http://192.168.100.142:8774/v2/$(tenant_id)shttp://192.168.100.142:8774/v2/$(tenant_id)s--adminurl= http://192.168.100.142:8774/v2/$(tenant_id)shttp://192.168.100.142:8774/v2/$(tenant_id)s--internalurl= http://192.168.100.142:8774/v2/$(tenant_id)shttp://192.168.100.142:8774/v2/$(tenant_id)s But I'm getting a tenant_id: command not found. When I list the endpoints all my url's are like http://192.168.100.142:8774/v2/s;http://192.168.100.142:8774/v2/sfor the created endpoint. Am I doing something wrong ? Thanks. -- From: a...@openstack.org Date: Thu, 12 Apr 2012 15:28:21 -0500 Subject: Re: [Openstack] Endpoints problems To: guib...@hotmail.com CC: openstack@lists.launchpad.net Hi Guilherme - Sorry you ran into a doc bug - https://bugs.launchpad.net/openstack-manuals/+bug/977905. Basically, the bug states that the nova endpoint definition should be: keystone --token 012345SECRET99TOKEN012345 --endpoint http://192.168.206.130:35357/v2.0 endpoint-create \ --region RegionOne \ --service_id=abc0f03c02904c24abdcc3b7910e2eed \ --publicurl http://192.168.206.130:8774/v2/$(tenant_id)s \ --adminurl http://192.168.206.130:8774/v2/$(tenant_id)s \ --internalurl http://192.168.206.130:8774/v2/$(tenant_id)s I haven't fixed this yet because I'm not sure if the $(tenant_id)s is literal or which tenant_id specifically to use (the Service tenant for the adminurl possibly)? If someone on the list could offer more input here and on the doc bug it would be greatly appreciated! Anne On Thu, Apr 12, 2012 at 12:25 PM, Guilherme Birk guib...@hotmail.comwrote: I'm having problems setting up the nova endpoint. I've followed the manual http://docs.openstack.org/trunk/openstack-compute/install/content/setting-up-tenants-users-and-roles.html, putting the tenant id on the url's, like the manual says to do. But when I try execute nova list I got a malformed url error. When I set the endpoint without the tenant id on the url's I got a 404 error. Anyone having the same problem? I can access the dashboard normally, but I'm unable to retrieve instance list. ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp
Re: [Openstack] Endpoints problems
So why would the preferred method be the one that you have to do all sort of magic stuff to protect from bash extrapolation.. and also given that the code converts those to %(tenant_id).. why wouldn't the %( way be the preferred way? Sounds like an artifact of the CLI being a second class use case.. --shep On Apr 13, 2012, at 8:48 AM, Dean Troyer wrote: On Fri, Apr 13, 2012 at 8:28 AM, Guilherme Birk guib...@hotmail.com wrote: keystone --token ADMIN --endpoint http://192.168.100.142:35357/v2.0 endpoint-create --region RegionOne --service_id=1fd7b5f1add74aa4b6efc514fd153e72 --publicurl=http://192.168.100.142:8774/v2/$(tenant_id)s --adminurl=http://192.168.100.142:8774/v2/$(tenant_id)s --internalurl=http://192.168.100.142:8774/v2/$(tenant_id)s But I'm getting a tenant_id: command not found. When I list the endpoints all my url's are like http://192.168.100.142:8774/v2/s; for the created endpoint. Am I doing something wrong ? You need to escape the '$'s in your URLs or change the double quotes around them to single quotes. The shell sees the $(tenant_id) and attempts to execute a command called tenant_id. dt -- Dean Troyer dtro...@gmail.com ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp
Re: [Openstack] Endpoints problems
On 04/13/2012 10:50 AM, Dolph Mathews wrote: While $(tenant_id)s is certainly the documented syntax, it appears that the SQL catalog backend (and *only* the SQL catalog backend, as far as I can tell) explicitly supports both $(tenant_id)s and %(tenant_id)s: https://github.com/openstack/keystone/blob/master/keystone/catalog/backends/sql.py#L163 Perhaps Adam Gandelman has some insight? -Dolph Dolph- No, the same is supported in the case of templated catalog as well, which is what the SQL catalog was largely based off: https://github.com/openstack/keystone/blob/master/keystone/catalog/backends/templated.py#L115 Just tested that sed -i 's/\$/%/g' /etc/keystone/default_catalog.templates still produces a functional service catalog when configured to use the templated backend. Seeing as both are supported, perhaps it would be better for docs to be updated to refer to the use of % instead of $ to avoid people running into problems with the $() sub-shell? Adam ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp
Re: [Openstack] Endpoints problems
On Thu, 12 Apr 2012 15:28:21 -0500 Anne Gentle a...@openstack.org wrote: keystone --token 012345SECRET99TOKEN012345 --endpoint http://192.168.206.130:35357/v2.0 endpoint-create \ [] --internalurl http://192.168.206.130:8774/v2/$(tenant_id)s I haven't fixed this yet because I'm not sure if the $(tenant_id)s is literal or which tenant_id specifically to use (the Service tenant for the adminurl possibly)? The expression $(tenant_id)s is really contained inside the pattern in the database. It is substituded with a specific tennant ID when an application makes its request. The weird syntax is inherited from Python, where one can use constructs like %s or %(key)s. -- Pete ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp
Re: [Openstack] Endpoints problems
Maybe, here some codes are worth thouhands of words:keystone.catalog.backends.sql.Catalog: def get_catalog(self, user_id, tenant_id, metadata=None): d = dict(CONF.iteritems()) d.update({'tenant_id': tenant_id, 'user_id': user_id}) catalog = {} endpoints = [self.get_endpoint(e) for e in self.list_endpoints()] for ep in endpoints: service = self.get_service(ep['service_id']) srv_type = service['type'] srv_name = service['name'] region = ep['region'] if region not in catalog: catalog[region] = {} catalog[region][srv_type] = {} internal_url = ep['internalurl'].replace('$(', '%(') public_url = ep['publicurl'].replace('$(', '%(') admin_url = ep['adminurl'].replace('$(', '%(') catalog[region][srv_type]['name'] = srv_name catalog[region][srv_type]['publicURL'] = public_url % d catalog[region][srv_type]['adminURL'] = admin_url % d catalog[region][srv_type]['internalURL'] = internal_url % d return catalog-openstack-bounces+gongysh=cn.ibm@lists.launchpad.net wrote: -To: Anne Gentle a...@openstack.orgFrom: Pete Zaitcev zait...@redhat.comSent by: openstack-bounces+gongysh=cn.ibm@lists.launchpad.netDate: 04/13/2012 06:44AMCc: Openstack Mail List openstack@lists.launchpad.netSubject: Re: [Openstack] Endpoints problemsOn Thu, 12 Apr 2012 15:28:21 -0500Anne Gentle a...@openstack.org wrote: keystone --token 012345SECRET99TOKEN012345 --endpoint http://192.168.206.130:35357/v2.0endpoint-create \[]--internalurl http://192.168.206.130:8774/v2/$(tenant_id)s I haven't fixed this yet because I'm not sure if the $(tenant_id)s is literal or which tenant_id specifically to use (the Service tenant for the adminurl possibly)?The _expression_ "$(tenant_id)s" is really contained inside the patternin the database. It is substituded with a specific tennant ID whenan application makes its request. The weird syntax is inherited fromPython, where one can use constructs like %s or %(key)s.-- Pete___Mailing list: https://launchpad.net/~openstackPost to : openstack@lists.launchpad.netUnsubscribe : https://launchpad.net/~openstackMore help : https://help.launchpad.net/ListHelp ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp
Re: [Openstack] Endpoints problems
On Apr 12, 2012, at 6:44 PM, Pete Zaitcev wrote: On Thu, 12 Apr 2012 15:28:21 -0500 Anne Gentle a...@openstack.org wrote: keystone --token 012345SECRET99TOKEN012345 --endpoint http://192.168.206.130:35357/v2.0 endpoint-create \ [] --internalurl http://192.168.206.130:8774/v2/$(tenant_id)s I haven't fixed this yet because I'm not sure if the $(tenant_id)s is literal or which tenant_id specifically to use (the Service tenant for the adminurl possibly)? The expression $(tenant_id)s is really contained inside the pattern in the database. It is substituded with a specific tennant ID when an application makes its request. The weird syntax is inherited from Python, where one can use constructs like %s or %(key)s. My understanding (based on somebody's previous answer in the mailing list, or possibly one of the IRC channels) was that you could only do this with the template backend, and when you were using the database backend you had to explicitly add endpoints for each tenant that needed to talk to the API. Can you confirm that you can use the $(tenant_id)s syntax when the backend is set using the following keystone.conf entry: [catalog] driver = keystone.catalog.backends.sql.Catalog Take care, Lorin -- Lorin Hochstein Lead Architect - Cloud Services Nimbis Services, Inc. www.nimbisservices.com ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp
Re: [Openstack] Endpoints problems
On Thu, 12 Apr 2012 22:33:38 -0400 Lorin Hochstein lo...@nimbisservices.com wrote: My understanding (based on somebody's previous answer in the mailing list, or possibly one of the IRC channels) was that you could only do this with the template backend, and when you were using the database backend you had to explicitly add endpoints for each tenant that needed to talk to the API. Can you confirm that you can use the $(tenant_id)s syntax when the backend is set using the following keystone.conf entry: [catalog] driver = keystone.catalog.backends.sql.Catalog The thought that the substitution may not work never occured to me. I have the following in keystone.conf: [catalog] # dynamic, sql-based backend (supports API/CLI-based management commands) driver = keystone.catalog.backends.sql.Catalog template_file = /etc/keystone/default_catalog.templates # static, file-based backend (does *NOT* support any management commands) #driver = keystone.catalog.backends.templated.TemplatedCatalog #template_file = ./etc/default_catalog.templates And I run the following command as a part of re-population script: ## Without proxy: #$keystone endpoint-create --region RegionOne --service_id $SSID \ #--publicurl 'http://kvm-rei.zaitcev.lan/v1/AUTH_$(tenant_id)s' \ #--adminurl 'http://kvm-rei.zaitcev.lan/v1.0/' \ #--internalurl 'http://kvm-rei.zaitcev.lan/v1/AUTH_$(tenant_id)s' # With SSL proxy at kvm-san: $keystone endpoint-create --region RegionOne --service_id $SSID \ --adminurl 'http://kvm-rei.zaitcev.lan/v1.0/' \ --publicurl 'https://kvm-san.zaitcev.lan/v1/AUTH_$(tenant_id)s' \ --internalurl 'http://kvm-rei.zaitcev.lan/v1/AUTH_$(tenant_id)s' Everything seems to work. Also see Yong-Sheng's message about the source code. -- Pete ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp
Re: [Openstack] Endpoints problems
On Fri, 13 Apr 2012 08:11:28 +0800 Yong Sheng Gong gong...@cn.ibm.com wrote: Maybe, here some codes are worth thouhands of words: I quite agree. On the other hand, does Anne care to read it? She needs a concise answer as to what command to document precisely, if I understad her query right. d = dict(CONF.iteritems()) d.update({'tenant_id': tenant_id, 'user_id': user_id}) catalog = {} It would be great if we kept track of available keys in a document somewhere. Of course, the source is open. That's how I found my forgotten 's'. But still, it's a hurdle to clear for some. -- Pete ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp
Re: [Openstack] Endpoints problems
So looking at the code.. both templated and sql backends seem to support the variable substitution. And if i am reading the code correctly they support both of the following variable declarations: %(tennant_id)s $(tennant_id)s since it appears the code replaces $( with %( --shep On Apr 12, 2012, at 9:33 PM, Lorin Hochstein wrote: On Apr 12, 2012, at 6:44 PM, Pete Zaitcev wrote: On Thu, 12 Apr 2012 15:28:21 -0500 Anne Gentle a...@openstack.orgmailto:a...@openstack.org wrote: keystone --token 012345SECRET99TOKEN012345 --endpoint http://192.168.206.130:35357/v2.0 endpoint-create \ [] --internalurl http://192.168.206.130:8774/v2/$(tenant_id)s I haven't fixed this yet because I'm not sure if the $(tenant_id)s is literal or which tenant_id specifically to use (the Service tenant for the adminurl possibly)? The expression $(tenant_id)s is really contained inside the pattern in the database. It is substituded with a specific tennant ID when an application makes its request. The weird syntax is inherited from Python, where one can use constructs like %s or %(key)s. My understanding (based on somebody's previous answer in the mailing list, or possibly one of the IRC channels) was that you could only do this with the template backend, and when you were using the database backend you had to explicitly add endpoints for each tenant that needed to talk to the API. Can you confirm that you can use the $(tenant_id)s syntax when the backend is set using the following keystone.conf entry: [catalog] driver = keystone.catalog.backends.sql.Catalog Take care, Lorin -- Lorin Hochstein Lead Architect - Cloud Services Nimbis Services, Inc. www.nimbisservices.comhttps://www.nimbisservices.com/ ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.netmailto:openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp
Re: [Openstack] Endpoints problems
Here is one sample keystone default_catalog.templates which defines some services. In fact I think for SQL, we need use keystone client to add them into SQL DB.# config for TemplatedCatalog, using camelCase because I don't want to do# translations for keystone compatcatalog.RegionOne.identity.publicURL = http://controlnode:$(public_port)s/v2.0catalog.RegionOne.identity.adminURL = http://controlnode:$(admin_port)s/v2.0catalog.RegionOne.identity.internalURL = http://controlnode:$(public_port)s/v2.0catalog.RegionOne.identity.name = Identity Service# fake compute service for now to help novaclient tests workcatalog.RegionOne.compute.publicURL = http://controlnode:$(compute_port)s/v1.1/$(tenant_id)scatalog.RegionOne.compute.adminURL = http://controlnode:$(compute_port)s/v1.1/$(tenant_id)scatalog.RegionOne.compute.internalURL = http://controlnode:$(compute_port)s/v1.1/$(tenant_id)scatalog.RegionOne.compute.name = Compute Servicecatalog.RegionOne.volume.publicURL = http://controlnode:8776/v1/$(tenant_id)scatalog.RegionOne.volume.adminURL = http://controlnode:8776/v1/$(tenant_id)scatalog.RegionOne.volume.internalURL = http://controlnode:8776/v1/$(tenant_id)scatalog.RegionOne.volume.name = Volume Servicecatalog.RegionOne.ec2.publicURL = http://controlnode:8773/services/Cloudcatalog.RegionOne.ec2.adminURL = http://controlnode:8773/services/Admincatalog.RegionOne.ec2.internalURL = http://controlnode:8773/services/Cloudcatalog.RegionOne.ec2.name = EC2 Servicecatalog.RegionOne.image.publicURL = http://controlnode:9292/v1catalog.RegionOne.image.adminURL = http://controlnode:9292/v1catalog.RegionOne.image.internalURL = http://controlnode:9292/v1catalog.RegionOne.image.name = Image Service-openstack-bounces+gongysh=cn.ibm@lists.launchpad.net wrote: -To: Pete Zaitcev zait...@redhat.comFrom: Anne Gentle a...@openstack.orgSent by: openstack-bounces+gongysh=cn.ibm@lists.launchpad.netDate: 04/13/2012 12:33PMCc: Openstack Mail List openstack@lists.launchpad.netSubject: Re: [Openstack] Endpoints problemsThanks all! And thanks for not saying "It's a Python Thing You Wouldn't Understand." :)Yeah I do want a definitive answer but it's always good for me to learn to read code. Then again, things like replace('$(', '%(') make me go hmm... One last clarification, this $(tenant_id)s should be used for both nova and volume endpoints, right?Thanks,AnneOn Thu, Apr 12, 2012 at 5:44 PM, Pete Zaitcev zait...@redhat.com wrote: On Thu, 12 Apr 2012 15:28:21 -0500 Anne Gentle a...@openstack.org wrote: keystone --token 012345SECRET99TOKEN012345 --endpoint http://192.168.206.130:35357/v2.0 endpoint-create \ [] --internalurl http://192.168.206.130:8774/v2/$(tenant_id)s I haven't fixed this yet because I'm not sure if the $(tenant_id)s is literal or which tenant_id specifically to use (the Service tenant for the adminurl possibly)? The _expression_ "$(tenant_id)s" is really contained inside the pattern in the database. It is substituded with a specific tennant ID when an application makes its request. The weird syntax is inherited from Python, where one can use constructs like %s or %(key)s. -- Pete ___Mailing list: https://launchpad.net/~openstackPost to : openstack@lists.launchpad.netUnsubscribe : https://launchpad.net/~openstackMore help : https://help.launchpad.net/ListHelp ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp
Re: [Openstack] Endpoints problems
Hi, From: openstack-bounces+atul.jha=csscorp@lists.launchpad.net [openstack-bounces+atul.jha=csscorp@lists.launchpad.net] on behalf of Anne Gentle [a...@openstack.org] Sent: Friday, April 13, 2012 10:03 AM To: Pete Zaitcev Cc: Openstack Mail List Subject: Re: [Openstack] Endpoints problems Thanks all! And thanks for not saying It's a Python Thing You Wouldn't Understand. :) Yeah I do want a definitive answer but it's always good for me to learn to read code. Then again, things like replace('$(', '%(') make me go hmm... One last clarification, this $(tenant_id)s should be used for both nova and volume endpoints, right? Yes. Nova-volume and Swift as well. Thanks, Anne On Thu, Apr 12, 2012 at 5:44 PM, Pete Zaitcev zait...@redhat.commailto:zait...@redhat.com wrote: On Thu, 12 Apr 2012 15:28:21 -0500 Anne Gentle a...@openstack.orgmailto:a...@openstack.org wrote: keystone --token 012345SECRET99TOKEN012345 --endpoint http://192.168.206.130:35357/v2.0 endpoint-create \ [] --internalurl http://192.168.206.130:8774/v2/$(tenant_id)shttp://192.168.206.130:8774/v2/$%28tenant_id%29s I haven't fixed this yet because I'm not sure if the $(tenant_id)s is literal or which tenant_id specifically to use (the Service tenant for the adminurl possibly)? The expression $(tenant_id)s is really contained inside the pattern in the database. It is substituded with a specific tennant ID when an application makes its request. The weird syntax is inherited from Python, where one can use constructs like %s or %(key)s. -- Pete http://www.csscorp.com/common/email-disclaimer.php ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp