abh1sar commented on PR #13643:
URL: https://github.com/apache/cloudstack/pull/13643#issuecomment-5034969848
> ~Assuming that the file output order does not matter, it looks good (did
not test).~
>
> ```shell
> fabricio@pc:~/github/cloudstack$ ls -l --numeric-uid-gid $dest | awk
'{print $5}'
>
> 4978
> 9819
> 13674
> 205830
> 4954
>
> fabricio@pc:~/github/cloudstack$ find "$dest" -type f -exec stat -c '%s'
{} +
> 4954
> 9819
> 4978
> 205830
> 13674
> ```
>
> Edit: I had a look at the code that parses this output. It seems to assume
that the volume's size will be on the last line when backing up a single volume?
>
> ```java
> private long parseBackupSize(String stdout, List<String> diskPaths) {
> long backupSize = 0L;
> if (CollectionUtils.isNullOrEmpty(diskPaths)) {
> List<String> outputLines = Arrays.asList(stdout.split("\n"));
> if (!outputLines.isEmpty()) {
> backupSize =
Long.parseLong(outputLines.get(outputLines.size() - 1).trim());
> }
> } else {
> for (String line : stdout.split("\n")) {
> backupSize = backupSize + Long.parseLong(line.split("
")[0].trim());
> }
> }
> return backupSize;
> }
> ```
>
> @weizhouapache could you check if this output order change may cause a
regression?
In case of a single volume vm there will be only one line, so order doesn't
matter.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]