Repository: cobbler/cobbler

Issue:
Cobbler 3.2.2 - unable to build ISO
### Describe the bug

Trying to build iso from Web interface for Rocky Linux 9.3:

```
running python triggers from /var/lib/cobbler/triggers/task/buildiso/pre/*
running shell triggers from /var/lib/cobbler/triggers/task/buildiso/pre/*
shell triggers finished successfully
using/creating buildisodir: /var/cache/cobbler/buildiso
building tree for isolinux
copying miscellaneous files
processing profile: Rocky-9.3-Test
Exception occurred: <class 'AttributeError'>
Exception value: 'BuildIso' object has no attribute 'data'
Exception Info:
  File "/usr/lib/python3.9/site-packages/cobbler/remote.py", line 98, in run
    rc = self._run(self)

  File "/usr/lib/python3.9/site-packages/cobbler/remote.py", line 165, in runner
    self.remote.api.build_iso(

  File "/usr/lib/python3.9/site-packages/cobbler/api.py", line 1612, in build_iso
    builder.run(

  File "/usr/lib/python3.9/site-packages/cobbler/actions/buildiso.py", line 740, in run
    self.generate_netboot_iso(imagesdir, isolinuxdir, profiles, systems, exclude_dns)

  File "/usr/lib/python3.9/site-packages/cobbler/actions/buildiso.py", line 229, in generate_netboot_iso
    append_line += " inst.ks=%s" % self.data["autoinstall"]

### TASK FAILED ###
```

### Expected behavior

ISO is built.

### Cobbler version

<!--- Paste output from `cobbler version` -->
````
Cobbler 3.2.2
  source: ?, ?
  build time: Wed Apr  5 00:00:00 2023
````

### Operating system

Rocky Linux 9.3



Discussion:

Resolving patch:
diff --git a/cobbler/actions/buildiso.py b/cobbler/actions/buildiso.py
--- a/cobbler/actions/buildiso.py
+++ b/cobbler/actions/buildiso.py
@@ -224,9 +224,9 @@ def generate_netboot_iso(self, imagesdir, isolinuxdir, profiles=None, systems=No
                 if "proxy" in data and data["proxy"] != "":
                     append_line += " proxy=%s http_proxy=%s" % (data["proxy"], data["proxy"])
                 if dist.os_version in ["rhel4", "rhel5", "rhel6", "fedora16"]:
-                    append_line += " ks=%s" % self.data["autoinstall"]
+                    append_line += " ks=%s" % data["autoinstall"]
                 else:
-                    append_line += " inst.ks=%s" % self.data["autoinstall"]
+                    append_line += " inst.ks=%s" % data["autoinstall"]
 
             if dist.breed in ["ubuntu", "debian"]:
                 append_line += " auto-install/enable=true url=%s" % data["autoinstall"]
@@ -276,10 +276,10 @@ def generate_netboot_iso(self, imagesdir, isolinuxdir, profiles=None, systems=No
             if dist.breed == "redhat":
                 if "proxy" in data and data["proxy"] != "":
                     append_line += " proxy=%s http_proxy=%s" % (data["proxy"], data["proxy"])
-                if os_version in ["rhel4", "rhel5", "rhel6", "fedora16"]:
-                    append_line += " ks=%s" % self.data["autoinstall"]
+                if dist.os_version in ["rhel4", "rhel5", "rhel6", "fedora16"]:
+                    append_line += " ks=%s" % data["autoinstall"]
                 else:
-                    append_line += " inst.ks=%s" % self.data["autoinstall"]
+                    append_line += " inst.ks=%s" % data["autoinstall"]
 
             if dist.breed in ["ubuntu", "debian"]:
                 append_line += " auto-install/enable=true url=%s netcfg/disable_autoconfig=true" % data["autoinstall"]
@@ -729,7 +729,7 @@ def run(self, iso=None, buildisodir=None, profiles=None, systems=None, distro=No
                         file_copy_success[file_to_copy] = True
 
         if False in file_copy_success.values():
-            for k, v in file_copy_success:
+            for k, v in file_copy_success.items():
                 if not v:
                     self.logger.error("File not found: %s" % k)
             utils.die(self.logger, "Required file(s) not found. Please check your syslinux installation")


Test patch: