Commit Graph

17 Commits

Author SHA1 Message Date
Stephen Finucane 5636008dfe db: Update import location of declarative_base
This moved in 1.4.

Change-Id: Ie3d30669dffd80aa21025a7a407c373b80b2e3cc
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-07-24 17:14:22 +01:00
Julien Danjou 4d5330088f Replace oslo_utils.timeutils
This change introduces glance.common.timeutils that provides the
timeutils previously consumed from oslo_utils.

Oslo is deprecating some timeutils functionality which of Glance
depends on. Suggested replacement (isoformat) would break glance APIs
so it's cleaner to carry this functionality in Glance rather than
re-invent the wheel.

Co-Authored-By: Erno Kuvaja <jokke@usr.fi>
Co-Authored-By: Sabari Kumar Murugesan <smurugesan@vmware.com>

Change-Id: I91e1cc9a273249fd88749cecf21200f3f5e2bab1
2015-12-10 10:53:46 +00:00
Shuquan Huang c6f7d39e48 OpenStack typo
According to the word choice convention in
http://docs.openstack.org/contributor-guide/writing-style/word-choice.html
We should use OpenStack instead of Openstack.

Closes-bug: #1516634

Change-Id: If4fd264635549c5b21c80e91b606142c5f9ae3a4
2015-11-17 10:43:20 +08:00
Wayne Okuma 5369e86e8d Glance metadef tables need unique constraints.
Sometime during Kilo, the unique constraints on
metadef_namespaces (namespace)
metadef_objects(namespace_id, name)
metadef_properties(namespace_id, name)
metadef_tags(namespace_id, name)
metadef_resource_types(name)
were replaced with non-unique indices.

I believe this was done erroneously to make the migrate_repo/versions/scripts
match the db/sqlalchemy/models_metadef.py definitions. Unfortunately, the
schema scripts were correct with the unique constraints and what should have
changed was models_metadef.py.

This bug, puts one more migrate script in place which will rename any
duplicate records it finds to make them unique and then re-establishes
the unique constraints while dropping the non-unique indices. It also,
fixes models_metadef.py and adds in tests to attempt to create duplicates
which should result in an HTTPConflict.

Change-Id: Idf3569a27d64abea3ed6ec92fb77b36a4d6d5fd5
Closes-Bug: 1468946
2015-09-02 22:32:29 -07:00
Flavio Percoco 647d2895a7 Make utf8 the default charset for mysql
Newer versions of oslo_db added a sanity check to ensure that table's
charsets are utf8. This patch makes this change explicit and re-enables
the sanity check that was disabled in Ifffbdd50c38a1d25215faa6a966c2d2a63935711

Change-Id: Icbc41bd3964a6124d3e0d906cb85944fdc312844
Closes-bug: #1411489
2015-07-17 18:49:43 +00:00
Jenkins 86ea22a2db Merge "Add sync check for models_metadef" 2015-03-18 17:41:34 +00:00
Oleksii Chuprykov 2968b2213e Add sync check for models_metadef
Correct migrations to satisfy models_metadef.
Add nullable=False for json_schema in metadef_object
and metadef_property according to changes in
Change-Id: I2c574210f8d62c77a438afab83ff80f3e5bd2fe7
Set updated_at nullable=True due to problems
with setting default value NOW() for datetime
type for mysql (the same as in models.py).

Closes-Bug: #1365436

Change-Id: I5399923621913724914499aad9148a9410faa4ef
2015-03-11 15:21:18 +02:00
Louis Taylor e42fad7385 Move from oslo.db to oslo_db
oslo_db was moved out of the oslo namespace in
oslo.db>=1.4.0.

Change-Id: I13620d26ff12c55b2294b3b051669e0e98513a10
Related-to: blueprint drop-namespace-packages
2015-01-12 19:03:20 +00:00
Louis Taylor 41d45dfb1c Move from oslo.utils to oslo_utils
oslo_utils has been moved out of the oslo namespace.

bp drop-namespace-packages

