Skip to content

Commit a302ca6

Browse files
committed
working on s3 bug
1 parent d20d33d commit a302ca6

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

Interfaces/ObjectStorage/Gateways/gtwAWSS3.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ bool gtwAWSS3::storeFile(
4949
<< "]"
5050
);
5151

52+
TargomanLogDebug(5, "*** gtwAWSS3::storeFile: #" << __LINE__ << "QFile::exists");
53+
if (QFile::exists(_fullFileName) == false)
54+
throw exTargomanBase(QString("File %1 not found").arg(_fullFileName));
55+
5256
// QString Bucket = _uploadGateway.ugwMetaInfo[AWSS3MetaInfoJsonKey::Bucket].toString();
5357
// QString EndpointUrl = _uploadGateway.ugwMetaInfo[AWSS3MetaInfoJsonKey::EndpointUrl].toString();
5458

@@ -101,8 +105,9 @@ bool gtwAWSS3::storeFile(
101105
TargomanLogDebug(5, "*** gtwAWSS3::storeFile: #" << __LINE__);
102106
Request.SetBucket(_uploadGateway.ugwBucket.toStdString());
103107

104-
TargomanLogDebug(5, "*** gtwAWSS3::storeFile: #" << __LINE__);
105-
Request.SetKey(QString("%1/%2").arg(_path).arg(_fileName).toStdString());
108+
QString Key = QString("%1/%2").arg(_path).arg(_fileName);
109+
TargomanLogDebug(5, "*** gtwAWSS3::storeFile: #" << __LINE__ << Key);
110+
Request.SetKey(Key.toStdString());
106111

107112
TargomanLogDebug(5, "*** gtwAWSS3::storeFile: #" << __LINE__);
108113
Request.SetACL(S3::Model::ObjectCannedACL::public_read);
@@ -117,7 +122,7 @@ bool gtwAWSS3::storeFile(
117122
Request.SetBody(InputData);
118123

119124
//----------------------------------------
120-
TargomanLogDebug(5, "*** gtwAWSS3::storeFile: #" << __LINE__);
125+
TargomanLogDebug(5, "*** gtwAWSS3::storeFile: #" << __LINE__ << "S3Client.PutObject");
121126
S3::Model::PutObjectOutcome Outcome = S3Client.PutObject(Request);
122127

123128
TargomanLogDebug(5, "*** gtwAWSS3::storeFile: #" << __LINE__);

Interfaces/ObjectStorage/Gateways/gtwAWSS3.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,18 @@ using namespace Aws;
4747
15.2) zypper ar -no-gpgcheck https://download.opensuse.org/repositories/home:/targoman/openSUSE_Leap_15.2/home:targoman.repo
4848
15.3) zypper ar -no-gpgcheck https://download.opensuse.org/repositories/home:/targoman/15.3/home:targoman.repo
4949
50-
zypper in aws-sdk-cpp-s3-devel
50+
- zypper in aws-sdk-cpp-s3-devel
51+
- OR
52+
- zypper in aws-sdk-cpp-s3
5153
*/
5254

5355
/** installing AmazonAWS S3 from source ************************************************************
5456
git clone --recurse-submodules https://github.com/aws/aws-sdk-cpp
5557
mkdir aws-build.s3
5658
cd aws-build.s3
57-
cmake ../aws-sdk-cpp -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_PREFIX_PATH=/usr -DBUILD_ONLY="s3"
59+
- cmake ../aws-sdk-cpp -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_PREFIX_PATH=/usr -DBUILD_ONLY="s3"
60+
- OR
61+
- cmake ../aws-sdk-cpp -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_PREFIX_PATH=/usr -DBUILD_ONLY="s3"
5862
make
5963
sudo make install
6064
*/
@@ -75,7 +79,7 @@ struct __static_s3_initializer__ {
7579
//An instance of Aws::SDKOptions is passed to the Aws::InitAPI and
7680
//Aws::ShutdownAPI methods. The same instance should be sent to both methods.
7781
#ifdef QT_DEBUG
78-
options.loggingOptions.logLevel = Utils::Logging::LogLevel::Debug;
82+
options.loggingOptions.logLevel = Utils::Logging::LogLevel::Trace;
7983
#else
8084
options.loggingOptions.logLevel = Utils::Logging::LogLevel::Off;
8185
#endif

0 commit comments

Comments
 (0)