Repository: cobbler/cobbler

Issue:
do not generate <arch>_menu_items.cfg
### Describe the bug

when i run **cobbler sync**, then check /var/lib/tftpboot/grub file,
I do not find the **/var/lib/tftpboot/grub/x86_64_menu_items.cfg**


### Steps to reproduce

1.
2.
3.

### Expected behavior


### Cobbler version

cobbler --version
Cobbler 3.3.0 

I install cobbler release 3.3.0 from source code

### Operating system

centos7.4

### Cobbler log

debug trace
**file: cobbler/tftpgen.py: get_menu_level -> get_profiles_menu**
````
412  ->	        if menu:
413  	            profile_list = [profile for profile in self.profiles if profile.menu == menu.name]
414  	        else:
415  	            profile_list = [profile for profile in self.profiles if profile.menu is None or profile.menu == ""]
416  	        profile_list = sorted(profile_list, key=lambda profile: profile.name)
417  	        if arch:
(Pdb) n
> /usr/local/lib/python3.6/site-packages/cobbler/tftpgen.py(415)get_profiles_menu()
-> profile_list = [profile for profile in self.profiles if profile.menu is None or profile.menu == ""]
(Pdb) l
410  	        :param arch: The processor architecture to generate the menu items for. (Optional)
411  	        """
412  	        if menu:
413  	            profile_list = [profile for profile in self.profiles if profile.menu == menu.name]
414  	        else:
415  ->	            profile_list = [profile for profile in self.profiles if profile.menu is None or profile.menu == ""]
416  	        profile_list = sorted(profile_list, key=lambda profile: profile.name)
417  	        if arch:
418  	            profile_list = [profile for profile in profile_list if profile.arch == arch]
419  	
420  	        current_menu_items = {}
(Pdb) n
> /usr/local/lib/python3.6/site-packages/cobbler/tftpgen.py(416)get_profiles_menu()
-> profile_list = sorted(profile_list, key=lambda profile: profile.name)
(Pdb) p profile_list
[<cobbler.items.profile.Profile object at 0x7f23fdd67630>, <cobbler.items.profile.Profile object at 0x7f23fddcba20>]
(Pdb) n
> /usr/local/lib/python3.6/site-packages/cobbler/tftpgen.py(417)get_profiles_menu()
-> if arch:
(Pdb) p arch
'x86_64'
(Pdb) n
> /usr/local/lib/python3.6/site-packages/cobbler/tftpgen.py(418)get_profiles_menu()
-> profile_list = [profile for profile in profile_list if profile.arch == arch]
(Pdb) n
> /usr/local/lib/python3.6/site-packages/cobbler/tftpgen.py(420)get_profiles_menu()
-> current_menu_items = {}
(Pdb) p profile_list
[]
(Pdb) p profile_list
[]
(Pdb) p self.profiles
<cobbler.cobbler_collections.profiles.Profiles object at 0x7f23ff2cf2e8>
(Pdb) l
415  	            profile_list = [profile for profile in self.profiles if profile.menu is None or profile.menu == ""]
416  	        profile_list = sorted(profile_list, key=lambda profile: profile.name)
417  	        if arch:
418  	            profile_list = [profile for profile in profile_list if profile.arch == arch]
419  	
420  ->	        current_menu_items = {}
421  	        menu_labels = metadata["menu_labels"]
422  	
423  	        for profile in profile_list:
424  	            if not profile.enable_menu:
425  	                # This profile has been excluded from the menu
(Pdb) p [p.arch for p in self.profiles]
[<Archs.X86_64: 'x86_64'>, <Archs.X86_64: 'x86_64'>]
(Pdb) p [p.parent for p in self.profiles]
[<cobbler.items.distro.Distro object at 0x7f23fddd4470>, <cobbler.items.distro.Distro object at 0x7f23fddd4d30>]
(Pdb) p [p.parent.arch for p in self.profiles]
[<Archs.X86_64: 'x86_64'>, <Archs.X86_64: 'x86_64'>]
(Pdb) p [type(p.parent.arch) for p in self.profiles]
[<enum 'Archs'>, <enum 'Archs'>]
(Pdb) p [p.arch.value for p in self.profiles]     # this test line can fix error
['x86_64', 'x86_64']
````

### Screenshots

### Additional information
so you can see the code trace according to the upper code, 
you will find:
```
def get_profiles_menu(self, menu, metadata, arch: str):
        """
        Generates profiles metadata for pxe, ipxe and grub.

        :param menu: The menu for which boot files are generated. (Optional)
        :param metadata: Pass additional parameters to the ones being collected during the method.
        :param arch: The processor architecture to generate the menu items for. (Optional)
        """
        if menu:
            profile_list = [profile for profile in self.profiles if profile.menu == menu.name]
        else:
            profile_list = [profile for profile in self.profiles if profile.menu is None or profile.menu == ""]
        profile_list = sorted(profile_list, key=lambda profile: profile.name)
        if arch:
            profile_list = [profile for profile in profile_list if profile.arch == arch]
```
the **arch** is a **string** type param, 
but the **profile.arch** is a type **<enum 'Archs'>** ,   they will not be equal forever,
**so may be you can fix this by:**
```
profile_list = [profile for profile in profile_list if profile.arch.value == arch]
```
so you can spare some time to fix it


Discussion:

Resolving patch:
diff --git a/cobbler/tftpgen.py b/cobbler/tftpgen.py
--- a/cobbler/tftpgen.py
+++ b/cobbler/tftpgen.py
@@ -207,7 +207,12 @@ def write_all_system_files(self, system, menu_items):
             # FIXME: profiles also need this data!
             # gather default kernel_options and default kernel_options_s390x
             kernel_options = self.build_kernel_options(
-                system, profile, distro, image, "s390x", blended.get("autoinstall", "")
+                system,
+                profile,
+                distro,
+                image,
+                enums.Archs.S390X,
+                blended.get("autoinstall", ""),
             )
             kopts_aligned = ""
             column = 0
@@ -404,20 +409,20 @@ def make_pxe_menu(self) -> Dict[str, str]:
             template_src.close()
 
         # Write the grub menu:
-        for arch in utils.get_valid_archs():
+        for arch in enums.Archs:
             arch_metadata = self.get_menu_items(arch)
             arch_menu_items = arch_metadata["menu_items"]
 
             if "grub" in arch_menu_items:
                 boot_menu["grub"] = arch_menu_items
                 outfile = os.path.join(
-                    self.bootloc, "grub", "{0}_menu_items.cfg".format(arch)
+                    self.bootloc, "grub", "{0}_menu_items.cfg".format(arch.value)
                 )
                 with open(outfile, "w+") as fd:
                     fd.write(arch_menu_items["grub"])
         return boot_menu
 
-    def get_menu_items(self, arch: Optional[str] = None) -> dict:
+    def get_menu_items(self, arch: Optional[enums.Archs] = None) -> dict:
         """
         Generates menu items for pxe, ipxe and grub. Grub menu items are grouped into submenus by profile.
 
@@ -427,7 +432,7 @@ def get_menu_items(self, arch: Optional[str] = None) -> dict:
         """
         return self.get_menu_level(None, arch)
 
-    def get_submenus(self, menu, metadata: dict, arch: str):
+    def get_submenus(self, menu, metadata: dict, arch: enums.Archs):
         """
         Generates submenus metatdata for pxe, ipxe and grub.
 
@@ -482,7 +487,7 @@ def get_submenus(self, menu, metadata: dict, arch: str):
         metadata["menu_items"] = nested_menu_items
         metadata["menu_labels"] = menu_labels
 
-    def get_profiles_menu(self, menu, metadata, arch: str):
+    def get_profiles_menu(self, menu, metadata, arch: enums.Archs):
         """
         Generates profiles metadata for pxe, ipxe and grub.
 
@@ -547,7 +552,7 @@ def get_profiles_menu(self, menu, metadata, arch: str):
         metadata["menu_items"] = current_menu_items
         metadata["menu_labels"] = menu_labels
 
-    def get_images_menu(self, menu, metadata, arch: str):
+    def get_images_menu(self, menu, metadata, arch: enums.Archs):
         """
         Generates profiles metadata for pxe, ipxe and grub.
 
@@ -609,7 +614,7 @@ def get_images_menu(self, menu, metadata, arch: str):
         metadata["menu_items"] = current_menu_items
         metadata["menu_labels"] = menu_labels
 
-    def get_menu_level(self, menu=None, arch: str = None) -> dict:
+    def get_menu_level(self, menu=None, arch: enums.Archs = None) -> dict:
         """
         Generates menu items for submenus, pxe, ipxe and grub.
 
@@ -784,7 +789,7 @@ def write_pxe_file(
 
         # generate the kernel options and append line:
         kernel_options = self.build_kernel_options(
-            system, profile, distro, image, arch.value, metadata["autoinstall"]
+            system, profile, distro, image, arch, metadata["autoinstall"]
         )
         metadata["kernel_options"] = kernel_options
 
@@ -927,7 +932,7 @@ def build_kernel(
         )
 
     def build_kernel_options(
-        self, system, profile, distro, image, arch: str, autoinstall_path
+        self, system, profile, distro, image, arch: enums.Archs, autoinstall_path
     ) -> str:
         """
         Builds the full kernel options line.


Test patch: