unite the filtering done by glance client and s3

This commit is contained in:
Vishvananda Ishaya
2011-04-05 15:01:33 -07:00
parent dc57933d97
commit 5d8dcea6eb

View File

@@ -897,15 +897,14 @@ class ImageCommands(object):
def _register(self, container_format, disk_format, def _register(self, container_format, disk_format,
path, owner, name=None, is_public='T', path, owner, name=None, is_public='T',
architecture='x86_64', kernel_id=None, ramdisk_id=None): architecture='x86_64', kernel_id=None, ramdisk_id=None):
meta = {'is_public': True, meta = {'is_public': (is_public == 'T'),
'name': name, 'name': name,
'container_format': container_format, 'container_format': container_format,
'disk_format': disk_format, 'disk_format': disk_format,
'properties': {'image_state': 'available', 'properties': {'image_state': 'available',
'owner_id': owner, 'project_id': owner,
'architecture': architecture, 'architecture': architecture,
'image_location': 'local', 'image_location': 'local'}}
'is_public': (is_public == 'T')}}
if kernel_id: if kernel_id:
meta['properties']['kernel_id'] = int(kernel_id) meta['properties']['kernel_id'] = int(kernel_id)
if ramdisk_id: if ramdisk_id:
@@ -980,13 +979,12 @@ class ImageCommands(object):
disk_format = 'raw' disk_format = 'raw'
new = {'disk_format': disk_format, new = {'disk_format': disk_format,
'container_format': container_format, 'container_format': container_format,
'is_public': True, 'is_public': old['isPublic'],
'name': old['imageId'], 'name': old['imageId'],
'properties': {'image_state': old['imageState'], 'properties': {'image_state': old['imageState'],
'owner_id': old['imageOwnerId'], 'project_id': old['imageOwnerId'],
'architecture': old['architecture'], 'architecture': old['architecture'],
'image_location': old['imageLocation'], 'image_location': old['imageLocation']}}
'is_public': old['isPublic']}}
if old.get('kernelId'): if old.get('kernelId'):
new['properties']['kernel_id'] = self._lookup(old['kernelId']) new['properties']['kernel_id'] = self._lookup(old['kernelId'])
if old.get('ramdiskId'): if old.get('ramdiskId'):