Change-Id: Ie818e72b31efd2a6ab182444967bdfaca9366f4a
2015-01-09 20:01:42 +00:00
Wayne Okuma c7fa300cc5 Adding Metadef Tag support
Adding rest api and db support for CRUD operations on the new
metadef_tags table.

Implements: https://blueprints.launchpad.net/glance/+spec/metadefs-tags
DocImpact

Change-Id: Icfa40555280ce69766381b0abe7ef399b806f6a0
2014-12-17 19:45:40 +00:00
Jenkins 8d81d80498 Merge "Refactor metadef ORM classes to use to_dict instead of as_dict" 2014-10-17 18:29:20 +00:00
Wayne Okuma 6a89a53c8f Metadef schema column name is a reserved word in MySQL
The metadef_properties and metadef_objects tables both have
a column named schema. Unfortunately, schema is a reserved word
in some relational database products, including MySQL and PostgreSQL.
The metadef_properties.schema and metadef_objects.schema
columns should be renamed to a non reserved word.

Change-Id: I9c1b497d2b09b9282a83bd8c19c32edfa4dd159f
Closes-Bug: 1378968
2014-10-08 23:48:41 -07:00
Wayne Okuma 824d9620b0 Metadef Property and Object schema columns should use JSONEncodedDict
The MetadefProperty and MetadefObject ORM classes currently specify the
JSON schema columns as type Text. It is preferred to use the
JSONEncodedDict Type Decorator instead. This fix also includes necessary
code changes to remove JSON encoding/decoding that was previously done
in other layers. Fixes for unit tests involving the schema columns are
also included.

Change-Id: I2c574210f8d62c77a438afab83ff80f3e5bd2fe7
Closes-Bug: 1368479
2014-10-07 12:28:59 -07:00
Julien Danjou 874e643549 Switch to oslo.utils
Change-Id: I47dc734c6d6e2ab99c25701ae3492acd5e442212
2014-10-07 14:55:57 +02:00
Wayne Okuma 7baa3d9ff8 Refactor metadef ORM classes to use to_dict instead of as_dict
The Metadef ORM base dictionary class should replace as_dict with to_dict
to be consistent with other Glance ORM classes.

Change-Id: I1550bd519f100cdffcf5046e9838cf192d4aac50
Closes-Bug: 1370058
2014-09-16 02:40:44 -07:00
Wayne Okuma 10e858d57b Specify the MetadefNamespace.namespace column is not nullable
The metadef_namespaces table definition indicates the namespace
column as not accepting nulls. The related MetadefNamespace ORM class
should also indicate that the namespace column does not accept nulls
with "nullable=False" in the column definition.

Change-Id: I681747b6579a2284f23bf154889a61c639b0616d
Closes-Bug: 1367619
2014-09-12 01:21:31 +00:00
Pawel Koniszewski 7454aac835 Glance Metadata Definitions Catalog - DB
Implements: blueprint metadata-schema-catalog

A common API hosted by the Glance service for vendors, admins,
services, and users to meaningfully define available key / value
pair and tag metadata. The intent is to enable better metadata
collaboration across artifacts, services, and projects for
OpenStack users.

This is about the definition of the available metadata that can
be used on different types of resources (images, artifacts,
volumes, flavors, aggregates, etc). A definition includes the
properties type, its key, it's description, and it's constraints.
This catalogue will not store the values for specific instance
properties.

Change-Id: I01cc63df3d3abe383c94cfb54598868b4bb729bb
DocImpact
Co-Authored-By: Lakshmi N Sampath <lakshmi.sampath@hp.com>
Co-Authored-By: Wayne Okuma <wayne.okuma@hp.com>
Co-Authored-By: Travis Tripp <travis.tripp@hp.com>
Co-Authored-By: Pawel Koniszewski <pawel.koniszewski@intel.com>
Co-Authored-By: Michal Jastrzebski <michal.jastrzebski@intel.com>
Co-Authored-By: Michal Dulko <michal.dulko@intel.com>
2014-08-28 10:45:53 -04:00