Ejemplo n.º 1
0
 def handle(self, request, data):
     image_id = data['image_id']
     try:
         api.image_update(request, image_id,
                 image_meta={'is_public': False})
     except tank_exception.ClientConnectionError, e:
         LOG.exception("Error connecting to tank")
         messages.error(request,
                        _("Error connecting to tank: %s") % e.message)
Ejemplo n.º 2
0
 def handle(self, request, data):
     image_id = data['image_id']
     try:
         api.image_update(request,
                          image_id,
                          image_meta={'is_public': False})
     except tank_exception.ClientConnectionError, e:
         LOG.exception("Error connecting to tank")
         messages.error(request,
                        _("Error connecting to tank: %s") % e.message)
Ejemplo n.º 3
0
         'disk_format': image_form['disk_format'],
         'container_format': image_form['container_format'],
         'name': image_form['name'],
     }
     try:
         # TODO add public flag to properties
         metadata['properties'] = {}
         if image_form['kernel']:
             metadata['properties']['kernel_id'] = image_form['kernel']
         if image_form['ramdisk']:
             metadata['properties']['ramdisk_id'] = \
                     image_form['ramdisk']
         if image_form['architecture']:
             metadata['properties']['architecture'] = \
                     image_form['architecture']
         api.image_update(request, image_id, metadata)
         messages.success(request, _("Image was successfully updated."))
     except tank_exception.ClientConnectionError, e:
         LOG.exception("Error connecting to tank")
         messages.error(request,
                        _("Error connecting to tank: %s") % e.message)
     except tank_exception.Error, e:
         LOG.exception('Error updating image with id "%s"' % image_id)
         messages.error(request,
                        _("Error updating image: %s") % e.message)
     except:
         LOG.exception('Unspecified Exception in image update')
         messages.error(request,
                     _("Image could not be updated, please try again."))
     return shortcuts.redirect('syspanel_images_update', image_id)
 else: