Resolved trunk merge conflicts
This commit is contained in:
@@ -391,8 +391,8 @@ class ImagesResource(resource.Resource):
|
||||
image_location = get_argument(request, 'image_location', u'')
|
||||
|
||||
image_path = os.path.join(FLAGS.images_path, image_id)
|
||||
if not image_path.startswith(FLAGS.images_path) or \
|
||||
os.path.exists(image_path):
|
||||
if ((not image_path.startswith(FLAGS.images_path)) or
|
||||
os.path.exists(image_path)):
|
||||
LOG.audit(_("Not authorized to upload image: invalid directory "
|
||||
"%s"),
|
||||
image_path, context=request.context)
|
||||
|
||||
@@ -259,22 +259,25 @@ class Image(object):
|
||||
process_input=encrypted_key,
|
||||
check_exit_code=False)
|
||||
if err:
|
||||
raise exception.Error("Failed to decrypt private key: %s" % err)
|
||||
raise exception.Error(_("Failed to decrypt private key: %s")
|
||||
% err)
|
||||
iv, err = utils.execute(
|
||||
'openssl rsautl -decrypt -inkey %s' % cloud_private_key,
|
||||
process_input=encrypted_iv,
|
||||
check_exit_code=False)
|
||||
if err:
|
||||
raise exception.Error("Failed to decrypt initialization "
|
||||
"vector: %s" % err)
|
||||
raise exception.Error(_("Failed to decrypt initialization "
|
||||
"vector: %s") % err)
|
||||
|
||||
_out, err = utils.execute(
|
||||
'openssl enc -d -aes-128-cbc -in %s -K %s -iv %s -out %s'
|
||||
% (encrypted_filename, key, iv, decrypted_filename),
|
||||
check_exit_code=False)
|
||||
if err:
|
||||
raise exception.Error("Failed to decrypt image file %s : %s" %
|
||||
(encrypted_filename, err))
|
||||
raise exception.Error(_("Failed to decrypt image file "
|
||||
"%(image_file)s: %(err)s") %
|
||||
{'image_file': encrypted_filename,
|
||||
'err': err})
|
||||
|
||||
@staticmethod
|
||||
def untarzip_image(path, filename):
|
||||
|
||||
Reference in New Issue
Block a user