Repository: cobbler/cobbler

Issue:
Reposync command fails when `--tries` is given
### Describe the bug

On Cobbler 3.3.3, the `cobbler reposync` command fails when given the `--tries` argument. For example:

```
$ cobbler reposync --no-fail --tries=3
task started: 2023-03-22_100213_reposync
task started (id=Reposync, time=Wed Mar 22 10:02:13 2023)
running python triggers from /var/lib/cobbler/triggers/task/reposync/pre/*
running shell triggers from /var/lib/cobbler/triggers/task/reposync/pre/*
shell triggers finished successfully
reposync; [None]
hello, reposync
run, reposync, run!
Exception occurred: <class 'TypeError'>
Exception value: can only concatenate str (not "int") to str
Exception Info:
!!! TASK FAILED !!!
```

I have not tested this on the main branch, but looking at the code I'm reasonably confident it would still be an issue: the `--tries` argument is parsed as a string (in `cobbler/cli.py`), and given to the `background_reposync` function as such; no type conversion occurs through to the `cobbler/actions/reposync.py` file, at which point the command would fail because of the attempt to add 1 to the tries (https://github.com/cobbler/cobbler/blob/main/cobbler/actions/reposync.py#L138).

### Steps to reproduce

1. Run `cobbler reposync --tries=3`

### Expected behavior

Cobbler runs reposync with 3 attempts.

### Cobbler version

<!--- Paste output from `cobbler version` -->
````
Cobbler 3.3.3
````

### Operating system

Rocky Linux 9

### Cobbler log

<!--- Paste (partial) output from `/var/log/cobbler/cobbler.log` -->
````
[Thread-54] 2023-03-22T10:02:22 - INFO | REMOTE start_task(Reposync); event_id(2023-03-22_100222_reposync); user(?)
[2023-03-22_100222_reposync] 2023-03-22T10:02:23 - DEBUG | running python triggers from /var/lib/cobbler/triggers/task/reposync/pre/*
[2023-03-22_100222_reposync] 2023-03-22T10:02:23 - DEBUG | running shell triggers from /var/lib/cobbler/triggers/task/reposync/pre/*
[2023-03-22_100222_reposync] 2023-03-22T10:02:23 - DEBUG | shell triggers finished successfully
[2023-03-22_100222_reposync] 2023-03-22T10:02:23 - INFO | reposync; [None]
[2023-03-22_100222_reposync] 2023-03-22T10:02:23 - INFO | hello, reposync
[2023-03-22_100222_reposync] 2023-03-22T10:02:23 - INFO | run, reposync, run!
[2023-03-22_100222_reposync] 2023-03-22T10:02:23 - INFO | Exception occurred: <class 'TypeError'>
[2023-03-22_100222_reposync] 2023-03-22T10:02:23 - INFO | Exception value: can only concatenate str (not "int") to str
[2023-03-22_100222_reposync] 2023-03-22T10:02:23 - INFO | Exception Info:
  File "/usr/lib/python3.9/site-packages/cobbler/remote.py", line 99, in run
    rc = self._run(self)

  File "/usr/lib/python3.9/site-packages/cobbler/remote.py", line 341, in runner
    self.remote.api.reposync(

  File "/usr/lib/python3.9/site-packages/cobbler/api.py", line 1645, in reposync
    action_reposync.run(name)

  File "/usr/lib/python3.9/site-packages/cobbler/actions/reposync.py", line 147, in run
    for x in range(self.tries + 1, 1, -1):

[2023-03-22_100222_reposync] 2023-03-22T10:02:23 - ERROR | ### TASK FAILED ###
````

### Screenshots

<!--- If applicable, add screenshots to help explain your problem. -->

N/A

### Additional information

<!--- Add any other context about the problem here. -->

N/A


Discussion:

Resolving patch:
diff --git a/cobbler/cli.py b/cobbler/cli.py
--- a/cobbler/cli.py
+++ b/cobbler/cli.py
@@ -2582,7 +2582,11 @@ def direct_command(self, action_name: str):
                 "--only", dest="only", help="update only this repository name"
             )
             self.parser.add_option(
-                "--tries", dest="tries", help="try each repo this many times", default=1
+                "--tries",
+                dest="tries",
+                help="try each repo this many times",
+                default=1,
+                type="int",
             )
             self.parser.add_option(
                 "--no-fail",


Test patch: