Activity log for bug #1404073

Date Who What changed Old value New value Message
2014-12-19 00:58:26 Lin Hua Cheng bug added bug
2014-12-19 00:58:31 Lin Hua Cheng python-openstackclient: assignee Lin Hua Cheng (lin-hua-cheng)
2014-12-19 19:41:58 Steve Martinelli summary name should be optional for service-create type should be required for v2.0 service create
2014-12-19 19:42:07 Steve Martinelli bug task added python-keystoneclient
2014-12-19 19:42:17 Steve Martinelli bug task added keystone
2014-12-19 19:50:58 Steve Martinelli description According to the api http://specs.openstack.org/openstack/keystone-specs/api/v3/identity-api-v3.html only the service type is mandatory. name, description and enabled field are optional. openstack-client should not require the name as it is optional in the service, this is to make the validation consistent. $ openstack service create --type service_type_1 usage: openstack service create [-h] [-f {html,json,shell,table,value,yaml}] [-c COLUMN] [--max-width <integer>] [--prefix PREFIX] --type <service-type> [--description <service-description>] <service-name> openstack service create: error: too few arguments Type should be the only field required and name should be optional. This is for keystone v3. For v2.0, the API says the following, but is unclear about what is required vs. optional http://developer.openstack.org/api-ref-identity-v2.html { "OS-KSADM:service": { "id": "123", "name": "nova", "type": "compute", "description": "OpenStack Compute Service" } } Based on the v3 API, type should be the only argument that is required. However, looking at what is implemented, there is very little validation going on. 'id' is assigned set at the controller level: https://github.com/openstack/keystone/blob/master/keystone/catalog/controllers.py#L53-L60 And 'enabled' which is missing from the API is set at the manager level: https://github.com/openstack/keystone/blob/master/keystone/catalog/core.py#L145-L147 There is no validation performed at any level, leaving it up to the backends, for the SQL backend for instance, only 'enabled' is required: https://github.com/openstack/keystone/blob/master/keystone/catalog/backends/sql.py#L57-L65 class Service(sql.ModelBase, sql.DictBase): __tablename__ = 'service' attributes = ['id', 'type', 'enabled'] id = sql.Column(sql.String(64), primary_key=True) type = sql.Column(sql.String(255)) enabled = sql.Column(sql.Boolean, nullable=False, default=True, server_default=sqlalchemy.sql.expression.true()) extra = sql.Column(sql.JsonBlob()) endpoints = sqlalchemy.orm.relationship("Endpoint", backref="service") Which means the following call works, and is very useless: $ http post http://localhost:35357/v2.0/OS-KSADM/services '{"OS-KSADM:service": {}}' --x-auth-token=ADMIN { "OS-KSADM:service": { "type": null, "enabled": true, "id": "fe937fd1152f494d88edd89e3adbfe1f" } } Keystoneclient requires name, type and description. https://github.com/openstack/python-keystoneclient/blob/master/keystoneclient/v2_0/services.py#L38-L43 It should probably at least default some of those to None. Lastly OpenstackClient has only 'name' as a required argument. $ openstack service create --type service_type_1 usage: openstack service create [-h] [-f {html,json,shell,table,value,yaml}]                                 [-c COLUMN] [--max-width <integer>]                                 [--prefix PREFIX] --type <service-type>                                 [--description <service-description>]                                 <service-name> openstack service create: error: too few arguments We should probably make this similar to v3, where the only required argument is 'type', and name/description are optional.
2014-12-20 00:56:46 Lin Hua Cheng python-keystoneclient: assignee Lin Hua Cheng (lin-hua-cheng)
2014-12-20 02:40:57 OpenStack Infra python-openstackclient: status New In Progress
2014-12-20 02:43:34 OpenStack Infra python-keystoneclient: status New In Progress
2015-01-03 00:47:29 OpenStack Infra python-openstackclient: status In Progress Fix Committed
2015-01-12 19:19:45 Dean Troyer python-openstackclient: milestone m7
2015-01-19 20:33:27 Dean Troyer python-openstackclient: status Fix Committed Fix Released
2015-01-27 17:59:53 OpenStack Infra python-keystoneclient: status In Progress Fix Committed
2015-02-09 04:37:14 Morgan Fainberg keystone: status New Won't Fix
2015-02-09 18:02:35 Morgan Fainberg python-keystoneclient: milestone 1.1.0
2015-02-09 18:05:58 Morgan Fainberg python-keystoneclient: importance Undecided Low
2015-02-09 18:08:34 Morgan Fainberg python-keystoneclient: status Fix Committed Fix Released