#547 fix copr-cli downloading parent directory for cancelled builds
Merged 5 years ago by msuchy. Opened 5 years ago by dturecek.
copr/ dturecek/copr issue-479  into  master

file modified
+5 -1
@@ -472,7 +472,11 @@ 

              if args.chroots and chroot.name not in args.chroots:

                  continue

  

-             cmd = "wget -r -nH --no-parent --reject 'index.html*'".split(' ')

+             if not chroot.result_url:

+                 sys.stderr.write("No data for build id: {} and chroot: {}.\n".format(args.build_id, chroot.name))

+                 continue

+ 

+             cmd = ['wget', '-r', '-nH', '--no-parent', '--reject', '"index.html*"', '-e', 'robots=off']

              cmd.extend(['-P', os.path.join(args.dest, chroot.name)])

              cmd.extend(['--cut-dirs', str(base_len + 4)])

              cmd.append(chroot.result_url)

@@ -1185,6 +1185,8 @@ 

  

      @property

      def result_dir_url(self):

+         if not self.result_dir:

+             return None

          return urljoin(app.config["BACKEND_BASE_URL"], os.path.join(

              "results", self.build.copr_dir.full_name, self.name, self.result_dir, ""))

  

This addresses Issue#479 where copr-cli download-build -d ./ $BUILDID downloads the parent directory if the directory for the specified build was not created.

Good job, although it would be better if frontend sent the result_url empty if there is no builddir. Then just check for the attribute emptiness/non-emptiness would be needed.

1 new commit added

  • [cli][frontend] return empty url for cancelled builds
5 years ago

2 new commits added

  • [cli][frontend] return empty url for cancelled builds
  • [cli] fix copr-cli downloading parent directory for cancelled builds
5 years ago

2 new commits added

  • [cli][frontend] return empty url for cancelled builds
  • [cli] fix copr-cli downloading parent directory for cancelled builds
5 years ago

I've fixed the issues we've talked about at the meeting.

I would go with None also here, if possible.
But in case, that it some issue with it, I don't insist on it.

rebased onto 132ea2080973cdb52137b7ae85dc42a9a4ce36d9

5 years ago

rebased onto 6daee05

5 years ago

Pull-Request has been merged by msuchy

5 years ago