尝试上传到S3存储桶时出现错误“ PUT的本地对象不存在”

时间:2019-04-22 14:14:12

标签: amazon-s3 ansible

我正在尝试使用Ansible将一些文件从我的AWS EC2实例上传到S3存储桶。我不断收到此错误“ PUT的本地对象不存在”。

parameterizedSparql.toString()
  

“ msg”:“ PUT的本地对象不存在”

这是文件位置:

                if (heightIsLongerDimension)
                {
                    resizeHeight = (int)(imageResized.VerticalResolution * 3);
                    //resizeWidth = Convert.ToInt32((((heightInches - 3) / heightInches) * widthInches) * imageResized.HorizontalResolution);
                    resizeWidth = Convert.ToInt32((((float)imageResized.Width) / (float)imageResized.Height) * imageResized.HorizontalResolution) * 3;
                }
                else
                {
                    resizeWidth = (int)(imageResized.HorizontalResolution * 3);
                    //resizeHeight = Convert.ToInt32((((widthInches - 3) / widthInches) * heightInches) * imageResized.VerticalResolution);
                    resizeHeight = Convert.ToInt32((((float)imageResized.Height) / (float)imageResized.Width) * imageResized.VerticalResolution) * 3;
                }
                //image height and width set in pixel
                Image1.Height = resizeHeight;
                Image1.Width = resizeWidth;
                //image height and width set in inches
                float width = (float)(Math.Round((resizeWidth / imageResized.HorizontalResolution), 1));
                float height = (float)(Math.Round((resizeHeight / imageResized.VerticalResolution), 1));
            }
        }
        catch
        {
            throw;
        }
    }

这是Ansible的错误:

- name: Upload  QA report to S3
  hosts: localhost
  connection: local
  gather_facts: no
  vars_files:
  - aws-vars.yml
  vars: 
    bucketname: qafiles
  tasks:
  - name: Upload report to S3
    aws_s3:
      aws_access_key: "{{ ec2_access_key }}"
      aws_secret_key: "{{ ec2_secret_key }}"
      bucket: "{{ bucketname }}"
      object: QAReport.html
      src: /home/reports/QAReport.html
      mode: put
      overwrite: never

我正在使用AWX 3.0.1.0使用Ansible 2.7.7。

谢谢。

0 个答案:

没有答案
相关问题