"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "glance/domain/__init__.py" between
glance-18.0.0.tar.gz and glance-19.0.0.tar.gz

About: OpenStack Glance (Core Service: Image Service) stores and retrieves virtual machine disk images. OpenStack Compute makes use of this during instance provisioning.
The "Train" series (latest release).

__init__.py  (glance-18.0.0):__init__.py  (glance-19.0.0)
skipping to change at line 17 skipping to change at line 17
# a copy of the License at # a copy of the License at
# #
# http://www.apache.org/licenses/LICENSE-2.0 # http://www.apache.org/licenses/LICENSE-2.0
# #
# Unless required by applicable law or agreed to in writing, software # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import collections # TODO(smcginnis) update this once six has support for collections.abc
# (https://github.com/benjaminp/six/pull/241) or clean up once we drop py2.7.
try:
from collections.abc import MutableMapping
except ImportError:
from collections import MutableMapping
import datetime import datetime
import uuid import uuid
from oslo_config import cfg from oslo_config import cfg
from oslo_log import log as logging from oslo_log import log as logging
from oslo_utils import excutils from oslo_utils import excutils
from oslo_utils import importutils from oslo_utils import importutils
import six import six
from glance.common import exception from glance.common import exception
skipping to change at line 285 skipping to change at line 291
msg = (_("Not allowed to reactivate image in status '%s'") msg = (_("Not allowed to reactivate image in status '%s'")
% self.status) % self.status)
raise exception.Forbidden(message=msg) raise exception.Forbidden(message=msg)
def get_data(self, *args, **kwargs): def get_data(self, *args, **kwargs):
raise NotImplementedError() raise NotImplementedError()
def set_data(self, data, size=None, backend=None): def set_data(self, data, size=None, backend=None):
raise NotImplementedError() raise NotImplementedError()
class ExtraProperties(collections.MutableMapping, dict): class ExtraProperties(MutableMapping, dict):
def __getitem__(self, key): def __getitem__(self, key):
return dict.__getitem__(self, key) return dict.__getitem__(self, key)
def __setitem__(self, key, value): def __setitem__(self, key, value):
return dict.__setitem__(self, key, value) return dict.__setitem__(self, key, value)
def __delitem__(self, key): def __delitem__(self, key):
return dict.__delitem__(self, key) return dict.__delitem__(self, key)
skipping to change at line 355 skipping to change at line 361
class Task(object): class Task(object):
_supported_task_type = ('import', 'api_image_import') _supported_task_type = ('import', 'api_image_import')
_supported_task_status = ('pending', 'processing', 'success', 'failure') _supported_task_status = ('pending', 'processing', 'success', 'failure')
def __init__(self, task_id, task_type, status, owner, def __init__(self, task_id, task_type, status, owner,
expires_at, created_at, updated_at, expires_at, created_at, updated_at,
task_input, result, message): task_input, result, message):
if task_type not in self._supported_task_type: if task_type not in self._supported_task_type:
raise exception.InvalidTaskType(task_type) raise exception.InvalidTaskType(type=task_type)
if status not in self._supported_task_status: if status not in self._supported_task_status:
raise exception.InvalidTaskStatus(status) raise exception.InvalidTaskStatus(status=status)
self.task_id = task_id self.task_id = task_id
self._status = status self._status = status
self.type = task_type self.type = task_type
self.owner = owner self.owner = owner
self.expires_at = expires_at self.expires_at = expires_at
# NOTE(nikhil): We use '_time_to_live' to determine how long a # NOTE(nikhil): We use '_time_to_live' to determine how long a
# task should live from the time it succeeds or fails. # task should live from the time it succeeds or fails.
task_time_to_live = CONF.task.task_time_to_live task_time_to_live = CONF.task.task_time_to_live
self._time_to_live = datetime.timedelta(hours=task_time_to_live) self._time_to_live = datetime.timedelta(hours=task_time_to_live)
 End of changes. 4 change blocks. 
4 lines changed or deleted 10 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)