#438 Copy raw config wrapper without permissions
Merged 3 years ago by lsedlar. Opened 3 years ago by lsedlar.
lsedlar/odcs fix-config-perms  into  master

file modified
+1 -1
@@ -117,7 +117,7 @@ 

          # and override some variables.

          if self.raw_config_wrapper_conf_path:

              main_cfg_path = os.path.join(topdir, "raw_config.conf")

-             shutil.copy2(

+             shutil.copyfile(

                  self.raw_config_wrapper_conf_path, os.path.join(topdir, "pungi.conf")

              )

              self.apply_raw_config_wrapper_overrides(os.path.join(topdir, "pungi.conf"))

The wrapper in /etc/odcs is quite possibly a read-only file. If we copy it with permissions, we end up with a file that can not be modified. Since we do intend to modify it, only the contents should be copied.

OK for me. Why copyfile is better than copy (without 2)? Is more efficient somehow?

copy copies permissions as well, copyfile takes only content.

Thanks, now I see. Metadata = permissions + other metadata.

Pull-Request has been merged by lsedlar

3 years ago